With one exception, ansible is all communication between the controller
(where you run the ansible-playbook command) and the managed machines.  So
using copy you'd need to first fetch the remote files to the controller and
then copy them out to the other machines.

The one exception is the synchronize module.  Using delegate_to you can
copy between two remote machines provided that you can live with certain
limitations (ssh key authentication where at least one of the remote
machines can ssh to the other one [I use ssh agent forwarding if I have to
do this].  Very primitive privilege escalation which lacks many of the
features you're used to (password less sudo works).  A summary of
synchronize might read, operates in a different way than other modules
which is sometimes exactly what you need but also an endless supply of bugs
and missing features.

If synchronize doesn't satisfy your use case, using ansible to set up rsync
between your servers and using ansible or Cron to start the rsync job might
be a way to go.

-Toshio

On Nov 21, 2017 11:43 PM, "Amir Saar" <[email protected]> wrote:

> I'm kinda newbie with Ansible. I have a hosts file that contains 4 hosts.
>
> I also have a 'copymap' dictionary that I built in order to copy data
> (folders) between the servers (the full 'copymap' dictionary is much bigger
> than the example below).
>
> copymap:
>       - {service: "zeppelin", src: '3.3.3.3', dest: '2.2.2.2'}
>       - {service: "local_data", src: '4.4.4.4', dest: '1.1.1.1'}
>
> I would like to copy the data between the servers, when the source is
> copymap.src and the destination is copymap.dest.
>
> I know how to iterate using 'with_items', but I'm not sure I understand
> how I can specify source and destination *servers*. Did anyone used the
> built-in 'copy' module to copy from *dynamic* remote to remote servers?
>
> --
> 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/4506c159-1216-4efc-ab07-ae1a24900208%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/4506c159-1216-4efc-ab07-ae1a24900208%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/CAPrnkaSOpDkV4FLjw7nXf0p9%2BsB7Eo0eMO4qsMr7wXiXnpT4Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to