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]. 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/CAEkdrMijZOBBB6XNo9-OkkQrq8xmfOL2te3eqFPZJRhWbBY8dA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
