Skip to content

Instantly share code, notes, and snippets.

@Hounddog
Created January 5, 2017 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hounddog/a52b6579dd07f9c06930d09b728aa96d to your computer and use it in GitHub Desktop.
Save Hounddog/a52b6579dd07f9c06930d09b728aa96d to your computer and use it in GitHub Desktop.
Ansible notify handler running multiple times
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
---
- name: Test Apache and Restart
include: test_vhosts.yml
notify: Reload Apache
- name: Create Temporary vhosts.d directory
file: path={{ apache.temp_vhosts }} state=directory
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]
- 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