mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user