How to handle password prompt when doing scp file transfer.

15 views
Skip to first unread message

Pushparaj Gothandam

unread,
May 25, 2020, 12:25:56 PM5/25/20
to Ansible Development

Hi Team,

How to handle password prompt when doing scp file transfer.  Actually target scp server is generating banner message along with password prompt. Please help how to resolve the issue.

- name:  transfer the image
  ios_command:
    commands:
      - command: 'copy scp://{{ ansible_user }}@{{ ip_address }}/{{ new_system_image }} flash:'
        prompt: 
            - 'Destination filename \[{{ new_system_image }}\]'
            - 'Password'
        answer: 
            - "\r"
            - "{{ password }}"

Jeffrey Zhang

unread,
May 25, 2020, 12:32:48 PM5/25/20
to Pushparaj Gothandam, Ansible Development
try `sshpass` ?
---
Regards,
Jeffrey Zhang


--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/ad056766-dfca-489b-b7c2-7ab407f8c0c0%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages