Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use templated loop_var/index_var when looping include_* #58866

Merged
merged 2 commits into from
Jul 10, 2019

Conversation

mkrizek
Copy link
Contributor

@mkrizek mkrizek commented Jul 9, 2019

SUMMARY

We seem to correctly template loop_var in TaskExecutor:

loop_var = templar.template(self._task.loop_control.loop_var)

But then in IncludedFile we use the 'raw' value instead of re-using the templated one:

loop_var = original_task.loop_control.loop_var

Fixes #58820

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/executor/task_executor.py
lib/ansible/playbook/included_file.py

@mkrizek mkrizek requested review from sivel and bcoca July 9, 2019 11:54
@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jul 9, 2019
@mkrizek mkrizek merged commit 7346b69 into ansible:devel Jul 10, 2019
@mkrizek mkrizek deleted the issue-58820 branch July 10, 2019 11:49
@mkrizek mkrizek removed needs_triage Needs a first human triage before being processed. labels Jul 10, 2019
mkrizek added a commit to mkrizek/ansible that referenced this pull request Jul 11, 2019
abadger pushed a commit that referenced this pull request Jul 16, 2019
@ansible ansible locked and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templated loop_var not defined when looping include_tasks
3 participants