Skip to content

Instantly share code, notes, and snippets.

@nlm
Last active July 3, 2017 13:05
Show Gist options
  • Save nlm/781f524afa2ede04682d2b774287faa4 to your computer and use it in GitHub Desktop.
Save nlm/781f524afa2ede04682d2b774287faa4 to your computer and use it in GitHub Desktop.
Saltstack pattern to trigger commands when a pillar changes without storing it on the host in clear-text
intermediate-state-file:
file.managed:
- name: /etc/.intermediate_state_file
- contents: {{ salt['hashutil.sha256_digest'](salt['pillar.get']('my_pillar')|string) }}
my-cmd-1:
cmd.wait:
- name: "echo a command you want to run only when a my_pillar changes, but without storing it raw on the host"
- watch:
- file: intermediate-state-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment