4

I'm storing my salt sls files in a git repository, but I have the perennial problem that I can't verify my YAML represents a valid set of states that could be applied (I've also had difficulty validating my YAML -- that's much easier, though). Ideally, I'd like some way to verify my states on my workstation before committing them. Failing that, some way to check in a pre-receive hook so I can at least stop dodgy code from hitting the server.

1 Answers1

5

You might want to try the test option with the salt command: http://docs.saltstack.com/en/latest/ref/states/testing.html

salt '*' state.highstate test=True

This also works with the salt-call command. It will parse all configuration files, will run all checks and will then list all commands that it would have been executed.

ahus1
  • 567
  • 5
  • 12