https://docs.saltstack.com/en/master/topics/tutorials/walkthrough.html | |
---|---|
Install | with python 2.7 sudo apt update -y sudo apt-get upgrade -y sudo apt install salt-master sudo apt install salt-minion pip install -U pip pip install junos-eznc 972 python --version 973 pip --version 974 salt --version sudo vi /etc/salt/master sudo vi /etc/salt/minion #sudo salt-master -l debug # for test or debugging purpuses sudo salt-master -d sudo salt-minion -d |
alias for pip and python | alias on linux |
sudo systemctl start salt-master | |
"/etc/salt/master" file on the Master | sudo vi /etc/salt/master un "#" those three lines: master file labuser@saltsackmaster:~$ more /etc/salt/master | grep "#" -v | grep -v "^[[:space:]]*$" file_roots: base: - /srv/salt |
"/etc/sal/minion" file on the Minion | minion file labuser@saltsackmaster:~$ more /etc/salt/minion | grep "#" -v | grep -v "^[[:space:]]*$" master: 172.30.95.91 id: minion1 |
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 ] |
salt '*' test.ping [ test module and function ping from master to minion ] 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 | |
General
Content
Integrations