I have a playbook that I run tags "configure" and new configuration gets copied and I see the changed status in the playbook logs but finally handlers are skipped so my new configuration is not loaded
playbook log
TASK [my-server : Validate and copy config] ********
changed: [server101] => (item=/home/myitem.conf)
RUNNING HANDLER [my-server : reload service] **************
skipping: [server101]
here is my task
main.yml
- include: configure.yml
become: true
tags:
- configure
handler
- name: reload service
become: true
supervisorctl:
name: xxxx
state: restarted
listen: "reload service"
when: xxx == "true"
task in configure.yml:
- name: Validate and copy config
copy:
src: "{{ item }}"
dest: "{{ config_dir }}"
owner: root
group: root
mode: 0640
validate: "/xxx/xxx/tool check %s"
with_fileglob:
- /tmp/configs/*.config
notify:
- reload service
where I'm doing wrong?
Best Answer
I am assuming you obfuscated your task? There are no tags on that either? So that shouldn't be running. But lets assuming it is running, and you had just removed the tags as part of your obfuscation.
I would be tempted to either add the 'configure' tag to your handlers, or perhaps the 'always' tag.