Skip to content

Instantly share code, notes, and snippets.

@Supermathie
Last active August 29, 2015 14:07
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 Supermathie/ac5899acd60c74a7240c to your computer and use it in GitHub Desktop.
Save Supermathie/ac5899acd60c74a7240c to your computer and use it in GitHub Desktop.
help with states
± |master ✗| → sudo salt 'win7-client1*' state.highstate
win7-client1.storagelab.netdirect.ca:
Data failed to compile:
----------
Name windowsdomain:ad2012r2.storagelab.netdirect.ca in sls windows is not a dictionary
*change to dictionary*
michael@orchestrator:/srv/salt
± |master ✗| → sudo salt 'win7-client1*' state.highstate
win7-client1.storagelab.netdirect.ca:
Data failed to compile:
----------
The state "windowsdomain:ad2012r2.storagelab.netdirect.ca" in sls windows is not formed as a list
----------
The state "windowsdomain:ad2012r2.storagelab.netdirect.ca" in sls windows is not formed as a list
windows:
file.managed:
- name: c:/salt/conf/minion.d/minion.conf
- template: jinja
- makedirs: true
{% if grains ['windowsdomain'] == 'zzz' %}
- source: salt://win/files/minion-zzz.conf
{% elif grains ['windowsdomain'] == 'ad2012r2.storagelab.netdirect.ca' %}
- source: salt://win/files/minion-ad2012r2-storagelab.conf
{% elif grains ['windowsdomain'] == 'ad2008r2.storagelab.netdirect.ca' %}
- source: salt://win/files/minion-ad2008r2-storagelab.conf
{% endif %}
grains.present:
- name: testenviron
{% if grains ['windowsdomain'] == 'zzz' %}
- value: zzz
{% elif grains ['windowsdomain'] == 'ad2012r2.storagelab.netdirect.ca' %}
- value: ad2012r2
{% elif grains ['windowsdomain'] == 'ad2008r2.storagelab.netdirect.ca' %}
- value: ad2008r2
{% endif %}
base:
'os:Windows':
- match: grain
- windows
'os:Linux':
- match: grain
- linux
minionconf:
'windowsdomain:ad2012r2.storagelab.netdirect.ca':
- match: grain
- c:/salt/conf/minion.d/minion.conf:
file.managed:
- source: salt://win/files/minion-ad2012r2.conf
- template: jinja
- makedirs: true
- testenviron:
grains.present:
- value: ad2012r2
'windowsdomain:ad2008r2.storagelab.netdirect.ca':
- match: grain
- c:/salt/conf/minion.d/minion.conf:
file.managed:
- source: salt://win/files/minion-ad2008r2.conf
- template: jinja
- makedirs: true
- testenviron:
grains.present:
- value: ad2012r2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment