You can use cli_command module to handle multiple prompts on network device.
Refer:
https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_command_module.html

On Thu, 11 Mar 2021 at 8:37 PM, madd...@gmail.com <maddo...@gmail.com>
wrote:

> I ended up running the following manually. I just need a way for ansible
> to wait for certain prompts and allow the process to complete without
> ansible failing the job. Again, any suggestions would be appreciated.....
>
> Here is the manual command ran:
>
> 9200L-24T-4G-E_2#$*install add file
> flash:cat9k_lite_iosxe.16.12.04.SPA.bin activate commit*
> install_add_activate_commit: START Thu Mar 11 08:43:55 EST 2021
>
> System configuration has been modified.
> Press Yes(y) to save the configuration and proceed.
> Press No(n) for proceeding without saving the configuration.
> Press Quit(q) to exit, you may save configuration and re-enter the
> command. *[y/n/q]y*
> Modified configuration has been saved
> Mar 11 08:44:10.982 %INSTALL-5-INSTALL_START_INFO: R0/0: install_engine:
> Started install one-shot flash:cat9k_lite_iosxe.16.12.04.SPA.bin
> install_add_activate_commit: Adding PACKAGE
> install_add_activate_commit: Checking whether new add is allowed ....
>
> --- Starting initial file syncing ---
> [1]: Copying flash:cat9k_lite_iosxe.16.12.04.SPA.bin from switch 1 to
> switch 2
> [2]: Finished copying to switch 2
> Info: Finished copying flash:cat9k_lite_iosxe.16.12.04.SPA.bin to the
> selected switch(es)
> Finished initial file syncing
>
> --- Starting Add ---
> Performing Add on all members
>   [1] Add package(s) on switch 1
>   [1] Finished Add on switch 1
>   [2] Add package(s) on switch 2
>   [2] Finished Add on switch 2
> Checking status of Add on [1 2]
> Add: Passed on [1 2]
> Finished Add
>
> Image added. Version: 16.12.4.0.4480
> install_add_activate_commit: Activating PACKAGE
>
> gzip: initramfs.cpio.gz: decompression OK, trailing garbage ignored
> Following packages shall be activated:
> /flash/cat9k_lite-webui.16.12.04.SPA.pkg
> /flash/cat9k_lite-srdriver.16.12.04.SPA.pkg
> /flash/cat9k_lite-rpboot.16.12.04.SPA.pkg
> /flash/cat9k_lite-rpbase.16.12.04.SPA.pkg
>
> This operation may require a reload of the system. *Do you want to
> proceed? [y/n]y*
> --- Starting Activate ---
> Performing Activate on all members
> Mar 11 08:53:53.512: %INSTALL-5-INSTALL_AUTO_ABORT_TIMER_PROGRESS: R0/0:
> rollback_timer: Install auto abort timer will expire in 7200 seconds
>   [1] Activate package(s) on switch 1
>     --- Starting list of software package changes ---
>     Old files list:
>       Removed cat9k_lite-rpbase.16.12.03a.SPA.pkg
>       Removed cat9k_lite-rpboot.16.12.03a.SPA.pkg
>       Removed cat9k_lite-srdriver.16.12.03a.SPA.pkg
>       Removed cat9k_lite-webui.16.12.03a.SPA.pkg
>     New files list:
>       Added cat9k_lite-rpbase.16.12.04.SPA.pkg
>       Added cat9k_lite-rpboot.16.12.04.SPA.pkg
>       Added cat9k_lite-srdriver.16.12.04.SPA.pkg
>       Added cat9k_lite-webui.16.12.04.SPA.pkg
>     Finished list of software package changes
>   [1] Finished Activate on switch 1
>   [2] Activate package(s) on switch 2
>     --- Starting list of software package changes ---
>     Old files list:
>       Removed cat9k_lite-rpbase.16.12.03a.SPA.pkg
>       Removed cat9k_lite-rpboot.16.12.03a.SPA.pkg
>       Removed cat9k_lite-srdriver.16.12.03a.SPA.pkg
>       Removed cat9k_lite-webui.16.12.03a.SPA.pkg
>     New files list:
>       Added cat9k_lite-rpbase.16.12.04.SPA.pkg
>       Added cat9k_lite-rpboot.16.12.04.SPA.pkg
>       Added cat9k_lite-srdriver.16.12.04.SPA.pkg
>       Added cat9k_lite-webui.16.12.04.SPA.pkg
>     Finished list of software package changes
>   [2] Finished Activate on switch 2
> Checking status of Activate on [1 2]
> Activate: Passed on [1 2]
> Finished Activate
>
> --- Starting Commit ---
> Performing Commit on all members
>   [1] Commit package(s) on switch 1
>   [1] Finished Commit on switch 1
>   [2] Commit package(s) on switch 2
>   [2] Finished Commit on switch 2
> Checking status of Commit on [1 2]
> Commit: Passed on [1 2]
> Finished Commit
>
> Install will reload the system now!
> SUCCESS: install_add_activate_commit  Thu Mar 11 08:55:16 EST 2021
> Mar 11 08:55:17.946 %INSTALL-5-INSTALL_COMPLETED_INFO: R0/0:
> install_engine: Completed install one-shot PACKAGE
> flash:cat9k_lite_iosxe.16.12.04.SPA.bin
> 9200L-24T-4G-E_2#
>
> On Thursday, March 11, 2021 at 12:17:13 AM UTC-5 madd...@gmail.com wrote:
>
>> I'm trying to update a cisco switch stack with ansible and I would like
>> to use the archive command, but that doesn't work with .bin files.
>>
>> For the 9200 series switches, I can only download .bin files.
>>
>> I have tried:
>> ios_command:
>>           commands:
>>             - command: install add file
>> flash:cat9k_lite_iosxe.16.12.04.SPA.bin
>>               wait_for: result[0] contains SUCCESS
>>
>> That isn't working for me either. I may need to enter a timeout as well.
>>
>> Please let me know if you have any suggestions. Thanks in advance.
>>
>> --
> 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f5aa4119-9617-4077-b11b-8b9adb848ce1n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f5aa4119-9617-4077-b11b-8b9adb848ce1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Regards,
Ganesh B. Nalawade
Principal Engineer
Ansible by Red Hat
irc: ganeshrn

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B6y2sEA27UdCyzv-CTn-VMzubnWRwuJ6p60BExvT%2BbCkRWo5Q%40mail.gmail.com.

Reply via email to