I have a requirement where I need to Restart a set of windows services on a set of hosts sequentially with 60 seconds between service start. Appreciate your help
Order of Services
- Polling Agent Service
wait 60 seconds then start 2) Memcached wait 30 seconds then start 3) watcher
2
Answers
For linux systems, I do the following:
I assume you can apply the same logic same for windows systems, w
sleep/ping/timeout
andwin_command
You can use
loop_control
withpause
(in seconds).https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#pausing-within-a-loop
One disadventage in your case is, that the pause time is the same with each loop, and not dynamically.