Skip to content

Commit

Permalink
Correct delegated_host_name check
Browse files Browse the repository at this point in the history
In ansible@fb50698 a check for delegated_host_name being defined was added. Make this
check safer as it breaks some playbooks.
  • Loading branch information
cinerama70 authored and abadger committed Oct 11, 2016
1 parent b06fb20 commit a32e485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/vars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def _get_delegated_vars(self, loader, play, task, existing_variables):

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
Expand Down

0 comments on commit a32e485

Please sign in to comment.