summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <bcoca@ansible.com>2016-02-11 01:45:13 -0500
committerBrian Coca <bcoca@ansible.com>2016-02-11 01:45:13 -0500
commitf48fef67bf8ea7a6e1e335f09d900a632a640f18 (patch)
tree2386d4de9aea1be508e1af2df5e489503f894680
parent051f4e5d3e8d23b7ba1dbd3f576f5e848f45f284 (diff)
parent009164227e944c4db3267b0f8d92d1cba257c816 (diff)
downloadansible-f48fef67bf8ea7a6e1e335f09d900a632a640f18.tar.gz
Merge pull request #14253 from dagwieers/allow-key-auth-when-ask-pass
Allow key authentication when using `--ask-pass` (just like Ansible v2)
-rw-r--r--lib/ansible/runner/connection_plugins/ssh.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py
index 036175f6a9..6c9622da92 100644
--- a/lib/ansible/runner/connection_plugins/ssh.py
+++ b/lib/ansible/runner/connection_plugins/ssh.py
@@ -91,10 +91,7 @@ class Connection(object):
self.common_args += ["-o", "IdentityFile=\"%s\"" % os.path.expanduser(self.private_key_file)]
elif self.runner.private_key_file is not None:
self.common_args += ["-o", "IdentityFile=\"%s\"" % os.path.expanduser(self.runner.private_key_file)]
- if self.password:
- self.common_args += ["-o", "GSSAPIAuthentication=no",
- "-o", "PubkeyAuthentication=no"]
- else:
+ if not self.password:
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
"-o", "PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey",
"-o", "PasswordAuthentication=no"]