Skip to content

Instantly share code, notes, and snippets.

@trebortech
Created May 5, 2016 01:49
Show Gist options
  • Save trebortech/0f80bc7fcf0e5bb7060cf590df92ac68 to your computer and use it in GitHub Desktop.
Save trebortech/0f80bc7fcf0e5bb7060cf590df92ac68 to your computer and use it in GitHub Desktop.
Grains and Pillars
susemanager:
activation_key: 1-Dev-SLES-11-SP3-x86_64-key
roles:
- linux-dev
- mybox-acme
AFAIK:
key: value
key:
- list item
- list item
If you want to provide a list to a grain from the command line
salt 'demobox' grains.setval roles [site1,webserver]
demobox:
----------
roles:
- site1
- webserver
To add value to grain that already exists as list
salt 'demobox' grains.append roles site2
demobox:
----------
roles:
- site1
- webserver
- site2
Single value to grain
salt 'demobox' grains.setval environment dev
demobox:
----------
environment:
dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment