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
host_varsgiven the correctansible_userfor each host? ( docs.ansible.com/ansible/latest/… ) - Nick Volynkin ♦rsync, starting a playbook with-vvv? - Konstantin Suvorov