Created
September 15, 2015 19:42
-
-
Save anonymous/0ae390c5e5f11e1adb1c to your computer and use it in GitHub Desktop.
salt reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Local Variables ## | |
{% set s3_grains_url = salt['pillar.get']('grains:url', False) %} | |
{% set s3_grains_sha1 = salt['pillar.get']('grains:sha1', False) %} | |
{% if s3_grains_url %} | |
# Sync the grains from S3 if the pillar value exists. | |
s3_grains_file: | |
file: | |
- managed | |
- name: '/etc/salt/grains' | |
- source: '{{ s3_grains_url }}' | |
- source_hash: '{{ s3_grains_sha1 }}' | |
- user: 'root' | |
- group: 'root' | |
- mode: 0400 | |
# Inspect the process tree to kill the current salt-call invocation and start a fresh highstate run. | |
restart_salt_run: | |
cmd.run: | |
- user: 'root' | |
- cwd: '/root' | |
- shell: '/bin/bash' | |
- name: | | |
pkill --signal SIGTERM "[s]alt-call" && \ | |
salt-call state.highstate > /tmp/grains_reload | |
- onchanges: | |
- file: '/etc/salt/grains' | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment