- 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
- name: Install and activate new IOS image
ansible.netcommon.cli_command:
command: 'install add file {{ fsystem }}:{{ image_9300.image_name }} activate commit'
check_all: true
prompt:
- 'Please confirm you have changed boot config to flash:packages.conf \[y/n\]'
- 'Do you want to proceed\? \[y/n\]'
answer:
- 'y'
- 'y'
vars:
ansible_command_timeout: 14400
-Bikram
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/60d09529-517d-4e00-abb7-2b5e27031754n%40googlegroups.com.