Merge "Fix Prox L2fwd generator packet"
[yardstick.git] / ansible / roles / infra_rampup_stack_nodes / tasks / configure_docker.yml
1 # Copyright (c) 2018 Intel Corporation.
2 #
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
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 ---
15 - file:
16     path: /lib/systemd/system/docker.service.d
17     state: directory
18
19 - copy:
20     content: |
21       [Service]
22       MountFlags=shared
23     dest: /lib/systemd/system/docker.service.d/kolla.conf
24
25 - set_fact:
26     ostack_hosts: "{{ ostack_hosts | default([]) + [hostvars[item].ansible_host] }}"
27   with_items: "{{ groups['ostack'] }}"
28
29 - name: Create proxy configuration for docker
30   copy:
31     content: |
32       [Service]
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
38
39 - name: Update /etc/default/docker
40   lineinfile:
41     path: /etc/default/docker
42     line: 'DOCKER_OPTS="--dns {{ hostvars[ansible_host].ansible_default_ipv4.gateway }} --insecure-registry {{ deploy_host }}:4000"'
43
44 - name: reload restart docker
45   systemd:
46     state: restarted
47     daemon_reload: yes
48     name: docker