Book:
https://www.juniper.net/documentation/en_US/day-one-books/DO_Automating_SALT.pdf
https://docs.saltstack.com/en/master/topics/tutorials/walkthrough.html | |
---|---|
Install |
|
|
|
title | install package |
---|---|
collapse | true |
| ||||||
alias for pip and python | alias on linux and tag | |||||
sudo systemctl start salt-master | ||||||
"/etc/salt/master" file on the Master | sudo vi /etc/salt/master un "#" those three lines:
| |||||
"/etc/sal/minion" file on the Minion |
| |||||
start the Minion | salt-minion -l debug [ debug mode ] or salt-minion -d [ deamon mode ] | |||||
Start the Master accept the key on the Master | salt-master -l debug [ debug mode ] or salt-master -d [ deamon mode ] https://docs.saltstack.com/en/latest/ref/cli/salt-key.html#actions sudo salt-key -a minion1 sudo salt-key -A [ all keys ] | |||||
. CMD Module File Module . Grains Module | salt '*' test.ping [ test module and function ping from master to minion ] salt '*' test.version / salt '*' test.versions_report salt 'min*' cmd.run 'pwd' salt 'min*' file.touch '/tmp/salt_files/new.txt' salt 'min*' file.write '/tmp/salt_files/new.txt' 'write something here' salt '*' grains.items | |||||