Hi Mods
I have an issue with a project implementation , where I need to copy output files generated by a process - to one central Linux server ( I mention central , for clarity , where I want to put all my output files that maybe coming out of hundreds of VMs - all running the same process ) ; In my setup , ansible is running through tower , and we are not allowed to become root , due to security policies ; there is no SSH setup for ansible user between VMs - they are reachale only through tower .
#1. Can I use copy module here ? with remote_src set as true , but what should be the format of dest key value in Linux to use copy module ? with win_copy , we ca use \\myserver.com\c$\mydi\ etc. , but what should be the format in Linux ?
#2. With ansible tower (ruuning in a VM) is it possible to use fetch ? fetch and then copy ? Please note that I can not login to tower VM with putty due to security poloicies and check , but does it allow to use fetch with ansible tower and then use copy from ansible tower ?
#3. Synchronize: This is not working as expected ; I think synchronize uses rsync , but do I need to setup rsync first ? to make synchronize working ? setting up rsync also requires root access which we don't have so I try to avoid this approach
Can you suggest any solution to this problem ;
~ thanks !
Hello,
eventually you can fetch (ansible.builtin.fetch) the files from remote1 and copy (ansible.builtin.copy) them from locally to remote2.
Hope it helps
Andreas
Hi @Punyabrata
This play work for me:
- hosts: clientb.lab.example.com
gather_facts: false
tasks:
- synchronize:
src: /home/student/file
dest: /home/student/file
delegate_to: clienta.lab.example.com
Where 1) clienta - original clientb - remote copy 2) ssh with key authorization work between clients
Good luck.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.