6

Is there a way to preview what files will be served to a minion on a state.highstate? I know that you can run state.show_highstate, but that is not the output I am looking for. For example, inside /path/to/recurse/dir/ I have foo.txt and bar.txt and in my sls file I have

/path/to/recurse/dir/:
  file.recurse:
    - source: salt://dir/

I would like to run state.preview_highstate and it would show me the contents of foo.txt and bar.txt. Does anyone know how to go about this without just running state.highstate?

Adam Michalik
  • 9,678
  • 13
  • 71
  • 102
feus4177
  • 1,193
  • 1
  • 11
  • 15
  • 1
    Since the states are executed on the minions I don't think there is a way to see the files before they are processed by the minion. – pajaja Dec 12 '14 at 23:30
  • Oh, I didn't realize that. Even so, is it possible to determine the source of files? I know I've run into situations where it has been serving an "incorrect" file and I couldn't figure out where it was coming from. This was mostly when I switched to Github for the backend. – feus4177 Dec 14 '14 at 01:17

1 Answers1

6

If you are able to run the state on the minion but just don't want to apply any changes you can append the test=True to your command:

salt '*' state.highstate test=True

This will run the highstate on the minion but will not make any changes to the system. Changes that would be applied are shown in yellow.

pajaja
  • 2,164
  • 4
  • 25
  • 33
  • That's right, I had forgotten about that. Also, I tested and it works when run from the master as well. – feus4177 Dec 15 '14 at 19:06