Created
January 5, 2017 15:17
-
-
Save Hounddog/a52b6579dd07f9c06930d09b728aa96d to your computer and use it in GitHub Desktop.
Ansible notify handler running multiple times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
default: | |
template: default | |
file_name: default.conf | |
cadvisor: | |
template: ssl | |
log: [] | |
location: | |
- name: "/" | |
ProxyPass: "http://127.0.0.1:5055/" | |
ProxyPassReverse: "http://127.0.0.1:5055/" | |
RequestHeader: 'set X-Forwarded-Proto "https"' | |
docker: | |
template: ssl | |
rancher: | |
template: ssl | |
docker-hub: | |
template: ssl | |
docker-snapshot: | |
template: ssl | |
bower: | |
template: ssl | |
cdp: | |
template: ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Test Apache and Restart | |
include: test_vhosts.yml | |
notify: Reload Apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Create Temporary vhosts.d directory | |
file: path={{ apache.temp_vhosts }} state=directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUNNING HANDLER [apache : Create Temporary vhosts.d directory] ***************** | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] | |
ok: [127.0.0.1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Create Vhosts | |
become: yes | |
template: | |
src: "{{ item.value.template }}.j2" | |
dest: "{{ apache.vhosts }}{{ item.key }}.conf" | |
with_dict: "{{ services }}" | |
register: vhost_updated | |
when: services|lower != 'none' | |
notify: | |
- Test Apache and Restart | |
tags: | |
- vhosts_deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment