Skip to content

Instantly share code, notes, and snippets.

@anlutro
Last active January 27, 2017 08:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anlutro/cd0c16d1d23d55ded19b to your computer and use it in GitHub Desktop.
Save anlutro/cd0c16d1d23d55ded19b to your computer and use it in GitHub Desktop.
Illustration of states vs modules and function arguments
# in a /srv/salt .sls file
my_state: <- State ID
file.managed: <- State function
- name: /tmp/foo
- contents: hello world
^ state function arguments
{% if salt['file.directory_exists']('/tmp/bar') %}
^ module function ^ module function arguments
# on the command line
salt minion-name test.ping
^ module functions
v
salt minion-name state.apply test=True
^ module function arguments
@anlutro
Copy link
Author

anlutro commented May 3, 2016

Technically "state functions" should be "state module functions" and "module functions" should be "execution module functions", but they're more commonly referred to just states and modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment