Correct delegated_host_name check

In fb50698da3 a check for delegated_host_name being defined was added. Make this
check safer as it breaks some playbooks.
pull/17973/head
stephane 8 years ago committed by Toshio Kuratomi
parent b06fb2022c
commit a32e48555d

@ -459,7 +459,7 @@ class VariableManager:
templar.set_available_variables(vars_copy) templar.set_available_variables(vars_copy)
delegated_host_name = templar.template(task.delegate_to, fail_on_undefined=False) 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) raise AnsibleError(message="Undefined delegate_to host for task:", obj=task._ds)
if delegated_host_name in delegated_host_vars: if delegated_host_name in delegated_host_vars:
# no need to repeat ourselves, as the delegate_to value # no need to repeat ourselves, as the delegate_to value

Loading…
Cancel
Save