mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Disable authentication methods that weren't specified
This commit is contained in:
@@ -53,6 +53,12 @@ class Connection(object):
|
||||
self.common_args += ["-o", "Port=%d" % (self.port)]
|
||||
if self.runner.private_key_file is not None:
|
||||
self.common_args += ["-o", "IdentityFile="+self.runner.private_key_file]
|
||||
if self.runner.remote_pass:
|
||||
self.common_args += ["-o", "GSSAPIAuthentication=no",
|
||||
"-o", "PubkeyAuthentication=no"]
|
||||
else:
|
||||
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
|
||||
"-o", "PasswordAuthentication=no"]
|
||||
self.common_args += ["-o", "User="+self.runner.remote_user]
|
||||
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user