mirror of https://github.com/ansible/ansible.git
Prevent templating unused variables for {%include%} (#68749)
Fixes #68699
(cherry picked from commit ff1ba39c8a
)
pull/71986/head
parent
a63baa3290
commit
9d54f13ec1
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "Prevent templating unused variables for {% include %} (https://github.com/ansible/ansible/issues/68699)"
|
@ -0,0 +1 @@
|
||||
{{ var_set_in_template }}
|
@ -0,0 +1,2 @@
|
||||
{% set var_set_in_template=test_var %}
|
||||
{% include "unused_vars_include.j2" %}
|
@ -0,0 +1,8 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
vars:
|
||||
test_var: foo
|
||||
unused_var: "{{ undefined_var }}"
|
||||
tasks:
|
||||
- debug:
|
||||
msg: "{{ lookup('template', 'unused_vars_template.j2') }}"
|
Loading…
Reference in New Issue