Sunday, September 1, 2019

saltstack getting started

curl -L -o

sudo sh -M #install master and minion on same node


master: localhost
id: myminion

sudo systemctl restart salt-minion
sudo systemctl restart salt-master
sudo salt-key
sudo salt-key -a myminion (then type Y)

sudo salt '*'

sudo salt-call sys.doc

sudo salt '*' cmd.run_all 'echo HELLO'

#list matcher
sudo salt -L 'myminion'

sudo salt '*' grains.item os

sudo salt '*' grains.items

sudo salt --grain 'os:CentOS'

#custom grains
cat /etc/salt/grains

#list all execution modules
sudo salt '*' sys.list_modules

sudo salt '*' pkg.install htop

sudo salt '*' state.sls apache


Colton Meyes - Learning Saltstack (Packt Publishing), really direct and hands-on book.

(PS I had a quick look at "Mastering Saltstack" by Packt, it's waaay too abstract and blablaistic.

No comments: