Fatih Degirmenci | ef69d2a | 2019-02-27 10:56:14 +0000 | [diff] [blame] | 1 | --- |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2019 The Nordix Foundation. All rights reserved. |
| 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | |
Fatih Degirmenci | 8225961 | 2019-05-02 11:44:02 -0600 | [diff] [blame] | 20 | - name: Install packages on {{ ansible_os_family }} |
| 21 | include_tasks: "install-packages-{{ ansible_os_family }}.yml" |
Fatih Degirmenci | ef69d2a | 2019-02-27 10:56:14 +0000 | [diff] [blame] | 22 | |
Yantian You | 09d3049 | 2019-05-22 20:35:44 +0200 | [diff] [blame] | 23 | - name: Config docker proxy |
| 24 | block: |
| 25 | - name: Check that /etc/systemd/system/docker.service.d exists |
| 26 | stat: |
| 27 | path: "/etc/systemd/system/docker.service.d" |
| 28 | register: dir_stats |
| 29 | |
| 30 | - name: Create /etc/systemd/system/docker.service.d if not exists |
| 31 | file: |
| 32 | path: "/etc/systemd/system/docker.service.d" |
| 33 | state: directory |
Fatih Degirmenci | 572223c | 2019-12-11 13:43:10 +0100 | [diff] [blame^] | 34 | when: not dir_stats.stat.exists |
Yantian You | 09d3049 | 2019-05-22 20:35:44 +0200 | [diff] [blame] | 35 | |
| 36 | - name: Create proxy conf file under /etc/systemd/system/docker.service.d/ |
| 37 | file: |
| 38 | path: "/etc/systemd/system/docker.service.d/http-proxy.conf" |
| 39 | state: touch |
| 40 | |
| 41 | - name: Config docker proxy in http-proxy.conf |
| 42 | blockinfile: |
| 43 | dest: "/etc/systemd/system/docker.service.d/http-proxy.conf" |
| 44 | block: | |
| 45 | [Service] |
| 46 | Environment="HTTP_PROXY={{ idf.proxy_settings.http_proxy }}" |
| 47 | Environment="HTTPS_PROXY={{ idf.proxy_settings.https_proxy }}" |
| 48 | Environment="NO_PROXY={{ idf.proxy_settings.no_proxy }}" |
| 49 | when: |
| 50 | idf.proxy_settings is defined |
| 51 | |
Fatih Degirmenci | ef69d2a | 2019-02-27 10:56:14 +0000 | [diff] [blame] | 52 | # vim: set ts=2 sw=2 expandtab: |