# file: roles/beaver-configure/handlers/main.yml
- name: restart beaver
service: name=beaver.sh state=restarted
when: flag_not_restart is not defined
# file: roles/beaver-configure/tasks/main.yml
- name: Copy conf beaver
template: src=../templates/conf.j2 dest=/etc/beaver/conf group=root owner=root mode=0644
notify: restart beaver
- name: Start a enable beaver
service: name=beaver.sh enabled=yes state=started
I call an ansible playbook which calls the beaver role with:
/usr/local/bin/ansible-playbook /tmp/ansible-local/php.yml --extra-vars 'flag_not_restart=1' -c local -i /tmp/ansible-local/localhost.inv
If I debug the "flag_not_restart" I can see it exist and is "1".
And yet the "restart beaver" handler is called and executed.
So, am I doing something wrong?