diff options
author | Evgeni Golov <evgeni@golov.de> | 2017-02-17 14:18:41 +0100 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2017-02-17 14:18:41 +0100 |
commit | d3d1aa2dca4988bb7a232458338d86a0c9fef06e (patch) | |
tree | 123d093792b2cf864f1992376645b1c76b7ff590 | |
parent | e77964f9dab6e891ddaffe3bd2f4fd99a6275657 (diff) | |
download | ansible-d3d1aa2dca4988bb7a232458338d86a0c9fef06e.tar.gz |
synchronize: quote private_key (#21570)
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\" \"vagrant@192.168.121.10:/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}
-rw-r--r-- | lib/ansible/modules/files/synchronize.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/modules/files/synchronize.py b/lib/ansible/modules/files/synchronize.py index f814f2e396..7a8d1e1258 100644 --- a/lib/ansible/modules/files/synchronize.py +++ b/lib/ansible/modules/files/synchronize.py @@ -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' |