I have written a script to do IOS upgrade of cisco devices. However problem is that each TASK in playbook gets executed SIMULTANEOUSLY on all devices defined in inventory file before moving on to next TASK.
But my requirement is:
-
I want to complete IOS upgrade of 1 device first and only after that, move on to 2nd device
-
If IOS upgrade of 1st device fails for some reason, then IOS upgrade activity should not proceed any further.
1 solution i can think for 1st point is to write multiple plays within a single playbook and then define 1 host in 1 play but that would be m ake the playbook extremely long (if i decide to upgrade 20 devices for example).
Please suggest what other script needs to be added to achive both the objectives?
Thanks,
Vikram