Commit dabe4927 by Michael DeHaan

Merge pull request #1883 from tgerla/devel

--private-key tilde handling
parents 7df3d811 495c4e6c
...@@ -46,6 +46,7 @@ Ansible Changes By Release ...@@ -46,6 +46,7 @@ Ansible Changes By Release
* SELinux fix for files created by authorized_key module * SELinux fix for files created by authorized_key module
* "template override" ?? * "template override" ??
* lots of documentation tweaks * lots of documentation tweaks
* handle tilde shell character for --private-key
* ... * ...
......
...@@ -197,7 +197,7 @@ Set up SSH agent to avoid retyping passwords: ...@@ -197,7 +197,7 @@ Set up SSH agent to avoid retyping passwords:
$ ssh-agent bash $ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa $ ssh-add ~/.ssh/id_rsa
(Depending on your setup, you may wish to ansible's --private-key-file option to specify a pem file instead) (Depending on your setup, you may wish to ansible's --private-key option to specify a pem file instead)
Now ping all your nodes: Now ping all your nodes:
......
...@@ -82,7 +82,7 @@ class Connection(object): ...@@ -82,7 +82,7 @@ class Connection(object):
allow_agent = False allow_agent = False
try: try:
ssh.connect(self.host, username=user, allow_agent=allow_agent, look_for_keys=True, ssh.connect(self.host, username=user, allow_agent=allow_agent, look_for_keys=True,
key_filename=self.runner.private_key_file, password=self.runner.remote_pass, key_filename=os.path.expanduser(self.runner.private_key_file), password=self.runner.remote_pass,
timeout=self.runner.timeout, port=self.port) timeout=self.runner.timeout, port=self.port)
except Exception, e: except Exception, e:
msg = str(e) msg = str(e)
......
...@@ -53,7 +53,7 @@ class Connection(object): ...@@ -53,7 +53,7 @@ class Connection(object):
if self.port is not None: if self.port is not None:
self.common_args += ["-o", "Port=%d" % (self.port)] self.common_args += ["-o", "Port=%d" % (self.port)]
if self.runner.private_key_file is not None: if self.runner.private_key_file is not None:
self.common_args += ["-o", "IdentityFile="+self.runner.private_key_file] self.common_args += ["-o", "IdentityFile="+os.path.expanduser(self.runner.private_key_file)]
if self.runner.remote_pass: if self.runner.remote_pass:
self.common_args += ["-o", "GSSAPIAuthentication=no", self.common_args += ["-o", "GSSAPIAuthentication=no",
"-o", "PubkeyAuthentication=no"] "-o", "PubkeyAuthentication=no"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment