Commit graph

9 commits

Author SHA1 Message Date
Martin Krizek
a2af8432f3
Local vars should have highest precedence in AnsibleJ2Vars ()
Ability to add local variables into AnsibleJ2Vars was added in
18a9eff11f to fix . Local variables
are added using ``AnsibleJ2Vars.add_locals()`` method when creating a
new context - typically when including/importing a template with
context. For that use case local template variables created using
``set`` should override variables from higher contexts - either from the
play or any parent template, or both; Jinja behaves the same way.

Also removes AnsibleJ2Vars.extras instance variable which is not used.

Also adds missing test for .

Fixes 
Fixes 

ci_complete
2021-01-26 11:37:56 +01:00
Martin Krizek
00b22ab55e
Provide more information in AnsibleUndefinedVariable ()
* Provide more information in AnsibleUndefinedVariable

Fixes 
2020-09-22 09:38:53 -04:00
Martin Krizek
ff1ba39c8a
Prevent templating unused variables for {%include%} ()
Fixes 
2020-04-14 10:27:02 +02:00
Matt Clay
0c74ee4352
Clean up various integration tests. ()
* Fix var_blending test temp dir usage.

* Fix filters integration test:

- Fix use of `output_dir`.
- Use `localhost` instead of `testhost` since we're only testing filters.
- Fix `fileglob` test to actually test a directory that exists.

* Fix lookups integration test:

- Fix use of `output_dir`.
- Use `localhost` instead of `testhost` since we're only testing lookups.

* Fix ansible-runner test temp dir usage.

* Fix template and template_jinja2_latest test.

Use the `OUTPUT_DIR` env var to get the output directory for the tests.

* Fix Python version compat in filters test.

* Skip filters test on Python 2.6.
2019-08-14 16:33:45 -07:00
Martin Krizek
b7868529ee
Revert "Speed up VariableManager by preserving Templar state. ()" ()
This reverts commit 6069d09b9d.

Fixes 
2019-07-22 10:27:11 +02:00
Brian Coca
b9b0b23015
safe_eval fix ()
* just dont pass locals

 - also fix globals
 - added tests

* fixed tests
2019-06-06 15:36:22 -04:00
Abhijeet Kasurde
142732dba9 dataloader: check exact value of dir ()
Include path in role with directory which has 'tasks' as end.
For example, roles/sometasks/templates is now considered while searching path.

Fixes: 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-03-16 01:48:01 -04:00
Toshio Kuratomi
81b2529159 Fix when template paths contain non-ascii chars and using the path in ansible_managed
Fixes 
2018-04-30 16:47:27 -07:00
Pilou
d608eb9530 Check that AnsibleUndefinedVariable doesn't occur when an unused variable references an undefined variable ()
* Check that AnsibleUndefinedVariable doesn't occur

* AnsibleUndefinedVariable exc.: don't modify type
2018-02-02 09:25:13 -08:00