Way in Salt to use a different configuration file for a single command

saltstack

I'm working in an environment where changes in salt states and pillar must be reviewed through merge request.

At the moment, when we need to test our changes before submitting them, we log on the salt master, checkout the branch we're working on after altering our colleagues and perform our tests.

The problem with this approach is that it requires a single user to basically lock down the salt master for as long as he needs to perform test.

Hence my question : is there a way to specify a salt master configuration and/or a state/pillar root for a single salt command ?

Best Answer

If you use gitfs all branches are environments in salt. So you could do something like

salt-call state.highstate saltenv=testingBranch pillarenv=testingBranch test=True

You mix and match those so if you are just testing pillar changes you can leave off the saltenv.

Related Topic