I am trying to copy the files from Server A to Server B with Ansible running in Server C.
I have tried using Ansible Synchronize Module:
Exchanged SSH id_rsa.pub keys between the servers. Was able to ssh between the servers without asking password.
When running playbook it was able to gather_facts but throwing error during task execution. If seen in verbose output it is trying yo connect to different ip’s rather than the ips mentioned in the host file.
Hosts file
`
[ServerA] 192.168.1.7 ansible_user=ubuntu
[ServerB] 192.168.1.2 ansible_user=ubuntu
`
main.yml
`