copy from remote a to remote b

I need to copy the very big file X from remote system A to remote system B, only if X is newer on A or if X is missing on B.

I can do it in two steps: first transfer X from A to the Ansible server and next from the Ansible server to B.

But the effect will be that all files from A are mirrored on the Ansible server. I do not have enough space on the Ansible server. And I would like to avoid unnecessary transfers.

Is it possible to compare X on A and B without mirroring X on the Ansible server?

You might be able to do what you want using the synchronize module by taking advantage of ansible’s ability to delegate modules to run on specific hosts.

Lots of examples of ways to use synchronize on the module documentation page here: http://docs.ansible.com/ansible/synchronize_module.html

Hope this helps,

Jon