From 8b25595e7b1cc3658803d0821fbf498c18ee608a Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Thu, 13 Aug 2015 13:24:57 +0530 Subject: [PATCH] Don't disable GSSAPI/Pubkey authentication when using --ask-pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is based on a bug report and PR by kolbyjack (#6846) which was subsequently closed and rebased as #11690. The original problem was: «The password on the delegated host is different from the one I provided on the command line, so it had to use the pubkey, and the main host doesn't have a pubkey on it yet, so it had to use the password.» (This commit is revised and included here because #11690 would conflict with the changes in #11908 otherwise.) Closes #11690 --- lib/ansible/plugins/connections/ssh.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/ansible/plugins/connections/ssh.py b/lib/ansible/plugins/connections/ssh.py index 4edbf849d72..81440c819a1 100644 --- a/lib/ansible/plugins/connections/ssh.py +++ b/lib/ansible/plugins/connections/ssh.py @@ -150,14 +150,7 @@ class Connection(ConnectionBase): ("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(key))) ) - if self._play_context.password: - self.add_args( - "ansible_password/ansible_ssh_pass set", ( - "-o", "GSSAPIAuthentication=no", - "-o", "PubkeyAuthentication=no" - ) - ) - else: + if not self._play_context.password: self.add_args( "ansible_password/ansible_ssh_pass not set", ( "-o", "KbdInteractiveAuthentication=no",