

Step2: Push ( Copy) the file from the ansible master to the remote server ( destination) Step1: Fetch the file from the remote server (source) to the ansible master It is a two-step process when it comes to this method. It works well where our primary focus is to get the job done whatsoever the approach may be. Though, it is not the shortest path (or) beeline. This is the best and easiest option to transfer files between the remote nodes When you do not have SSH Key based Authentication enabled between the remote nodes. NO SSH Authentication required between remote nodes for this method Method1: Copy from app01 to app02 using fetch module Before we proceed, This is the infrastructure diagram of our setup.ĭo not get confused by the name Master.

The requirement is to copy a file from mwiapp01 to mwiapp02.

To get started, let us define some requirement ourselves so that, we could relate and be on the same page.

If you want to copy a file from an Ansible Control Master to remote hosts, the COPY (scp) module would be just fine. When we want to copy files from one host to another host, in general, the first thing comes in our mind is SCP and ansible have a dedicated module for the same-named COPY In this post, we are going to discuss the two major options available to copy the files between remote servers or remote to remote. I wanted to execute rsync between remote hosts and copy files between remote hosts. I simply wanted to do make ansible rsync. Every article I went and read was giving me suggestions but nothing practical. How to copy files between remote servers in Ansible ?.
