diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 6e918d70e2..8dcb60ab32 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -459,7 +459,7 @@ class VariableManager: templar.set_available_variables(vars_copy) delegated_host_name = templar.template(task.delegate_to, fail_on_undefined=False) - if not delegated_host_name: + if delegated_host_name is None: raise AnsibleError(message="Undefined delegate_to host for task:", obj=task._ds) if delegated_host_name in delegated_host_vars: # no need to repeat ourselves, as the delegate_to value