The cmd state module manages the enforcement of executed commands, this state can tell a command to run under certain circumstances.
The cmd state only has a single function, the run function
Execute a command given certain conditions
A simple example:
date > /tmp/salt-run:
cmd:
- run
Only run if another execution returns successfully, in this case truncate syslog if there is no disk space:
> /var/log/messages:
cmd.run:
- unless: echo 'foo' > /tmp/.test
Members
Run a command if certain circumstances are met
Run a command if certain circumstances are met
Run the given command only if the watch statement calls it