Install Salt Master and Minion Stack

Install Salt Master and Minion Stack

In this tutorial will show you how to install Salt master and minion and to manage them.

#1 Using YUM Repo

You can simply add the following to your Yum repo

vi /etc/yum.repos.d/salt.repo

 

[salt]
name=SaltStack repo for Red Hat Enterprise Linux $releasever
baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7

 

Yum clean expire-cache

Or

Yum clean all

yum install salt-master

 

RHEL/CentOS 5 and 6

chkconfig salt-master on

RHEL/CentOS 7

systemctl enable salt-master.service

To start the Master:

RHEL/CentOS 5 and 6

service salt-master start

RHEL/CentOS 7

systemctl start salt-master.service

 

Star Salt Minion

Simply follow the previous service start but use salt-minion instead.

Ex.:

systemctl enable salt-minion

 

Configure Salt Minion

vi /etc/salt/minion

Change below to name of the master

#master: salt

To

master: name_of_server_or_ip

Change name_of_server_or_ip to the master hostname or ip address, then restart the minion service.

 

Master and Minion Authentication

Now it's time to manage the keys which are used by Salt to connect to server

salt-key -L    This will list all the keys and there will be unaccepted keys

Accept the keys by running below command

salt-key -A

 

Talk to Minion Commands Examples

salt '*' test.ping

This will ping all the Minions.

salt '*' state.hightstate


Subscribe to
for video tutorials updates