Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/action/synchronize.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def run(self, tmp=None, task_vars=None):

else:
user = task_vars.get('ansible_user') or self._play_context.remote_user
user = self._templar.template(user)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the vars were always the wrong thing to get, the correct info should be from the connection itself using get_option

Copy link
Author

@jovial jovial May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good suggestion. Would we need to parse ssh_args to get the user? Or is that exposed as an option? Do we need to consider other connection plugins other than ssh?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @bcoca @jovial - this conversation is a bit stale :)

Copy link
Collaborator

@bcoca bcoca Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all connections at this point should be relying on get_option some older ones might still be using play_context.<data> but this is incorrect as it does not always reflect changes do to modifiers in the task (mostly loops). In no case should you be using variables directly.


# Private key handling
# Use the private_key parameter if passed else use context private_key_file
Expand Down