Regarding
... the playbook behave differently when running in Ansible Tower ...
I haven't made such experience since Ansible Tower is just a web front end to Ansible Engine and as far as I understand.
Copy files from a Remote Linux Server 1 going to a Remote Linux Server 2.
In such case the synchronize
_module might be the solution. For database replication setup I use a construct like
- name: Synchronize file from primary to secondary
synchronize:
src: "/tmp/file.tar.gz"
dest: "/tmp/file.tar.gz"
mode: push
delegate_to: "{{ PRIMARY_HOST }}"
when: "{{ SECONDARY_HOST }}"
tags: replication,rsync
which is "copying" a file from the primary node to the secondary node. There are also a lot of answers under How to copy files between two nodes using Ansible.