Skip to content

Commit

Permalink
synchronize: quote private_key (ansible#21570)
Browse files Browse the repository at this point in the history
otherwise rsync will fail when trying to access a key with spaces:

fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /home/user/Some Folder/.vagrant/machines/default/libvirt/private_key -S none -o StrictHostKeyChecking=no -o Port=22' --out-format='<<CHANGED>>%i %n%L' \"/etc/issue\" \"[email protected]:/tmp/issue2\"", "failed": true, "msg": "Warning: Identity file /home/user/Some not accessible: No such file or directory.\nssh: Could not resolve hostname folder/.vagrant/machines/default/libvirt/private_key: No address associated with hostname\r\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]\n", "rc": 255}
  • Loading branch information
evgeni authored and resmo committed Feb 17, 2017
1 parent e77964f commit d3d1aa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/modules/files/synchronize.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def main():
if private_key is None:
private_key = ''
else:
private_key = '-i '+ private_key
private_key = '-i "%s"' % private_key

ssh_opts = '-S none'

Expand Down

0 comments on commit d3d1aa2

Please sign in to comment.