On 07.03.2018 12:40, 'Daley Okuwa' via Ansible Project wrote:

I have just done this manually on the switch and it worked

User Access Verification
Username: admin
POD2_C3560#copy running-config ftp:
Address or name of remote host []?
Destination filename [pod2_c3560-confg]?
Writing pod2_c3560-confg !!
8063 bytes copied in 1.108 secs (7277 bytes/sec)

I think you forgot the exit at the end, so I included it.

  - name: run show command via Telnet using the expect module
      command: telnet
        Username: admin
        Password: xxxxx
          - copy running-config ftp
          - exit
        Address or name of remote host \[\]\?:
        Destination filename \[.*\]\?: ''

The '' is the same as just pressing enter.
I have escaped []? with backslash since they are character with meaning in regex. Since the prompt POD2_C3560# comes up two times this is a list with the responses.

Kai Stian Olstad

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to