set remote_user to default if none is found when using delegate_to (#16138)

pull/16206/head
Ritesh Khadgaray 9 years ago committed by Brian Coca
parent b479a80d45
commit ef9238ab85

@ -356,7 +356,7 @@ class PlayContext(Base):
# and likewise for the remote user
for user_var in MAGIC_VARIABLE_MAPPING.get('remote_user'):
if user_var in delegated_vars:
if user_var in delegated_vars and delegated_vars[user_var]:
break
else:
delegated_vars['ansible_user'] = task.remote_user or self.remote_user

Loading…
Cancel
Save