Last active
August 29, 2015 14:03
-
-
Save btorch/7d880c661fa8ac54bc8a to your computer and use it in GitHub Desktop.
This file contains 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
Helpful Referecens that I use all the time | |
- http://salt.readthedocs.org/en/v0.17.5/ref/modules/all/ (builtin execution modules) | |
- http://salt.readthedocs.org/en/v0.17.5/ref/states/all/ (builtin state modules) | |
Note: Change the version above on the URL accordingly | |
builtin execution modules: | |
Those I normally used when executing a salt cli command such as the examples below | |
builtin state modules: | |
Those are normally used when writing/creating a state file | |
======================================== | |
Useful salt CLI Flags | |
======================================== | |
-t TIMEOUT, --timeout= | |
-b BATCH, --batch=BATCH, --batch-size=BATCH | |
--out=OUTPUT, --output=OUTPUT | |
* Depending what I'm retrieving from several minions I sometimes use --out=txt so I can get one liners back that can be compared | |
=============================================== | |
- Using Grain target & grains execution module | |
=============================================== | |
$ salt -t 15 -G 'stype:data' --out=txt grains.item roles | |
======================================== | |
- Compound with grains (G) | |
=============================================== | |
$ salt -t 10 -C "G@roles:account and G@stype:synnex" | |
============================================== | |
- Move roles grain from minion to grains file | |
============================================== | |
sudo salt '*' --out=txt grains.append roles nada | |
sudo salt '*' cmd.run "sed -i -e '/roles/,+10d' /etc/salt/minion" | |
sudo salt '*' --out=txt grains.remove roles nada |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment