Skip to content

Instantly share code, notes, and snippets.

/hosts-pillar Secret

Created April 24, 2015 17:09
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 anonymous/787cc742d03d6876b570 to your computer and use it in GitHub Desktop.
Save anonymous/787cc742d03d6876b570 to your computer and use it in GitHub Desktop.
hosts:
myserver:
- name: myserver
- type: webserver
- priority: primary
- company: mycompany
{% set hostname = pillar['node'] %}
{% set node = pillar['hosts'][hostname] %}
{% set type = salt['pillar.get']('hosts:' + hostname + ':type',) %}
{% set priority = salt['pillar.get']('hosts:' + hostname + ':priority',) %}
{% set company = salt['pillar.get']('hosts:' + hostname + ':company',) %}
{% set minionid = [ hostname,type,priority,company ]|join('-') %}
kickstart_prep:
salt.state:
- tgt: bootstrapper
- sls: kickstart
- pillar:
minionid: {{ minionid }}
node: {{ node }}
minion_wait:
salt.wait_for_event:
- name: salt/auth
- id_list:
- {{ minionid }}
- timeout: 1800
accept_minion_key:
salt.wheel:
- name: key.accept
- match: {{ minionid }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment