From the docs:
Saltstack uses Jijna and passes a dictionary called 'grains'.
A Jijna program changes that dictionary.
{% set mygrain_point_in_time1 = grains['mygrain'] %}
{# Change the mygrain key in the grain dictionary #}
{% set mygrain_point_in_time2 = grains['mygrain'] %}
Problem: the second variable has the old, unchanged value.
When does Jijna actually read the context dictionary in the two assigment:
- Once at rendering time?
- Twice, at assigment execution?
If Jinja reads the context dictionary at assigment execution time:
Can the dictionary be passed a reference?
To sum up the questions:
When Jinja reads a context dictionary, can it read values changed in time?