Skip to content

Instantly share code, notes, and snippets.

@rterbush
Created November 13, 2015 17:46
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 rterbush/e360eb2b7e085c2a218a to your computer and use it in GitHub Desktop.
Save rterbush/e360eb2b7e085c2a218a to your computer and use it in GitHub Desktop.
saltutil.sync_all:
salt.function:
- tgt: {{ grains['id'] }}
- reload_modules: True
saltutil.refresh_pillar:
salt.function:
- tgt: {{ grains['id'] }}
mine.update:
salt.function:
- tgt: {{ grains['id'] }}
pkg.refresh_db:
salt.function:
- tgt: {{ "{0} and G@os:Windows".format(grains['id']) }}
- expr_form: compound
highstate_run:
salt.state:
- tgt: {{ grains['id'] }}
- highstate: True
@rterbush
Copy link
Author

I am attempting to use reactor to fire off this 'salt/cloud/*/created' event.
Reactor calls the following state:

startup_orchestrate:
  runner.state.orchestrate:
    - mods: orch.startup

If I set tgt: '*' it runs these states on all minions and not just the minion that was created.

If run as I have it above, I get the following error on the master:

2015-11-13 18:18:10,635 [salt.state       ][ERROR   ][4732] No changes made for saltutil.sync_all

It is not clear to me if I should be using grains['id'] here or data['id'] or something else entirely.

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