Fixes #4536 Get the remote_user from multiple sources in a preferred order
This commit is contained in:
parent
c876ce4b8a
commit
4f13967386
1 changed files with 7 additions and 1 deletions
|
@ -135,6 +135,12 @@ class Task(object):
|
|||
# can be hashes and lists, not just scalars
|
||||
self.args = ds.get('args', {})
|
||||
|
||||
# get remote_user for task, then play, then playbook
|
||||
if ds.get('remote_user') is not None:
|
||||
self.remote_user = ds.get('remote_user')
|
||||
elif ds.get('remote_user', play.remote_user) is not None:
|
||||
self.remote_user = ds.get('remote_user', play.remote_user)
|
||||
else:
|
||||
self.remote_user = ds.get('remote_user', play.playbook.remote_user)
|
||||
|
||||
if self.sudo:
|
||||
|
|
Loading…
Reference in a new issue