Manages Ansible 2.4+ with Docker

Closes #30
This commit is contained in:
Emilien Mantel
2018-03-15 18:06:38 +01:00
parent 737dfbeb30
commit c2685732a4
2 changed files with 23 additions and 5 deletions

View File

@@ -2,21 +2,35 @@
- name: reload nginx
command: nginx -t
notify: real-reload nginx
notify:
- real-reload nginx
- docker reload nginx
- name: restart nginx
command: nginx -t
notify: real-restart nginx
notify:
- real-restart nginx
- docker restart nginx
- name: real-reload nginx
service:
name: nginx
state: reloaded
when: ansible_virtualization_type != 'docker'
- name: real-restart nginx
service:
name: nginx
state: restarted
when: ansible_virtualization_type != 'docker'
- name: docker reload nginx
command: service nginx reload
when: ansible_virtualization_type == 'docker'
- name: docker restart nginx
command: service nginx restart
when: ansible_virtualization_type == 'docker'
- name: restart nginx freebsd
service: