Skip to content

Instantly share code, notes, and snippets.

@j0057
Last active December 19, 2019 16:44
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j0057/5af0ac913a203a5b94ef to your computer and use it in GitHub Desktop.
Save j0057/5af0ac913a203a5b94ef to your computer and use it in GitHub Desktop.
Ansible notification for each role
[defaults]
hostfile = ./hosts
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python2
- name: "something happened to {{ name }}"
debug:
msg: "{{ name }}"
- name: do something
shell: "echo {{ name }}"
notify: "something happened to {{ name }}"
- name: do something else
shell: "echo {{ name }}"
notify: "something happened to {{ name }}"
- meta: flush_handlers
- hosts: localhost
roles:
- role: something
name: a
- role: something
name: b
@stephane
Copy link

stephane commented May 4, 2017

Thank you, it's nice hack (in waiting for a better solution) to provide touch reload of uWSGI processes:

- name: "touch reload uwsgi {{ app }}"
  file: path="/var/run/uwsgi/app/{{ app }}/reload" state=touch
  become: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment