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:
parent
119d032389
commit
8b25595e7b
1 changed files with 1 additions and 8 deletions
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue