mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
Fix to honor become_user in synchronize module (Fixes #186)
This commit is contained in:
parent
1f15216d0d
commit
6b41ce1a9d
1 changed files with 4 additions and 1 deletions
|
|
@ -371,7 +371,10 @@ class ActionModule(ActionBase):
|
|||
# If no rsync_path is set, become was originally set, and dest is
|
||||
# remote then add privilege escalation here.
|
||||
if self._play_context.become_method == 'sudo':
|
||||
rsync_path = 'sudo rsync'
|
||||
if self._play_context.become_user:
|
||||
rsync_path = 'sudo -u %s rsync' % self._play_context.become_user
|
||||
else:
|
||||
rsync_path = 'sudo rsync'
|
||||
# TODO: have to add in the rest of the become methods here
|
||||
|
||||
# We cannot use privilege escalation on the machine running the
|
||||
|
|
|
|||
Loading…
Reference in a new issue