I guess the most common scenarios where I use handlers within Ansible would be, I need to reboot a device and wait for some period of time for it to start the reboot process, and again for the reboot process to complete.
So this would be two handlers, one to wait a determined amount of time for the reboot to initiate, and another handler to identify when the device is reachable once more (IP reachable, or NETCONF up etc.).
Discussed in a little more detail here: https://www.juniper.net/documentation/us/en/software/junos-ansible/ansible/ansible.pdf
In some scenarios the handler might actually do some stuff, for example notifying when NETCONF is available after a reboot, other times a handler might just be a sleep statement to wait a fixed period of time.
A few examples can be found in the link I've shared.
Regards,
------------------------------
Andy Sharp
------------------------------
Original Message:
Sent: 07-31-2024 09:45
From: djadhav
Subject: Question on Ansible Handlers
Hi.
Are you using Ansible handlers when automating Junos devices? Can you mention what for?
Thanks,
Deepak