On Mon, 9 Feb 2015, James Cammarata wrote: > Actually, looking through the code I believe you're correct. Setting the > option for -i again *might* work (assuming the rsync command will override > the setting with the second value, instead of throwing an error), however I > think using the rsync command directly is what you want anyway, as you said > the rsync is for a remote -> remote copy. The synchronize module will only > push or pull the file from or to the remote host and the Ansible controller > normally - there is no option to do a completely remote rsync. I'm kind of > surprised that using the delegate_to option makes it kind of work this way > at all.
Actually, I've just tripped over this. I was attempting to use synchronize to transfer files from the controller to a destination host. The synchronize task was invoked with a remote_user: root, but run as a normal user on the controller. What happens, it seems, is that ansible first attempts to make an ssh connection to root@localhost, to ship over the ansible module that'll perform the sync; then that runs - and fails, because the root user doesn't have the credentials available to make the conneciton to the destination machine. I could understand this being reasonable behaviour to support delegate_to, but is there a way to make synchronize simply invoke rsync directly in the common case (where the soruce is the ansible controller)? (At the moment I have to use rsync via local_action, which feels pretty ugly.) Cheers, jan -- [email protected] http://ioctl.org/jan/ Short, dark, ugly: pick any three ioctl(2): probably the coolest Unix system call in the world
