• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Install SaltStack on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
24
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Operations on the SaltStack master server
    1. 1.1 Update the system
    2. 1.2 Install and configure the salt-master program
    3. 1.3 Modify firewall rules
  3. Step 2: Operations on the SaltStack agent server
    1. 2.1 Update the system
    2. 2.2 Install and configure the salt-minion program
  4. Step 3: Test your setup on the SaltStack master server
  5. Want to contribute?


SaltStack, or Salt, is a popular open source configuration management solution which can be used to implement remote execution, configuration management, code deployment and much more. Salt can manage tens of thousands of servers in parallel. Thanks to its ease of use, scalability, and high efficiency, Salt has been widely used to manage various infrastructures around the world.

In this article, I will show you how to install Salt on two CentOS 7 server instances to implement the Salt agent-and-server managing model. In this model, you will have one master server and one agent server (called minion), and you can add more minions later.

Prerequisites

Before proceeding, I assume that you have:

  • Deployed two CentOS 7 server instances in the same Vultr data center.
  • Setup private networking on both of the two server instances. See this article: Configuring Private Network.
  • Created non-root sudo users on both of the two machines.

The summary of our two servers is as follows.

SaltStack master server:

  • OS: CentOS 7
  • hostname: master
  • Private IP: 10.99.0.10

SaltStack agent server 1:

  • OS: CentOS 7
  • hostname: minion1
  • Private IP: 10.99.0.11

Step 1: Operations on the SaltStack master server

1.1 Update the system

Use the sudo user to log into the SaltStack master server, then update the system to the latest stable status:

sudo yum update -y && sudo reboot

After the reboot completes, use the same sudo user to log in.

1.2 Install and configure the salt-master program

Use the SaltStack official YUM repo to install the latest salt-master program:

sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-2015.8-2.el7.noarch.rpm
sudo yum clean expire-cache
sudo yum install salt-master

After the installation finishes, modify the configuration file as below:

sudo vi/etc/salt/master

Find:

#interface: 0.0.0.0

Replace the line with:

interface: 10.99.0.10

Find:

#hash_type: md5

Replace the line with:

hash_type: sha256

Save and quit:

:wq

Start and enable the salt-master service:

sudo systemctl start salt-master.service
sudo systemctl enable salt-master.service

1.3 Modify firewall rules

By default, the salt-master service will use ports 4505 and 4506 to communicate with minions. You need to allow traffic through the two ports on the master server.

Find out to which zone the eth1 interface belongs:

sudo firewall-cmd --get-active-zones

You will find out that the eth1 interface belongs to the “public” zone. Therefore, you need to allow traffic through the two ports in the “public” zone:

sudo firewall-cmd --permanent --zone=public --add-port=4505-4506/tcp
sudo firewall-cmd --reload

That’s all that needs to be done on the master server for now. It’s time to setup the SaltStack agent server.

Step 2: Operations on the SaltStack agent server

2.1 Update the system

Use the sudo user to log in the SaltStack agent server. Again, update the system to the latest stable status:

sudo yum update -y && sudo reboot

After the reboot, use the same sudo user to log in.

2.2 Install and configure the salt-minion program

Use the SaltStack official YUM repo to install the latest salt-minion program:

sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-2015.8-2.el7.noarch.rpm
sudo yum clean expire-cache
sudo yum install salt-minion

After the installation, modify the configuration file as below:

sudo vi /etc/salt/minion

Find:

#master: salt

Replace the line with:

master: 10.99.0.10

Find:

#hash_type: sha256

Replace the line with:

hash_type: sha256

Save and quit:

:wq

Start and enable the salt-minion service:

sudo systemctl start salt-minion.service
sudo systemctl enable salt-minion.service

After starting up, the salt-minion service will send off a signal to find the SaltStack server.

If you have more SaltStack agent servers, you need to setup them in the same fashion.

Step 3: Test your setup on the SaltStack master server

Return to the SSH connection to the SaltStack master server, input the following command to show all available agents:

sudo salt-key -L

If everything was successful, you will see the agent server “minion1” listed in the “Unaccepted Keys” segment.

Accepted Keys:
Denied Keys:
Unaccepted Keys:
minion1
Rejected Keys:

Accept “minion1” using this command:

salt-key --accept=minion1

Or accept all of the agent servers:

salt-key -A

Finally, you can test your setup using the example commands below:

Example 1:

sudo salt minion1 test.ping

The output show:

minion1:
    True

Example 2:

sudo salt minion1 cmd.run pwd

The output show:

minion1:
    /root

That’s it. You can learn more about SaltStack on its official website. Enjoy it!

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Countly Analytics on CentOS 7

Next Post

How to Install Ventrilo as a Service on CentOS 6

Next Post

How to Install Ventrilo as a Service on CentOS 6

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet