Created
May 5, 2016 01:49
-
-
Save trebortech/0f80bc7fcf0e5bb7060cf590df92ac68 to your computer and use it in GitHub Desktop.
Grains and Pillars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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