From 0be3307bac89dd42690701d591df255cf9012ed3 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 5 Nov 2018 12:28:34 -0600 Subject: [PATCH] [stable-2.7] Fix return statement where we short circuit _get_delegated_vars (#48102) (cherry picked from commit cb5626c) Co-authored-by: Matt Martz --- changelogs/fragments/loop-cache-include-apply.yml | 2 ++ lib/ansible/vars/manager.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/loop-cache-include-apply.yml diff --git a/changelogs/fragments/loop-cache-include-apply.yml b/changelogs/fragments/loop-cache-include-apply.yml new file mode 100644 index 00000000000..15a0ea3cf55 --- /dev/null +++ b/changelogs/fragments/loop-cache-include-apply.yml @@ -0,0 +1,2 @@ +bugfixes: +- delegate_to - Fix issue where delegate_to was upplied via ``apply`` on an include, where a loop was present on the include diff --git a/lib/ansible/vars/manager.py b/lib/ansible/vars/manager.py index 2516014f0cd..8a8efc13ef5 100644 --- a/lib/ansible/vars/manager.py +++ b/lib/ansible/vars/manager.py @@ -489,7 +489,7 @@ class VariableManager: def _get_delegated_vars(self, play, task, existing_variables): if not hasattr(task, 'loop'): # This "task" is not a Task, so we need to skip it - return {} + return {}, None # we unfortunately need to template the delegate_to field here, # as we're fetching vars before post_validate has been called on