# 127.0.0.1 and localhost in synchronize module (redux)

**URL:** <https://forum.ansible.com/t/127-0-0-1-and-localhost-in-synchronize-module-redux/21387>\
**Category:** Ansible Developer\
**Created:** [May 10, 2016, 5:17am UTC](https://forum.ansible.com/t/127-0-0-1-and-localhost-in-synchronize-module-redux/21387 "2016-05-10T05:17:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [May 10, 2016, 5:17am UTC](https://forum.ansible.com/t/127-0-0-1-and-localhost-in-synchronize-module-redux/21387/1 "2016-05-10T05:17:35Z")

</div>

Run into a similar problem documented at \<[https://github.com/ansible/ansible/issues/5240](https://github.com/ansible/ansible/issues/5240)\> and

\<[https://groups.google.com/d/msg/ansible-project/gT2eie6SVuU/MwUd44Eh15sJ](https://groups.google.com/d/msg/ansible-project/gT2eie6SVuU/MwUd44Eh15sJ)\>

I’m not sure if this is a personal problem or a regression so I posting here first.

I’m trying to synchronize a local directory, /var/lib/projects/convert\_station\_software, to several user’s local home directories.

I am using vagrant for testing.

$ ansible --version

ansible 2.2.0 (devel 7b58240654) last updated 2016/05/05 12:25:39 (GMT -500)

lib/ansible/modules/core: (devel 9be870bb2a) last updated 2016/05/05 12:49:00 (GMT -500)

lib/ansible/modules/extras: (devel 77eee2b6ca) last updated 2016/05/05 12:48:27 (GMT -500)

config file =

configured module search path = Default w/o overrides

$ vagrant --version

Vagrant 1.8.1

Control host is OS X 10.11.4

Managed host is OpenSUSE 42.1

- name: synchronize convert station software to convert users

synchronize: \>

src=“{{ convert\_station\_software\_local\_repo }}/”

dest=“{{ item.home }}”

archive=“no”

recursive=“yes”

rsync\_opts=“–exclude=.git --exclude=.gitignore”

with\_items:

- “{{ support\_users }}”

delegate\_to: “{{ inventory\_hostname }}”

\<127.0.0.1\> ESTABLISH SSH CONNECTION FOR USER: vagrant

\<127.0.0.1\> SSH: EXEC ssh -C -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=2222 -o ‘IdentityFile=“/Users/tanner/.vagrant.d/insecure\_private\_key”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 -o ControlPath=/Users/tanner/.ansible/cp/ansible-ssh-%h-%p-%r -tt 127.0.0.1 ‘/bin/sh -c ‘"’“‘LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1462856232.36-239016284975772/synchronize; rm -rf “/home/vagrant/.ansible/tmp/ansible-tmp-1462856232.36-239016284975772/” \> /dev/null 2\>&1’”’"‘’

failed: [testing\_openSUSE → None] \<snip stuff I’d like to keep private\> “msg”: “Warning: Identity file /Users/tanner/.vagrant.d/insecure\_private\_key not accessible: No such file or directory.\nssh: connect to host 127.0.0.1 port 2222: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: error in rsync protocol data stream (code 12) at io.c(235) [Receiver=3.1.0]\n”, “rc”: 12}

Google shows me something similar to this has shown up before (vagrant vs synchronize module).

The question is why ssh at all? Why not some like “rsync -av /var/lib/projects/convert\_station\_software /home/user1”?

Am I missing something simple?

---

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [May 10, 2016, 5:32am UTC](https://forum.ansible.com/t/127-0-0-1-and-localhost-in-synchronize-module-redux/21387/2 "2016-05-10T05:32:31Z")

</div>

[GitHub Code](https://github.com/ansible/ansible-modules-core/blob/devel/files/synchronize.py) seems to indicate I have the correct play.

# Synchronize two directories on one remote host.

synchronize:  
src: /first/absolute/path  
dest: /second/absolute/path  
delegate\_to: “{{ inventory\_hostname }}”
