# Handling Prompt in Cisco IOS\_CONFIG module

**URL:** <https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255>\
**Category:** Ansible Project\
**Created:** [May 30, 2021, 8:45pm UTC](https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255 "2021-05-30T20:45:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![R.B\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@R.B\_Kumar](https://forum.ansible.com/u/R.B_Kumar)\
**Post date:** [May 30, 2021, 8:45pm UTC](https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255/1 "2021-05-30T20:45:09Z")

</div>

Hello All - Using Ansible v2.7  
I am tying to execute Cisco IOS commands that prompts to type Y/N. Looks like the **Prompt:** is not available in **ios\_config** module. For example

- name: delete\_crypto\_map  
ios\_config:  
lines:
- no crypto pki trustpoint CTA
- yes  
The above script doesnt work as the logs shows connection error: **timeout value 10 seconds reached while trying to send command**  
Looks like the after executing the command **no crypto pki trustpoint CTA** the **Y/N** is prompted by the ansible is not sending Y to the prompt

The **prompt:** works for **ios\_commands:** module but doesnt work on **ios\_config:**

Do you have any experience on this kind of requirement or thoughts please?

---

<div class="post-metadata">

**Author:** ![R.B\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@R.B\_Kumar](https://forum.ansible.com/u/R.B_Kumar)\
**Post date:** [May 31, 2021, 10:10am UTC](https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255/2 "2021-05-31T10:10:07Z")

</div>

Can anybody have requirement similar to this? I tried with cli\_command, ios\_command too…

---

<div class="post-metadata">

**Author:** ![R.B\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@R.B\_Kumar](https://forum.ansible.com/u/R.B_Kumar)\
**Post date:** [May 31, 2021, 11:25am UTC](https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255/3 "2021-05-31T11:25:21Z")

</div>

I got the answer from another forum. It is just a workaround only using cli\_command module

I read ansible 2.7 dont support prompt in ios\_config.  
We need to user ios\_command with loop as below

- name: delete\_crypto\_map  
cli\_command:  
command: “{{ item }}”  
prompt:
- “Are you sure you want to do this”  
answer: ‘yes’  
loop:
- config t
- no crypto pki trustpoint CTA

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [May 31, 2021, 2:58pm UTC](https://forum.ansible.com/t/handling-prompt-in-cisco-ios-config-module/35255/4 "2021-05-31T14:58:19Z")

</div>

Yes, ios\_config does not support prompting, Can you disable prompting and re-enable once a task is done?
