Network Modules - dealing with Interactive prompts

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?

which version of ansible are you running?

Using version - ansible 2.2.0.0

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

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’s password:” I have tried various combinations of this for a match (password, password:, “password:”, password":"