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:
Brian Coca 2015-10-23 23:15:45 -04:00
parent 25e3fe04a8
commit f78c82b9ee
3 changed files with 3 additions and 8 deletions

View file

@ -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))