You need to copy the file from one server to another remotely. If on both servers the command is executed from the same users, then everything is copied correctly, but if the users are different, then it is impossible to copy. Initial data:

ServerA - user: ubuntu ServerB - user: user1 tasks: - name: Copy Remote-To-Remote (from serverA to serverB) synchronize: dest: /tmp/from_serverA src: /Project30-staging/to_serverB #set_remote_user: yes use_ssh_args: yes mode: pull delegate_to: serverB environment: GIT_SSH_COMMAND: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 

I tried different variations with the parameters of the form:

rsync_opts: "--rsh='/usr/bin/ssh -l ubuntu'" Too not out yet

  • And how does your ansible find out which server with which user to go to? - Nick Volynkin
  • In inventory or host_vars given the correct ansible_user for each host? ( docs.ansible.com/ansible/latest/… ) - Nick Volynkin
  • one
    Tried to see how Ansible starts rsync , starting a playbook with -vvv ? - Konstantin Suvorov

0