SaltStack Installation on CentOS 7- Part 1

A config-manager tool similar to Ansible

Prerequisites to install SaltStack:-

  1. The salt master and minion need to be able to ping each other. For this requirement, make sure you choose intnet in the networking options (along with NAT). Then set a static IP for each host (for example: 192.168.10.xx). For this series, I am using three hosts

2. Ensure that ports 4505-4506/tcp are not closed. Salt Master uses 4505/tcp to send instructions/latest state details to the minion. Whereas 4506/tcp is used by Salt Minion to send current state to the master. To open up these ports, use firewall-cmd

adi@master# sudo firewall-cmd --zone=public --permanent --add-ports=4505–4506/tcp
adi@master# sudo firewall-cmd --reload

Repeat the procedure of opening up of the ports in minion VM too.

3. If you have not yet installed EPEL repo, make sure you have installed it.

adi@master# sudo yum install epel-release

Otherwise, you will get No package available

Error Report:
ID: roles_webserver_package
Function: pkg.installed
Name: nginx
Result: false
Comment: Error occurred while installing package(s)
errors: No Package Nginx available

Now that the prerequisite part has been completed, let us move on to install SaltStack. The installation is a simple 3 step process.

  1. In the first step, we have to install salt repository and key.

adi@master# sudo yum install

2. Sometimes, cache of the downloaded packages remain even after removing the downloaded packages. One can check /var/cache/yum to view package cache data. In order to clean the cache repository, we use sudo yum clean. clean has some options such as expire-cache , metadata , headers , and all .

adi@master# sudo yum clean expire-cache

expire-cacheexpunges mirrolist and time records of the packages we have downloaded.

3. Salt provides us the option of installing salt-master , salt-minion, salt-cloud, salt-syndic, salt-ssh. For now, let us download the master and minion.

adi@master# sudo yum install salt-master

One has the option to install master and minion in a same host. But for better understanding, let us install master and minion in seperate hosts.

Repeat the above steps in minion host, and at the last step replace salt-master with salt-minion.

adi@minion1# sudo yum install salt-minion