Control the state system on the minion
Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution.
Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states
CLI Example:
salt '*' state.clear_cache
Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system
CLI Example:
salt '*' state.high '{"vim": {"pkg": ["installed"]}}'
Retrieve the state data from the salt master for this minion and execute it
Notify states to execute in test-only (dry-run) mode.
Sets the test variable in the minion opts for the duration of the state run.
Instead of failing immediately when another state run is in progress, queue the new state run to begin running once the other has finished.
This option starts a new thread for each queued state run so use this option sparingly.
CLI Example:
salt '*' state.highstate
salt '*' state.highstate whitelist=sls1_to_run,sls2_to_run
salt '*' state.highstate exclude=sls_to_exclude
salt '*' state.highstate exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
salt '*' state.highstate pillar="{foo: 'Foo!', bar: 'Bar!'}"
Execute a single low data call This function is mostly intended for testing the state system
CLI Example:
salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh.
CLI Example:
salt '*' state.pkg /tmp/state_pkg.tgz
Return a dict of state return data if a state function is already running. This function is used to prevent multiple state calls from being run at the same time.
CLI Example:
salt '*' state.running
Retrieve the highstate data from the salt master and display it
Custom Pillar data can be passed with the pillar kwarg.
CLI Example:
salt '*' state.show_highstate
Display the low data from a specific sls. The default environment is base, use saltenv (env in Salt 0.17.x and older) to specify a different environment.
CLI Example:
salt '*' state.show_low_sls foo
List out the low data that will be applied to this minion
CLI Example:
salt '*' state.show_lowstate
Display the state data from a specific sls or list of sls files on the master. The default environment is base, use saltenv (env in Salt 0.17.x and older) to specify a different environment.
This function does not support topfiles. For top.sls please use show_top instead.
Custom Pillar data can be passed with the pillar kwarg.
CLI Example:
salt '*' state.show_sls core,edit.vim dev
Return the top data that the minion will use for a highstate
CLI Example:
salt '*' state.show_top
Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command
By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-value maps, as you would in a YAML salt file. Alternatively, JSON format of keyword values is also supported.
CLI Example:
salt '*' state.single pkg.installed name=vim
Execute a set list of state files from an environment.
Notify states to execute in test-only (dry-run) mode.
Sets the test variable in the minion opts for the duration of the state run.
Instead of failing immediately when another state run is in progress, queue the new state run to begin running once the other has finished.
This option starts a new thread for each queued state run so use this option sparingly.
Specify a file_roots environment.
Changed in version 0.17.0: Argument name changed from env to saltenv.
CLI Example:
salt '*' state.sls core,edit.vim dev
salt '*' state.sls core exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
salt '*' state.sls myslsfile pillar="{foo: 'Foo!', bar: 'Bar!'}"
Call a single ID from the named module(s) and handle all requisites
New in version 2014.7.0.
CLI Example:
salt '*' state.sls_id apache http
Execute the information stored in a template file on the minion.
This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion.
CLI Example:
salt '*' state.template '<Path to template on the minion>'
Execute the information stored in a string from an sls template
CLI Example:
salt '*' state.template_str '<Template String>'
Execute a specific top file instead of the default
CLI Example:
salt '*' state.top reverse_top.sls
salt '*' state.top reverse_top.sls exclude=sls_to_exclude
salt '*' state.top reverse_top.sls exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
Docs for previous releases are available on salt.rtfd.org.
Latest Salt release: 2014.1.13
Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.
22.16.199. salt.modules.status
Upcoming SaltStack events, webinars and local meet ups and user groups.