I am trying to use synchronize instead of move in order to preserve acl's and permissions on the destination directories using group and perms options. I am trying to rsync (synchronize) between src and dest paths which exist on same remote server.
I am running into this error and am unsure what is happening.
fatal: [foonode.bar.com]: FAILED! => {"changed": false, "cmd": "sshpass -d12 /usr/bin/rsync --delay-updates -F --compress --archive '--rsh=/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' '--out-format=<>%i %n%L' /foo/sbar_test/xyz/xyz'foonode.bar.com:rsync:'"'"'/dest/testing/test_yzs/qwert'"'"''", "msg": "[Errno 32] Broken pipe", "rc": 32}
#this is the code snippet trying to rsync in the role
- name: "move '{{ root_path }}/{{ type }}/{{ name }}' root data from source to destination '{{destination_path}}'"
# Synchronization using rsync protocol (push)
synchronize:
src: '{{ root_path }}/{{ type }}/{{ name }}'
dest: rsync:'{{destination_path}}'
synchronize is a wrapper around rsync to make common tasks in your playbooks quick and easy. It is run and originates on the local host where Ansible is being run. Of course, you could just use the command action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. synchronize is not intended to provide access to the full power of rsync, but does make the most common invocations easier to implement. You still may need to call rsync directly via command or shell depending on your use case.
you can not use module synchronize on remote host. you may use module command to run rsync command on remote host.