Table of contents
1.
Introduction
2.
Requirements for installation
2.1.
System Requirements
2.2.
Salt Network Ports
2.3.
Permissions
2.4.
Supported Operating Systems
2.5.
Python Support
3.
Salt Installation
3.1.
Installation on Linux-based OS
3.2.
Windows or MacOS installation
4.
Configuration
4.1.
Master configuration
4.2.
Basic minion configuration
5.
Starting the Service
5.1.
Using systemctl
5.2.
Starting in the foreground
6.
Accepting the keys
6.1.
Accepting the key
6.2.
Deleting keys
7.
Frequently Asked Questions
7.1.
What is a Salt Master?
7.2.
What is a Minion?
7.3.
What is SaltStack used for?
8.
Conclusion
Last Updated: Mar 27, 2024
Medium

Salt Install Guide

Author Harsh
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

SALT is a utility for automating and managing configurations. It can be used to manage a huge number of systems remotely. The deployment of new programs is sped up by SaltStack's automation and streamlining of routine system management.

A shared repository is used to install and update software for physical, virtual, and cloud servers.

Salt Install Guide

In this blog, we will learn about how we can install Salt in our system. We will look at the requirements and the steps required to install Salt in our system.

Requirements for installation

Before installing Salt on our system. Let’s see some requirements that are needed.

System Requirements

Numerous variations of Linux, Windows, Mac OS X, and UNIX are supported by and managed by Salt. But whether a given operating system will execute the salt-master service or the salt-minion service determines whether Salt can function on that system.

The master-client model is used by Salt, in which a master node issues commands to a client node, which then executes the command. A node that is running the salt-master service is referred to as the salt master in the Salt ecosystem. It sends instructions to one or more Salt minions, which are nodes running the salt-minion service and signed up to that specific Salt master.

Salt Network Ports

Only inbound connections to the Salt master are needed for the paradigm of communication between salt masters and minions. Never the master, just the minion, is used to develop connections.

Network ports

Permissions

Ensure that you have system administrator rights on the nodes that you want to install Salt on in order to install Salt in your system.

Supported Operating Systems

The operating systems Linux, Windows, Mac OS X, and UNIX are all supported by Salt, which also manages them. But whether or not that operating system will support the salt-master or salt-minion services determines whether Salt can function on that platform.

Supported OS

There are many other operating systems supported. Visit the below mentioned link to get the full list of the supported operating systems.

Supported Operating Systems.

Salt runs and manages many versions of Linux, Windows, Mac OS X, and UNIX. However, Salt's ability to run on a specific operating system is dependent on whether that operating system supports the salt-master or salt-minion services.

Python Support

Python 3.5 or above is required for Salt 3005.1. Salt 3006 will require Python 3.7 or higher in the future. Salt 3005 is the most recent release that supports Python 3.5 and 3.6. Only Python versions 3.7 and higher will be supported in Salt release 3006.

Salt Installation

Salt can be installed on different operating systems like Linux, Windows, and macOS. In this section of the blog, we will see how we can install Salt in different operating systems.

Salt-master must be installed on the node that will administer the other nodes, i.e. the node that will issue commands to the other nodes. The Salt-minion service must then be installed on the nodes that will be managed by the Salt-master.

Installation on Linux-based OS

The bootstrap script is suggested for Linux-based operating systems, but you can manually install Salt using the instructions for each operating system. 

Let’s see the bootstrap script method for installing Salt.
 

Bootstrap Installation

The Salt Bootstrap project keeps a Bash shell script that may be used to install Salt on any Linux/Unix platform. The script installs the salt-master and salt-minion system packages and automatically activates Salt services.

Steps for installing Salt:

1. Using the following command, get the install script:

curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io

 

2. To make the bootstrap script executable, run the following command:

chmod +x bootstrap-salt.sh

 

3. To install Salt services, run the bash script using the following command:

./bootstrap-salt.sh -M

 

Note: You can refer to the documentation to get the steps for manually installing the salt service on your system.

Manual install directions by operating system

Windows or MacOS installation

You can directly download the installation file on windows or macOS and run it on your system to install the Salt service. Visit the below mentioned link to get the installation file for your operating system.

Steps for installing Salt in Windows Operating System:

1. Visit the following link to download the package file.
 

2. You will see the following screen. Download the EXE package of your choice and run it on your system.

Download Page

 

3. After running the file. You will see the following screen. Just click on the Next button.

 

Welcome Screen

 

4. Accept the licence agreement and click on next. After that you will be asked to enter the install location. Just let it be the default location and click on Next.

Install Location

 

5. On the next screen you will be asked to enter the master and minion name. Fill in the details and click on Install.

Minion Settings

 

6. Congratulations! You have successfully installed Salt on your system.

Setup Complete

 

Steps for installing Salt in macOS:

1. Visit the following link to download the package file.

 

2. Run the downloaded file and follow the on screen instructions to install Salt on your system.

 

