If you need to copy files between two (2) nodes, using Ansible, then you can do the following:

This solution uses the synchronize module, specifically using the delegate_to:source-server keywords.

1
2
3
4
5
- hosts: serverB
  tasks:    
   - name: Copy Remote-To-Remote (from serverA to serverB)
     synchronize: src=/copy/from_serverA dest=/copy/to_serverB
     delegate_to: serverA