From ef9238ab850617e40e0518e7b014d8883e137093 Mon Sep 17 00:00:00 2001 From: Ritesh Khadgaray Date: Tue, 7 Jun 2016 19:06:17 +0530 Subject: [PATCH] set remote_user to default if none is found when using delegate_to (#16138) --- lib/ansible/playbook/play_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index a79b4e1988d..ad68579a1bf 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -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