Minion OS: Windows Server 2008 R2
Master OS: CenotOS 6
Salt version: 2014.1.10
I figured out that the jinja variables are not set in the defined state formula order. They will be set before all states in the states file will be executed on the minion.
If you have static variables with previously known values or basic system parameters like hostname or IP it is not tragic that all jinja variables will be set at the beginning. But if you have a dynamic value which is created by an installation routine after the state is executed salt is not able anymore to set or refresh this variable even if I move the {% set variable = ... part after the installation/configuration routine in the state formula.
The installation/configuration routine will create in the first step a random not predictable folder (e.g. "C:/installdir/tib/tct/admin/651651876321") and if I execute the following dir command ("dir /B /AB C:/installdir/tib/tct/admin") in windows, I can get this new generated foldername, but not if I set a jinja variable with the same command to get this new folder name for a more specific configuration part in for later stage.
{% set tctdir = salt['cmd.run']('dir /B /AD C:/installdir/tib/tct/admin') %}
In windows command prompt I receive the name of the new generated folder but not under salt, because this jinja set variable will executed BEFORE the installation/configuration routine is completed.
How can I force jinja to set this variable after a specific installation/configuration routine state is completed? Or do you have an alternative easy solution to get the random generated folder name as variable for later use in the same state file.