From c06b10eedde937b8915f535c83d464227cf5fbe9 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 19 Feb 2017 17:11:48 -0500 Subject: [PATCH] fix play_context connection_user attribute (#21640) The connection user needs to be set from the original play_context and not the copy. This fixes that problem --- lib/ansible/playbook/play_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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