The cmd.run state only executes the script if there is a change in the scripts, units, or pillar which defines which units to place.
The creates field can be used to specify that a script creates a file, and the command should be run if the file doesn't exist. However I'm not sure how this interacts with the onchanges field. The creates field might stop the state from running even if a dependency in onchanges changes.
The
cmd.run
state only executes the script if there is a change in the scripts, units, or pillar which defines which units to place.The
creates
field can be used to specify that a script creates a file, and the command should be run if the file doesn't exist. However I'm not sure how this interacts with theonchanges
field. Thecreates
field might stop the state from running even if a dependency inonchanges
changes.