3. After installation, set the Salt master location and Salt minion ID, changing the placeholder content with your own details:

sudo salt-config -i yourminionname -m yoursaltmaster

 

4. Run the following command to start the minion service.

sudo launchctl start com.saltstack.salt.minion

5. Congratulations!! You have successfully installed Salt on your system. 

 

6. If you want to stop the minion service. You can run the following command.

sudo launchctl stop com.saltstack.salt.minion

Configuration

After installing Salt on your system, you need to configure it. So, that it can function properly.

We need to configure the Salt minions to connect to the Salt master's DNS/hostname or IP address.

Master configuration

The salt-master service has preset server settings. All of the commented settings are present in the default master YAML configuration at /etc/salt/master. Custom settings in YAML can be added to /etc/salt/master.d/ as .conf files on the Salt master.

Salt master network settings

By default, the master binds to all accessible network interfaces and listens on ports 4505 and 4506.

This example overrides the default settings:

# The network interface to bind to
interface: 192.0.2.20

# The Request/Reply port
ret_port: 3006

# The publish port
publish_port: 3005

 

Salt master process management

The master threads out worker processes with the worker_threads setting to manage the salt-minion return calls. The processes' default worker limit is fiveThree workers are the bare minimum.

An example settings in a master configuration file:

worker_threads: 4

Basic minion configuration

By default, the salt-minion service includes DNS/hostname configuration. All of the commented settings are included in the default minion YAML configuration in /etc/salt/minion. You can add custom YAML settings to /etc/salt/minion.d/ as .conf files on the minion.

Connecting to the Salt master

The minions default to assuming that the Salt master may be resolved in DNS using the hostname salt.

An example of a setting that overrides the master default:

master: 192.0.2.20
 

Declaring the minion ID

Unless expressly configured, the salt-minion will identify itself to the master by the system's hostname:

We can change the name by adding the following line in /etc/salt/minion.d/id.conf file

id: ninja_1

Starting the Service

In this section of the blog, we will see how we can start the Salt service on our system. First, we need to start the salt-master after that we can start salt-minion.

The most common approach to start Salt processes is with systemctl. When you call the process directly, the active logs will be displayed in the foreground.

Using systemctl

Use the following command to start salt-master and salt-minion using systemctl:

systemctl start salt-master
systemctl start salt-minion

Starting in the foreground

We can also start the salt-master and salt-minion in foreground using the below mentioned command:

salt-master
salt-minion

The next step is to accept the keys for salt-minion.

Accepting the keys

Salt uses two types of keys RSA and AES. The RSA keys are the foundation of Salt's authentication and encryption mechanism.

The master also delivers a rotating AES key, which is used to encrypt and decode Salt master messages. The returned AES key is encrypted using the Salt minion's public key and may thus be decoded only by the same Salt minion.

Accepting the key

When a new minion checks in, the key is placed in Unaccepted keys and will remain there until it is accepted.

To check the current state of key management, use salt-key:

The output will look something like this:

Unaccepted Keys:
cn1
Accepted Keys:
web1
Rejected:


To accept keys, run:

salt-key -a cn1

 

You can accept all keys at once using the below command:

salt-key -A

Deleting keys

To delete an accepted key run the following command:

salt-key -d web1

 

We can also delete all of the accepted keys at once, using the following command:

salt-key -D

Frequently Asked Questions

What is a Salt Master?

Salt's central concept is that of a Master who commands one or more Minions. The Central Management System is the Master. The Salt minion communicates with the Salt Master via instructions and configurations when run on managed systems. The Salt Master's operating system is Linux, but any other system can be a minion.
 

What is a Minion?

Salt minions are the servers that power your apps and services. These are the managed systems that respond to Salt Master orders. The Salt master can send directives to specific minions by utilising the ID issued to each one.
 

What is SaltStack used for?

SaltStack, often known as Salt, is a solution for configuration management and orchestration. It makes use of a central repository to provide new servers and other IT infrastructure, modify existing ones, and install the software in IT environments such as real and virtual servers, as well as the cloud.
 

Conclusion

In this blog, we discussed the requirements for installing salt in our system. After that, we saw the steps to install the salt service in our system. We also saw the steps for configuring salt service. Lastly we talked about how we can start the service in our system.

If you think this blog has helped you enhance your knowledge about the above question, and if you want to learn more, check out our articles. 

🔥 About Salt Engine
 

🔥 About Salt Mine
 

🔥 Job Management In Salt
 

🔥 Salt as a Cloud Controller
 

And many more on our Coding Ninjas Studio.

Visit our website to read more such blogs. Make sure that you enroll in the courses we provide, take mock tests, solve problems available, and interview puzzles. Also, you can pay attention to interview stuff- interview experiences and an interview bundle for placement preparations. 

Please upvote our blog to help other ninjas grow.

Happy Learning!

Live masterclass