updated to use handlers
This commit is contained in:
parent
9b8a757526
commit
66d9a6ebbc
2 changed files with 16 additions and 9 deletions
15
roles/docker/handlers/main.yml
Normal file
15
roles/docker/handlers/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
- name: restart docker
|
||||||
|
command: /bin/true
|
||||||
|
notify:
|
||||||
|
- reload systemd
|
||||||
|
- reload docker
|
||||||
|
|
||||||
|
- name : reload systemd
|
||||||
|
shell: systemctl daemon-reload
|
||||||
|
when: ansible_service_mgr == "systemd"
|
||||||
|
|
||||||
|
- name: reload docker
|
||||||
|
service:
|
||||||
|
name: docker
|
||||||
|
state: restarted
|
|
@ -6,12 +6,4 @@
|
||||||
template:
|
template:
|
||||||
src: http-proxy.conf.j2
|
src: http-proxy.conf.j2
|
||||||
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||||
register: systemddockerproxy
|
notify: restart docker
|
||||||
|
|
||||||
- name: reload systemctl daemons
|
|
||||||
shell: systemctl daemon-reload
|
|
||||||
when: systemddockerproxy.changed
|
|
||||||
|
|
||||||
- name: restart docker so configs are applies
|
|
||||||
service: name=docker state=restarted
|
|
||||||
when: systemddockerproxy.changed
|
|
||||||
|
|
Loading…
Reference in a new issue