I was having similar problems in a similar env (ansible 1.6 / centos 6.5) 
and haven't gotten it completely working yet.
A few questions:

Do you have the ansible_ssh_private_key set in your hosts file (since the 
synchronize spec doesn't expose -i option)?
Your command is sudo for rsync (sudo: no but rsync path adds it back) but 
not for synchonize.   I think running ansible as sudo, I noticed ssh was 
looking for keys in /var/root/.ssh instead of your home directory.
Your rsync command is specifying the user admin@ but i don't see that in 
the syncrhonize command unless your playbook is running as remote_user: 
admin or something.
Have you tried running with -c ssh?

kesten

On Monday, April 21, 2014 4:42:12 PM UTC-5, Brian Grossman wrote:
>
> I have a synchronize task and an rsync command task that I think should be 
> equivalent.  The rsync works, but the synchronize doesn't.  Can anyone help 
> me make synchronize work?
>
> This is with ansible 1.5.3 on centos 6.4.  Using paramiko for transport. 
>  TTY-less sudo works.
>
> I don't want to use the copy module because I want to skip over .svn 
> directories, and it doesn't have anything like the .rsync-filter file.
>
> (Loving ansible, BTW.)
>
>
> rsync task:
>
> - name: my copy in bin dir
>   sudo: no
>   local_action: >
> command
> rsync
> --delay-updates -FF --compress --timeout=10 --delete-after
> --archive --no-owner --no-group
> --rsh 'ssh -i /home/mumble/.ansible/keys/mumble-id_rsa -o 
> stricthostkeychecking=no'   
> --rsync-path 'sudo rsync'
> --out-format='<<CHANGED>>%i %n%L'
> {{ inventory_dir }}/working/mumble-bin/
> admin@{{ inventory_hostname }}:/mumble/bin
>
>
> synchronize task:
>
> - name: copy in bin dir
>   synchronize: >
> owner=no group=no delete=yes
> src={{ inventory_dir }}/working/digimarc-bin/
> dest=/digimarc/bin
>
>
>
>
>
> Here's the ansible-playbook -vvv output from them.  I notice that the 
> rsync local_action task splits the cmd into an array, while the synchronize 
> task doesn't.  Aside from that, I'm utterly mystified.  If I copy the 
> synchronize cmd to my terminal it works just fine.
>
>
> rsync:
>
> TASK: [mumble-bin | my copy in bin dir] 
> ************************************* 
> <127.0.0.1> REMOTE_MODULE command rsync --delay-updates -FF --compress 
> --timeout=10 --delete-after --archive --no-owner --no-group --rsh 'ssh -i 
> /home/mumble/.ansible/keys/mumble-id_rsa -o stricthostkeychecking=no' 
> --rsync-path 'sudo rsync' --out-format='<<CHANGED>>%i %n%L' 
> /home/mumble/.ansible/PB-dpc/working/mumble-bin/ 
> ad...@ops001.mumble.com:/mumble/bin
> <127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p 
> $HOME/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003 && chmod a+rx 
> $HOME/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003 && echo 
> $HOME/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003']
> <127.0.0.1> PUT /tmp/tmpFEn0En TO 
> /home/mumble/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003/command
> <127.0.0.1> EXEC ['/bin/sh', '-c', '/usr/bin/python 
> /home/mumble/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003/command; 
> rm -rf /home/mumble/.ansible/tmp/ansible-tmp-1398114848.9-199337421744003/ 
> >/dev/null 2>&1']
> changed: [ops001.mumble.com] => {"changed": true, "cmd": ["rsync", 
> "--delay-updates", "-FF", "--compress", "--timeout=10", "--delete-after", 
> "--archive", "--no-owner", "--no-group", "--rsh", "ssh -i 
> /home/mumble/.ansible/keys/mumble-id_rsa -o stricthostkeychecking=no", 
> "--rsync-path", "sudo rsync", "--out-format=<<CHANGED>>%i %n%L", 
> "/home/mumble/.ansible/PB-dpc/working/mumble-bin/", 
> "ad...@ops001.mumble.com:/mumble/bin"], "delta": "0:00:00.348326", "end": 
> "2014-04-21 14:14:09.299270", "item": "", "rc": 0, "start": "2014-04-21 
> 14:14:08.950944", "stderr": "", "stdout": ""}
>
>
>
> synchronize:
>
> TASK: [mumble-bin | copy in bin dir] 
> **************************************** 
> <127.0.0.1> ESTABLISH CONNECTION FOR USER: admin on PORT 22 TO 127.0.0.1
> <127.0.0.1> EXEC /bin/sh -c 'mkdir -p 
> $HOME/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503 && chmod a+rx 
> $HOME/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503 && echo 
> $HOME/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503'
> <127.0.0.1> PUT /tmp/tmp3awrHX TO 
> /home/admin/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503/synchronize
> <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python 
> /home/admin/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503/synchronize;
>  
> rm -rf /home/admin/.ansible/tmp/ansible-tmp-1398114849.46-137775062175503/ 
> >/dev/null 2>&1'
> failed: [ops001.mumble.com] => {"cmd": "rsync --delay-updates -FF 
> --compress --timeout=10 --delete-after --archive --no-owner --no-group 
> --rsh 'ssh -i /home/mumble/.ansible/keys/mumble-id_rsa -o 
> StrictHostKeyChecking=no' --rsync-path 'sudo rsync' 
> --out-format='<<CHANGED>>%i %n%L' 
> /home/mumble/.ansible/PB-dpc/working/mumble-bin/ 
> ad...@ops001.mumble.com:/mumble/bin", "failed": true, "item": "", "rc": 255}
> msg: Permission denied, please try again.
> Permission denied, please try again.
> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
> rsync: connection unexpectedly closed (0 bytes received so far) [sender]
> rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.6]
>
>
>
>
> Brian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ee3afbd9-86b1-4689-884f-5f2921115ed4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to