diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index 0e4bcc59fcc..f1fa6855033 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -443,7 +443,7 @@ class PlayContext(Base): # additionally, we need to do this check after final connection has been # correctly set above ... if new_info.connection == 'local': - new_info.connection_user = new_info.remote_user + new_info.connection_user = self.remote_user new_info.remote_user = pwd.getpwuid(os.getuid()).pw_name # set no_log to default if it was not previouslly set