Skip to content

SaltStack Setup

Setting up saltstack is relatively easy when bootstrap-salt.sh is used. There are other ways to setup as well but is relatively easier. salt-bootstrap README.md gives a lot of useful commands.

install salt using bootstrap curl

It downloads bootstrap-salt.sh. It can be executed setting up salt-master and salt-minion.

curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh

setup salt master

On the master node where bootstrap-salt.sh is downloaded.

sudo sh bootstrap-salt.sh -M -P stable

setup salt minion

On the master node where bootstrap-salt.sh is downloaded. Minion install just removes the -M flag

sudo sudo sh bootstrap-salt.sh -P stable

configure salt master IP in the minion

edit the file /etc/salt/minion

master: 192.168.200.102

restart the salt minion service

once the master IP address has been updated. Restart the salt-minion service.

sudo systemctl restart salt-minion

list salt key in salt-master

sudo salt-key --list all

accept the keys to enroll the minion

sudo salt-key --accept-all

accept the single key to enrool the minion

sudo salt-key --accept ceph-01

test salt execution with the following command

sudo salt '*' test.ping

salt states and pillars

The salt states and pillars are setup at /srv folder. States are saved in a folder called /srv/salt and pillar data are saved into the folder /srv/pillar