Ansible cisco ios upgrade on stack of switches

Hi every one,

I’m trying to perform ios upgrade on a stack of 2 X 2960-XR cisco switch models using ansible but I don’t really know how to process. Here below are the step I figured out tout realize it:

  1. Check if the current IOS version and compare it with the upgrade image version
  2. Backup the running config
  3. Copy IOS image to the switches
  4. Change the boot variable
  5. Reload the switches
  6. Test the reacherbility of switches
  7. Validate the new installed IOS is correct

Those are the tasks to be included in my playbook. After runing the playbook, the 1rst task shows only the IOS version on master switch and i have expected to have it on both switches. I got also stuck on the 3 trd task because I only know the way to copy image on a single switch using ansible.
Could anybody help me please?