Handling password prompt -- IOS_command module

Hi Team,

How to handle password prompt when doing scp file transfer. Actually 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 }}”

Any help would be appreciated.