2016-11-04 21:40:14 +00:00
|
|
|
---
|
|
|
|
- name: Create docker service systemd directory if it doesn't exist
|
|
|
|
file: path=/etc/systemd/system/docker.service.d state=directory
|
|
|
|
|
|
|
|
- name: Write docker proxy drop-in
|
|
|
|
template:
|
|
|
|
src: http-proxy.conf.j2
|
|
|
|
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
|
|
|
when: http_proxy is defined or https_proxy is defined or no_proxy is defined
|
|
|
|
|
|
|
|
- name: Write docker.service systemd file
|
|
|
|
template:
|
|
|
|
src: docker.service.j2
|
|
|
|
dest: /etc/systemd/system/docker.service
|
|
|
|
register: docker_service_file
|
2017-01-05 15:32:08 +00:00
|
|
|
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
|
2016-11-04 21:40:14 +00:00
|
|
|
|
|
|
|
- name: Write docker options systemd drop-in
|
|
|
|
template:
|
|
|
|
src: docker-options.conf.j2
|
|
|
|
dest: "/etc/systemd/system/docker.service.d/docker-options.conf"
|
|
|
|
notify: restart docker
|
|
|
|
|
2016-12-21 16:18:11 +00:00
|
|
|
- name: Write docker dns systemd drop-in
|
|
|
|
template:
|
|
|
|
src: docker-dns.conf.j2
|
|
|
|
dest: "/etc/systemd/system/docker.service.d/docker-dns.conf"
|
|
|
|
notify: restart docker
|
|
|
|
when: dns_mode != 'none' and resolvconf_mode == 'docker_dns'
|
|
|
|
|
2016-11-04 21:40:14 +00:00
|
|
|
- meta: flush_handlers
|