mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'ssh_config_user_overrides' of git://github.com/bcoca/ansible into devel
This commit is contained in:
commit
f37da4fdd7
1 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@ import pipes
|
||||||
import random
|
import random
|
||||||
import select
|
import select
|
||||||
import fcntl
|
import fcntl
|
||||||
|
import pwd
|
||||||
import ansible.constants as C
|
import ansible.constants as C
|
||||||
from ansible.callbacks import vvv
|
from ansible.callbacks import vvv
|
||||||
from ansible import errors
|
from ansible import errors
|
||||||
|
@ -62,7 +63,8 @@ class Connection(object):
|
||||||
else:
|
else:
|
||||||
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
|
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
|
||||||
"-o", "PasswordAuthentication=no"]
|
"-o", "PasswordAuthentication=no"]
|
||||||
self.common_args += ["-o", "User="+self.user]
|
if self.user != pwd.getpwuid(os.geteuid())[0]:
|
||||||
|
self.common_args += ["-o", "User="+self.user]
|
||||||
self.common_args += ["-o", "ConnectTimeout=%d" % self.runner.timeout]
|
self.common_args += ["-o", "ConnectTimeout=%d" % self.runner.timeout]
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in a new issue