Fix to honor become_user in synchronize module (Fixes #186)

This commit is contained in:
Scott Mcdermott 2021-05-11 21:37:17 -07:00
parent 1f15216d0d
commit 6b41ce1a9d

View file

@ -371,6 +371,9 @@ 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':
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