installing salt-stack: salt-master and salt-minion

Installation

salt master

$ curl -L https://bootstrap.saltstack.com -o install_salt.sh
$ sudo sh install_salt.sh -P -M

Salt master can manage itself, so a Salt minion is installed along with the Salt master.
If you do not want to install the minion, also pass the -N option.
$ sudo sh install_salt.sh -P -M -N

salt minion

-       Default minions will use "salt" as the salt master hostname. you can edit this in the minion's /etc/salt/minions "master: x.x.x.x"
-       when minion first startup, it will look for "salt" and try to put its key to master
$ curl -L https://bootstrap.saltstack.com -o install_salt.sh
$ sudo sh install_salt.sh -P

accepting keys

You may manually accept the minion key from salt master or you may preseed minion with a key generated from salt master
The key name should always match the minion ID which later on you can find from the minion's /etc/salt/minion_id

From salt master:
$ salt-key --gen-keys=minion1

2 files will be generated:
copy and rename the .pub file into /etc/salt/pki/minions/ folder with the minion ID
$ cp minion.pub /etc/salt/pki/minions/minion1

copy these 2 files to minion before starting the salt-minion service
$ scp minion1.pem minion1.pub root@minion1:/etc/salt/pki/minion/

Start | Stop

$ systemctl start salt-minion
$ systemctl start salt-master


No comments: