Last active
January 11, 2017 12:09
-
-
Save hemebond/710ebb11ab1659b5061eeb57ca196278 to your computer and use it in GitHub Desktop.
Sync grains every start and highstate once automatically.
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
reactors: | |
# Run this script every time an abc instance starts | |
- 'salt/minion/abc*/start': | |
- '/srv/salt/reactors/abc/start.sls' | |
# Run this script every time an abc instance returns from a job | |
- 'salt/job/*/ret/abc*': | |
- '/srv/salt/reactors/abc/ret.sls' |
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
{%- if data['fun'] == 'saltutil.sync_grains' %} | |
run_highstate: | |
cmd.state.apply: | |
- tgt: {{ data['id'] }} | |
- arg: | |
- reactors.first_run_highstate | |
# Only needed for the custom environment | |
- kwarg: | |
saltenv: abc | |
{%- endif %} |
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
first: | |
local.saltutil.sync_grains: | |
- tgt: {{ data['id'] }} | |
# Only need this kwarg because of the custom environment | |
- kwarg: | |
saltenv: abc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment