hi,
If I use the handler incorrectly, please let me know.
I'm using Ansible a quiet while and recently migrated from 1.9 to 2.1.0.0.
My target host is CentOS 6.5
I try to follow the documentation, but can't make the handlers work.
The playbook structure is generated by ansible-galaxy init projectname,
and I use the following logic:
site.yml has lines something like:
- name: single node setup of projectname
vars_files:
- vars/main.yml
hosts: node01
become: true
roles:
- base
Logical structure:
site.yml
└── roles
└── base
└── tasks
└── main.yml
Example line in main.yml:
- name: configure iptables rules
template: src=iptables_config.j2 dest=/etc/sysconfig/iptables owner=root
group=root mode=0600
notify:
- iptables restart
In roles directory I have a task with main.yml, and from that main.yml I
add package configuration with template.
When the template is updated, I have a handler called, but for some reason
it's not executed.
Handlers are in same level as site.yml:
└── handlers
└── main.yml
Example line in handlers/main.yml:
- name: iptables restart
service: name=iptables state=restarted
I expect the handler take action when the template updates the iptables
configuration file, but it's never called.
This issue is not specific to the above example.
Regards,
Szabolcs
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6059227c-bc95-441a-9aef-c93550ba136e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.