5

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.

6
  • Arrrgh, ignore my close vote, I misread the entire question. Sorry.
    – pauska
    Aug 4, 2013 at 21:38
  • @pauska no worries :)
    – viraptor
    Aug 4, 2013 at 22:06
  • I don't suppose you could mention the software you're using here...
    – Chris S
    Aug 5, 2013 at 1:36
  • 1
    It's SaltStack
    – dawud
    Aug 5, 2013 at 6:25
  • @ChrisS It's in the title and in the tag -> "salt". I capitalised it in the title now.
    – viraptor
    Aug 5, 2013 at 8:14

1 Answer 1

1

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .