Use correct delegate_to hostnames in loops (#59659)

Fixes #59650
This commit is contained in:
Martin Krizek 2019-07-30 09:46:29 +02:00 committed by GitHub
parent 127bd67f6e
commit fd899956b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Correctly handle delegate_to hostnames in loops (https://github.com/ansible/ansible/issues/59650)

View file

@ -546,7 +546,7 @@ class VariableManager:
if item is not None:
vars_copy[item_var] = item
templar.set_available_variables = vars_copy
templar.available_variables = vars_copy
delegated_host_name = templar.template(task.delegate_to, fail_on_undefined=False)
if delegated_host_name != task.delegate_to:
cache_items = True