blob: 3d5beb564ece027da7aba7fe2e5ea11c16e863c4 [file] [log] [blame]
Fatih Degirmencief69d2a2019-02-27 10:56:14 +00001---
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 Degirmenci82259612019-05-02 11:44:02 -060020- name: Install packages on {{ ansible_os_family }}
21 include_tasks: "install-packages-{{ ansible_os_family }}.yml"
Fatih Degirmencief69d2a2019-02-27 10:56:14 +000022
Yantian You09d30492019-05-22 20:35:44 +020023- 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 Degirmenci572223c2019-12-11 13:43:10 +010034 when: not dir_stats.stat.exists
Yantian You09d30492019-05-22 20:35:44 +020035
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 Degirmencief69d2a2019-02-27 10:56:14 +000052# vim: set ts=2 sw=2 expandtab: