cancel
Showing results for 
Search instead for 
Did you mean: 
Punyabrata
Flight Engineer
Flight Engineer
  • 270 Views

How to copy files between managed nodes running RHEL ( remote servers ) in an AT setup

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 !

 

Labels (1)
0 Kudos
2 Replies
andkra
Flight Engineer Flight Engineer
Flight Engineer
  • 238 Views

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

 

0 Kudos
shura
Flight Engineer
Flight Engineer
  • 223 Views

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.

0 Kudos
Join the discussion
You must log in to join this conversation.