Hi Team,
I am trying to upgrade a cat9300 switch from version 16.06.06 to 17.09.04a. The switch is in bundle mode and will convert it to install mode as well.
Here is my task:
- name: Install and activate new IOS image
cisco.ios.ios_command:
commands:
- command: ‘install add file flash: cat9k_iosxe.17.09.04a.SPA.bin activate commit’
prompt:
-
‘Please confirm you have changed boot config to flash:packages.conf [y/n]’
-
‘This operation requires a reload of the system. Do you want to proceed? [y/n]’
answer:
-
‘y’
-
‘y’
register: install_image
vars:
ansible_command_timeout: 1400
Problem is dealing with multi prompt (with some delay between prompts). My task can catch the first prompt and answer accordingly but failed to catch the second prompt.
Here is the actual output when I upgrade the switch manually:
XX-9300#install add file flash:cat9k_iosxe.17.09.04a.SPA.bin activate commit
install_add_activate_commit: START Sat Jan 20 04:36:32 UTC 2024
install_add_activate_commit: Adding PACKAGE
This operation requires a reload of the system. Do you want to proceed?
Please confirm you have changed boot config to flash:packages.conf [y/n]y
— Starting initial file syncing —
[1]: Copying flash:cat9k_iosxe.17.09.04a.SPA.bin from switch 1 to switch 2
Finished initial file syncing
— Starting Add —
— cut off some text----
Finished Add
install_add_activate_commit: Activating PACKAGE
Following packages shall be activated:
/flash/cat9k-wlc.17.09.04a.SPA.pkg
—cut off some text–
This operation requires a reload of the system. Do you want to proceed? [y/n]y
— Starting Activate —
Performing Activate on all members
[1] Activate package(s) on switch 1
Any help is much appreciated.
Thanks
Bikram