Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes play context connection user #21776

Merged
merged 1 commit into from
Feb 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ansible/playbook/play_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def set_task_and_variable_override(self, task, variables, templar):
# additionally, we need to do this check after final connection has been
# correctly set above ...
if new_info.connection == 'local':
new_info.connection_user = self.remote_user
new_info.connection_user = new_info.remote_user
new_info.remote_user = pwd.getpwuid(os.getuid()).pw_name

# set no_log to default if it was not previouslly set
Expand Down Expand Up @@ -597,6 +597,10 @@ def update_vars(self, variables):
if 'become' in prop:
continue

# perserves the user var for local connections
if self.connection == 'local' and 'remote_user' in prop:
continue

var_val = getattr(self, prop)
for var_opt in var_list:
if var_opt not in variables and var_val is not None:
Expand Down