mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
don't set user to current user
also remove condition to bypass setting user if user matches current user this enables forcing user when set to the same user as current user and ignoring .ssh/config while keeping .ssh/config with current user if nothing is specified.
This commit is contained in:
parent
25e3fe04a8
commit
f78c82b9ee
3 changed files with 3 additions and 8 deletions
|
@ -23,7 +23,6 @@ import fcntl
|
|||
import os
|
||||
import pipes
|
||||
import pty
|
||||
import pwd
|
||||
import select
|
||||
import shlex
|
||||
import subprocess
|
||||
|
@ -188,7 +187,7 @@ class Connection(ConnectionBase):
|
|||
)
|
||||
|
||||
user = self._play_context.remote_user
|
||||
if user and user != pwd.getpwuid(os.geteuid())[0]:
|
||||
if user:
|
||||
self._add_args(
|
||||
"ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set",
|
||||
("-o", "User={0}".format(self._play_context.remote_user))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue