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
pull/11908/head
Abhijit Menon-Sen 9 years ago
parent 119d032389
commit 8b25595e7b

@ -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",

Loading…
Cancel
Save