1 # Copyright (c) 2018 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 path: /lib/systemd/system/docker.service.d
23 dest: /lib/systemd/system/docker.service.d/kolla.conf
26 ostack_hosts: "{{ ostack_hosts | default([]) + [hostvars[item].ansible_host] }}"
27 with_items: "{{ groups['ostack'] }}"
29 - name: Create proxy configuration for docker
33 Environment="HTTP_PROXY={{ lookup('env', 'http_proxy') }}"
34 Environment="HTTPS_PROXY={{ lookup('env', 'https_proxy') }}"
35 Environment="FTP_PROXY={{ lookup('env', 'ftp_proxy') }}"
36 Environment="NO_PROXY={{ lookup('env', 'no_proxy') }},{{ hostvars[ansible_host].ansible_default_ipv4.address }},{{ ostack_hosts | join(',') }}"
37 dest: /lib/systemd/system/docker.service.d/http-proxy.conf
39 - name: Update /etc/default/docker
41 path: /etc/default/docker
42 line: 'DOCKER_OPTS="--dns {{ hostvars[ansible_host].ansible_default_ipv4.gateway }} --insecure-registry {{ deploy_host }}:4000"'
44 - name: reload restart docker