ansible synchronize on same host between src and dest

Babbi

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}}'
Vinamit_

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to use gulp changed or newer with the same folder being src and dest?

In ansible, how to synchronize 2 folders on the same remote machine?

Sharing the same host var in ansible inventory

Ansible - Multiple/ Alternative hostnames for the same host

Multicast between applications on the same host

Ansible passing variables between host contexts

asort(src,dest) to a multidimensional array

iphdr struct src and dest unexpected

Ansible Synchronize With Wildcard

Ansible Copy vs Synchronize

Ansible synchronize mode permissions

sshfs with ansible does not give the same result as running it manually on the host

Ansible access same group vars different children host groups

In Ansible is there a way to use with_items and host variables at the same time?

Copying field/value from src to dest object

rsync'ing multiple {src,dest} pairs

src dataId value to dest newDataId its not copying

Ansible playbook, adhoc var not able to use between two host

Synchronize On Same String Value

Ansible Conditionally Synchronize if Directory Exists

Permission denied in Ansible synchronize module

ansible synchronize with excludes file role

Slow Resilio Sync between two Docker containers on same host

Is there a way to communicate between 2 Elasticsearch containers on the same host?

Switch back and forth between chroot jail and Host in the same terminal

Make gulp.dest output to same directory

Synchronize changed entities in the same transaction

javascript synchronize inputs with same name

Why does Html img tag only allow a maximum of 6 src to the same host?