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 "[email protected]'s 
password:" I have tried various combinations of this for a match (password, 
password:, "password:", password":"

---

- hosts: arista
  gather_facts: no
  connection: local
  strategy: free
  tasks:
    - name: check VLAN
      eos_command:
        host: arista
        username: admin
        password: 12345
        authorize: yes
        commands:
          - command: copy scp://[email protected]/somefile flash:somefile
            prompt: [email protected]'s password":"
            response: 123456





thanks



On Tuesday, March 14, 2017 at 2:39:34 PM UTC, Peter Sprygada wrote:
>
> 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
>
>
> On Mon, Mar 13, 2017 at 4:33 PM, <[email protected] <javascript:>> wrote:
>
>>
>> Using version - ansible 2.2.0.0
>>
>> On Sunday, March 12, 2017 at 8:23:09 PM UTC, Peter Sprygada wrote:
>>>
>>> which version of ansible are you running?
>>>
>>> On Fri, Mar 10, 2017 at 9:29 AM, <[email protected]> wrote:
>>>
>>>> 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://[email protected]/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?
>>>>
>>>>
>>>> ---
>>>>
>>>> - hosts: arista
>>>>
>>>>   gather_facts: no
>>>>
>>>>   connection: local
>>>>
>>>>   strategy: free
>>>>
>>>>   tasks:
>>>>
>>>>     - name: download software
>>>>
>>>>       ignore_errors: yes
>>>>
>>>>       eos_command:
>>>>
>>>>          host: arista
>>>>
>>>>          username: admin
>>>>
>>>>          password: xyz
>>>>
>>>>          authorize: yes
>>>>
>>>>          commands:
>>>>
>>>>           - copy scp://[email protected]/sw/software_file 
>>>> flash:software_file
>>>>
>>>>       register: test
>>>>
>>>>     - name: password enter
>>>>
>>>>       ignore_errors: yes
>>>>
>>>>       eos_command:
>>>>
>>>>          host: admin
>>>>
>>>>          username: admin
>>>>
>>>>          password: xyz
>>>>
>>>>          ignore_errors: yes
>>>>
>>>>          authorize: yes
>>>>
>>>>          commands:
>>>>
>>>>           - the_password
>>>>
>>>>       when: “’password_prompt’ in test"
>>>>
>>>>
>>>>
>>>>
>>>> thanks.
>>>>
>>>> jb
>>>>
>>>> -- 
>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/ansible-project/fc55eed2-32d3-4b56-934a-055a64004a5f%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/ansible-project/fc55eed2-32d3-4b56-934a-055a64004a5f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/645bec83-b5b1-45be-9dc7-73c918ea7184%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/645bec83-b5b1-45be-9dc7-73c918ea7184%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aea6f340-27d2-4eab-8af5-597671323e0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to