I'd like to download a grains file from external source during the state.highstate
is run. The file is not supposed to change usually - I'm only using this mainly for the initial provisioning.
So it seems like I just want a file.managed
state that will put the right contents into _grains
(I'm using a standalone client) and then call saltutil.sync_grains
. But how do I call a function? It's going to be a state with watch
configured, but I don't see a state that would help me do that.
saltutil.sync_grains - it is module call, not state. You need run this module with state "module" https://docs.saltproject.io/en/latest/ref/states/all/salt.states.module.html#module-salt.states.module But you can just start minion only after deployng right configuration (see salt-cloud). For dynamic parametrizing best practice is pillar: https://docs.saltproject.io/en/latest/topics/tutorials/pillar.html