2016-11-04 21:40:14 +00:00
|
|
|
---
|
|
|
|
- name: Create docker service systemd directory if it doesn't exist
|
2017-02-17 21:22:34 +00:00
|
|
|
file:
|
|
|
|
path: /etc/systemd/system/docker.service.d
|
|
|
|
state: directory
|
2016-11-04 21:40:14 +00:00
|
|
|
|
|
|
|
- name: Write docker proxy drop-in
|
|
|
|
template:
|
|
|
|
src: http-proxy.conf.j2
|
|
|
|
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
2018-01-12 02:56:25 +00:00
|
|
|
notify: restart docker
|
2017-10-11 18:47:27 +00:00
|
|
|
when: http_proxy is defined or https_proxy is defined
|
2016-11-04 21:40:14 +00:00
|
|
|
|
2017-08-09 22:49:53 +00:00
|
|
|
- name: get systemd version
|
|
|
|
command: rpm -q --qf '%{V}\n' systemd
|
|
|
|
register: systemd_version
|
2017-08-10 20:49:14 +00:00
|
|
|
when: ansible_os_family == "RedHat" and not is_atomic
|
2017-08-14 19:31:44 +00:00
|
|
|
changed_when: false
|
2017-08-09 22:49:53 +00:00
|
|
|
|
2016-11-04 21:40:14 +00:00
|
|
|
- name: Write docker.service systemd file
|
|
|
|
template:
|
|
|
|
src: docker.service.j2
|
|
|
|
dest: /etc/systemd/system/docker.service
|
|
|
|
register: docker_service_file
|
2017-08-09 22:49:53 +00:00
|
|
|
notify: restart docker
|
2017-02-24 21:41:27 +00:00
|
|
|
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
|
|
|
|
|
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'
|
|
|
|
|
2017-10-11 18:47:27 +00:00
|
|
|
- meta: flush_handlers
|