command scp in ansible

Hi all,

I must use scp in ansible, i know module synchronize, copy but i d’ont find the module scp.
There is junos_scp but i d’ont know how he works :confused:

Is there a way to transfer files or directories by scp as the command linux scp -rp

Thanks community ansible !! :wink:

Regards,

Hi all,

I must use scp in ansible, i know module synchronize, copy but i d'ont find
the module scp.
There is junos_scp but i d'ont know how he works :confused:

Is there a way to transfer files or directories by scp as the command linux
scp -rp

Not via a module. You'll need to use command for that.

- Sebastian

Hi Sebastian,

Ok.

Thanks for your answer

Regards,

The copy module uses the transfer mechanism from the 'connection
plugin', which, if using ssh CAN be scp, but it also tries sftp and dd
by default, but you can control this via configuration (see scp_if_ssh
setting).

Hi,

The copy module itself does not copy across machines, only on the same
machine, as I said, the connection itself does the copy from
controller to target (temp location) then executes the 'copy module'
against that temp location (unless remote_src=true in which case copy
module does all the work).