0

Hi I have an Ansible Tower.

I want my playbook to run in Ansible Tower and do: Copy files from a Remote Linux Server 1 going to a Remote Linux Server 2.

I tried modules: Copy and Fetch but seems like the playbook behave differently when running in Ansible Tower.

RoyceA
  • 1
  • 1
    Does this answer your question? [How to copy files between two nodes using ansible](https://stackoverflow.com/questions/25505146/how-to-copy-files-between-two-nodes-using-ansible) – U880D Oct 07 '21 at 16:23

1 Answers1

1

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.

U880D
  • 8,601
  • 6
  • 24
  • 40