>From the docs: Template variables are defined by the context dictionary passed to the template. <http://jinja.pocoo.org/docs/2.10/templates/#variables>
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? -- You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To unsubscribe from this group and stop receiving emails from it, send an email to pocoo-libs+unsubscr...@googlegroups.com. To post to this group, send email to pocoo-libs@googlegroups.com. Visit this group at https://groups.google.com/group/pocoo-libs. For more options, visit https://groups.google.com/d/optout.