Don't disable GSSAPI/Pubkey authentication when using --ask-pass

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
This commit is contained in:
Abhijit Menon-Sen 2015-08-13 13:24:57 +05:30
parent 119d032389
commit 8b25595e7b

View file

@ -150,14 +150,7 @@ class Connection(ConnectionBase):
("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(key))) ("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(key)))
) )
if self._play_context.password: if not self._play_context.password:
self.add_args(
"ansible_password/ansible_ssh_pass set", (
"-o", "GSSAPIAuthentication=no",
"-o", "PubkeyAuthentication=no"
)
)
else:
self.add_args( self.add_args(
"ansible_password/ansible_ssh_pass not set", ( "ansible_password/ansible_ssh_pass not set", (
"-o", "KbdInteractiveAuthentication=no", "-o", "KbdInteractiveAuthentication=no",