How to install SaltStack on Fedora 36

In this guide, we will walk you through the installation of SaltStack on Fedora 36.

SaltStack is a Python-based, open-source for event-driven It automation, remote task execution, and configuration management. Salt was designed to be highly modular and easily extensible, to make it easy to mold to diverse IT enterprise use cases.

Salt is capable of maintaining remote nodes in defined states that is it can ensure specific packages are installed and that specific services are running. Salt can query and execute commands either on individual nodes or by using arbitrary selection criteria.

The core functions of Salt

  • Salt enables commands on the remote systems to be called in parallel rather than serially.
  • Salt provides a simple programming interface.
  • It uses the smallest and fastest network payload possible
  • Use a secure and encrypted protocol.

Salt Architecture

Salt uses the master client model. Master issues command to the client and the client executes the commands. Salt master is the server that is running the salt-master service. Salt minions are the servers running the salt-minion services.

A target is a group of minions across one or many masters that a job’s salt command applies to.

Grains interface derives information about the underlying system. Grains are collected for the operating system, domain name, IP addresses, kernel os, etc.

Installing salt on Fedora 36

1. Update system repositories

Before we begin, we need to update our system repositories in order to make them up to date.

sudo dnf update 

2. Install Salt on Fedora 36

Salt is readily available on Fedora repositories and the EPEL. So it is easy to run and install Salt using the dnf or the yum package.

To install both Salt master and minion on your system, use the following command and remember that you need to install a master on the control machine and minions on the servers you want the salt to run on.

Install Salt master

$ sudo dnf install salt-master

The following is the output from the above command.

Package                    Arch        Version              Repository    Size
================================================================================
Installing:
 salt-master                noarch      3004.2-1.fc36        updates      3.1 M
Installing dependencies:
 dnf-utils                  noarch      4.2.1-1.fc36         updates       37 k
 libtomcrypt                x86_64      1.18.2-14.fc36       fedora       389 k
 libtommath                 x86_64      1.2.0-7.fc36         fedora        63 k
 libunwind                  x86_64      1.6.2-2.fc36         fedora        67 k
 openpgm                    x86_64      5.2.122-28.fc36      fedora       177 k
 python3-msgpack            x86_64      1.0.3-2.fc36         fedora        86 k
 python3-pycryptodomex      x86_64      3.15.0-1.fc36        updates      1.1 M
 python3-pycurl             x86_64      7.45.1-1.fc36        fedora       186 k
 python3-zmq                x86_64      22.3.0-2.fc36        fedora       403 k
 salt                       noarch      3004.2-1.fc36        updates      9.3 M
 zeromq                     x86_64      4.3.4-3.fc36         fedora       440 k

Transaction Summary
================================================================================
Install  12 Packages

Total download size: 15 M
Installed size: 58 M
Is this ok [y/N]: y

To install Salt minion we use the following command.

sudo dnf install salt-minion

Whenever you want to connect to minions, you need to have proper permission and for this we need to have Salt ssh.

sudo dnf install salt-ssh

In order to install Salt API we use the following command.

sudo dnf install salt-api

3. Post installation tasks

After the installation is complete, you can run post installations tasks on both master and minions.

To enable Salt master start automatically on boot use the following command.

sudo systemctl enable salt-master

To start Salt master, we use the following command

sudo systemctl start salt-master

To enable Salt minion start automatically on boot we use the this command.

sudo systemctl enable salt-minion

To start Salt minion, we use the following command.

sudo systemctl start salt-minion

To check the status of both Salt master and Salt minion, we use the following command.

$ sudo systemctl status salt-master // for salt master
$ sudo systemctl status salt-minion // for salt minion
● salt-master.service - The Salt Master Server
     Loaded: loaded (/usr/lib/systemd/system/salt-master.service; enabled; ven>
     Active: active (running) since Sat 2022-08-13 06:36:03 UTC; 11s ago
       Docs: man:salt-master(1)
             file:///usr/share/doc/salt/html/contents.html
             https://docs.saltproject.io/en/latest/contents.html
   Main PID: 10739 (salt-master)
      Tasks: 32 (limit: 1113)
     Memory: 199.1M
        CPU: 6.621s
     CGroup: /system.slice/salt-master.service
             ├─ 10739 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10743 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10746 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10747 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10750 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10751 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10752 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10759 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10760 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10762 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10766 /usr/bin/python3 /usr/bin/salt-master
             ├─ 10768 /usr/bin/python3 /usr/bin/salt-master

4. Configuration of the Saltstack

To start off, we need to configure the master so that it will know of the existence of the minions. All the configuration files are found on /etc/salt/.The minions or the master must be findable for it to establish the communication.

To configure Salt master go to /etc/salt/master and add your master IP address with Salt-master IP address.

$ sudo vi /etc/salt/master

Uncomment interface and add the salt-master IP address.

Restart Salt-master for the changes to take effect.

sudo systemctl restart salt-master

Next we need to configure Salt-minion, go to /etc/salt/minion and replace master: salt with a master IP address.

sudo /etc/salt/minion

Uncomment master: salt and remove salt and replace with your master IP address.

We need to restart the server again for the changes to take effect.

sudo systemctl restart salt-minion 

5. Test configuration

To see the configuration use the following commands:

sudo salt-key -L

From the above command you be in a position to see the following:

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

To accept all keys use the following command.

$ salt-key -A

Conclusion

Congratulations we have installed Salt-master and Salt-Minion on Fedora 36.

About Kipkoech Sang

I am a technology enthusiast who loves to share gained knowledge through offering daily tips as a way of empowering others. I am fan of Linux and all other things open source.
View all posts by Kipkoech Sang →

Leave a Reply

Your email address will not be published.