# Network Modules - dealing with Interactive prompts

**URL:** <https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930>\
**Category:** Ansible Project\
**Created:** [March 10, 2017, 2:29pm UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930 "2017-03-10T14:29:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb795333](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jb795333](https://forum.ansible.com/u/jb795333)\
**Post date:** [March 10, 2017, 2:29pm UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930/1 "2017-03-10T14:29:26Z")

</div>

Hello,

What is the best approach to dealing with interactive commands. I am attempting to use ansible to download a software file to a switch using a “copy scp://admin@1.1.1.1/sw/software\_file flash:software\_file”.

I have attempted to store the response to a variable and send another task with the password if the password prompt is listed in the variable, but ansible hangs on the password prompt.

Is this a correct approach? is there a better method to working with interactive commands?

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [March 12, 2017, 8:22pm UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930/2 "2017-03-12T20:22:53Z")

</div>

which version of ansible are you running?

---

<div class="post-metadata">

**Author:** ![jb795333](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jb795333](https://forum.ansible.com/u/jb795333)\
**Post date:** [March 13, 2017, 8:33pm UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930/3 "2017-03-13T20:33:46Z")

</div>

Using version - ansible 2.2.0.0

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [March 14, 2017, 2:39pm UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930/4 "2017-03-14T14:39:28Z")

</div>

In Ansible 2.2 you can encode the prompt / response in the task as such:

eos\_command:  
commands:

- command: command to run  
prompt: Do you want to continue?  
response: yes

---

<div class="post-metadata">

**Author:** ![jb795333](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jb795333](https://forum.ansible.com/u/jb795333)\
**Post date:** [March 15, 2017, 9:17am UTC](https://forum.ansible.com/t/network-modules-dealing-with-interactive-prompts/23930/5 "2017-03-15T09:17:02Z")

</div>

Hi,

I have tried this the playbook runs but the task always times out - assuming it isn’t sending the “response”.

Can I confirm that the syntax is correct that I am using for the prompt and response?

The prompt when run directly on the switch is “[jsm@172.16.136.252](mailto:jsm@172.16.136.252)’s password:” I have tried various combinations of this for a match (password, password:, “password:”, password":"
