Skip to content

Instantly share code, notes, and snippets.

Created April 10, 2015 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8d9618d50eb422bbdbe6 to your computer and use it in GitHub Desktop.
Save anonymous/8d9618d50eb422bbdbe6 to your computer and use it in GitHub Desktop.
set sanity check
root@virl:/srv/salt# salt-call grains.get rclocal
local:
/etc/rc.local
root@virl:/srv/salt# salt-call --local file.file_exists 'salt['grains.get']('rclocal')'
local:
False
root@virl:/srv/salt# salt-call --local file.file_exists '/etc/rc.local'
local:
True
To use in a state like
{% if salt['file.file_exists']('{{ rclocal }}') %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment