# Answer to prompt not passing when used cli\_command module

**URL:** <https://forum.ansible.com/t/answer-to-prompt-not-passing-when-used-cli-command-module/33143>\
**Category:** Ansible Project\
**Created:** [June 10, 2020, 12:19pm UTC](https://forum.ansible.com/t/answer-to-prompt-not-passing-when-used-cli-command-module/33143 "2020-06-10T12:19:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmohanraj](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@bmohanraj](https://forum.ansible.com/u/bmohanraj)\
**Post date:** [June 10, 2020, 12:19pm UTC](https://forum.ansible.com/t/answer-to-prompt-not-passing-when-used-cli-command-module/33143/1 "2020-06-10T12:19:06Z")

</div>

Hello,

I am trying to upgrade cat9k switch using ansible, facing issues when trying to run the command “install Activate”.

**when run “install Activate” command manually in cat9k switch, I am getting the prompt within in 30 seconds like below.**

`  
cat9k-1#install Activate  
install\_activate: START Wed Jun 10 05:05:50 PDT 2020  
install\_activate: Activating PACKAGE

\*Jun 10 20:01:52.230: %INSTALL-5-INSTALL\_START\_INFO: Switch 1 R0/0: install\_engine: Started install activateFollowing packages shall be activated:  
/flash/cat9k-wlc.16.06.05.SPA.pkg  
/flash/cat9k-webui.16.06.05.SPA.pkg  
/flash/cat9k-srdriver.16.06.05.SPA.pkg  
/flash/cat9k-sipspa.16.06.05.SPA.pkg  
/flash/cat9k-sipbase.16.06.05.SPA.pkg  
/flash/cat9k-rpboot.16.06.05.SPA.pkg  
/flash/cat9k-rpbase.16.06.05.SPA.pkg  
/flash/cat9k-guestshell.16.06.05.SPA.pkg  
/flash/cat9k-espbase.16.06.05.SPA.pkg  
/flash/cat9k-cc\_srdriver.16.06.05.SPA.pkg

This operation requires a reload of the system. Do you want to proceed? [y/n]

`

**Below is the playbook snippet:**

`

- name: Run install activate  
cli\_command:  
command: install Activate  
prompt:
- Press Quit(q) to exit, you may save configuration and re-enter the command. [y/n/q]
- This operation requires a reload of the system. Do you want to proceed? [y/n]  
answer:
- n  
vars:  
ansible\_command\_timeout: 300  
`

**verbose output: ansible-playbook -vvv -i hosts site.yaml snippet.**

`  
The full traceback is:  
WARNING: The below traceback may _not_ be related to the actual failure.  
File “/tmp/ansible\_cli\_command\_payload\_6575kN/ansible\_cli\_command\_payload.zip/ansible/modules/network/cli/cli\_command.py”, line 167, in main  
File “/tmp/ansible\_cli\_command\_payload\_6575kN/ansible\_cli\_command\_payload.zip/ansible/module\_utils/connection.py”, line 185, in **rpc**  
raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)  
fatal: [66.220.26.111]: FAILED! =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“answer”: [  
“n”  
],  
“check\_all”: false,  
“command”: “install Activate”,  
“newline”: true,  
“prompt”: [  
“Press Quit(q) to exit, you may save configuration and re-enter the command. [y/n/q]”,  
“This operation requires a reload of the system. Do you want to proceed? [y/n]”  
],  
“sendonly”: false  
}  
},  
“msg”: “command timeout triggered, timeout value is 300 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide.”  
}

`

How to fix this issue?

Thanks,  
Mohan

---

<div class="post-metadata">

**Author:** ![bmohanraj](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@bmohanraj](https://forum.ansible.com/u/bmohanraj)\
**Post date:** [June 10, 2020, 1:01pm UTC](https://forum.ansible.com/t/answer-to-prompt-not-passing-when-used-cli-command-module/33143/2 "2020-06-10T13:01:25Z")

</div>

I changed the prompt in the ansible-playbook like below, it worked fine.

prompt:

- “save”
- “reload”
