1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

now ssh connection plugin will only pass user as an option to ssh if it is

differnt from the current user. This should enable overrides for user in
.ssh/config w/o breaking any current functionality.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
This commit is contained in:
Brian Coca 2013-03-27 16:41:54 -04:00
parent 868af1a892
commit 82c3b4e685

View file

@ -23,6 +23,7 @@ import pipes
import random
import select
import fcntl
import pwd
import ansible.constants as C
from ansible.callbacks import vvv
from ansible import errors
@ -62,7 +63,8 @@ class Connection(object):
else:
self.common_args += ["-o", "KbdInteractiveAuthentication=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]
return self