Skip to content

Instantly share code, notes, and snippets.

@bentwire
Created April 25, 2014 16:39
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 bentwire/91a38ff9d7614503b0f7 to your computer and use it in GitHub Desktop.
Save bentwire/91a38ff9d7614503b0f7 to your computer and use it in GitHub Desktop.
hosts_update:
cmd.state.sls:
- tgt: '*'
{%- set environment_id = "" %}
{%- for key, val in salt['mine.get'](data['id'], 'grains.items').items() %}
{%- if key = data['id'] %}
{%- do environment_id = val.environment_id %}
{%- endif %}
{%- endfor %}
- env: {{ environment_id }}
- arg:
- hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment