Hi,
I am running a playbook with a task that calls a handler like so:
`
- name: “Configure zabbix-agent”
win_template:
src: zabbix_agentd.conf.j2
dest: C:\Program Files\Zabbix Agent\zabbix_agentd.conf
newline_sequence: ‘\n’
trim_blocks: no
notify: restart zabbix-agent
`
The handler itself is:
`
- name: restart zabbix-agent
win_service:
name: Zabbix Agent
state: restarted
start_mode: auto
`
When I run the playbook there are no errors, but when it reaches the end there is no mention of the handler and it doesn’t run.
The funny thing is, when I use the Linux equivalent and run it on a Linux host, it does work:
`
- name: restart zabbix-agent
service: name={{ zabbix_agent_service }}
state=restarted
enabled=yes
become: yes
`
I could just set it as a task, but I don’t want the playbook to restart the service every time it runs, just when something changed.
Any help appreciated