Install or upgrade Salt¶
Overview¶
Installing or upgrading Salt and Python are required as part of the pre-installation process. This page explains how to:
- Install the dependencies needed for the SaltStack Enterprise installer
- Install Salt and Python
- Upgrade Salt and Python
Regardless of which installation scenario you are using, you need to install or update Salt and the SaltStack Enterprise installer dependencies on all nodes that are involved in the installation scenario. The installation will fail if Salt and the installer’s dependencies are not installed on your nodes.
Consider also installing Salt on the infrastructure that will be managed by SaltStack Enterprise before you begin your installation. For an explanation of why you are encouraged to install Salt beforehand, see Do you need to install Salt prior to installation?.
Prerequisites¶
The pages in the SaltStack Enterprise installation process are intended to be read and followed in a specific order. Before reading this page, ensure that you have first read the following pages:
Install the SaltStack Enterprise installer dependencies¶
The SaltStack Enterprise installer requires a few important packages in order to run correctly:
- OpenSSL
- Extra Packages for Enterprise Linux (EPEL)
- Python cryptography
- Python OpenSSL library
These dependencies must be installed on all nodes that are involved in the installation:
- In a Single-node installation, you must install these dependencies on the node that will host the Salt Master, the Enterprise API (RaaS), a Redis database, and a PostgreSQL database.
- In a Multi-node installation, you must install these dependencies on all nodes that will host the Salt Master(s), the Enterprise API (RaaS), the Redis database, and the PostgreSQL database.
If you don’t install these dependencies, the SaltStack Enterprise installer will fail during either installation scenarios.
To check that these dependencies are present:
In the terminal, verify that these dependencies are installed on each node:
sudo yum list installed | grep openssl sudo yum list installed | grep epel-release sudo yum list installed | grep python36-cryptography sudo yum list installed | grep python36-pyOpenSSL
If the dependencies are not present, install the dependencies:
sudo yum install openssl sudo yum install epel-release -y sudo yum install python36-cryptography sudo yum install python36-pyOpenSSL
Danger
Ensure that you install the
python36-pyOpenSSL
package. It is necessary to configure SSL after installation, but this step must be complete before installation.
After all dependencies are installed, proceed to the next section.
Install Salt¶
If you are installing SaltStack Enterprise on an existing Salt infrastructure, Salt is already installed. In this case, instead refer to the instructions about how to Upgrade Salt and Python.
With that in mind, ensure that Salt is installed on any nodes that are directly involved in your SaltStack Enterprise installation or else the installation will fail. For a description of the different nodes involved in the installation process, see Which installation scenario should you use?.
Installing Salt involves three main tasks:
- Install Salt on the Salt Master(s)
- Install Salt on the Salt Minions
- Accept the minion keys on the Salt Master(s)
The following sections explain how to do these tasks.
Note
If you are running a Single-node installation scenario, you only need to install Salt on the Salt Master. The other two steps can be skipped.
Install Salt on the Salt Master(s)¶
In both a single-node and multi-node installation, you need to install both the Salt Master service and the Salt Minion service on the Salt Master host:
- In a Single-node installation scenario, the Salt Master is the node on which you will install all the SaltStack Enterprise architectural components (Salt Master, the Enterprise API (RaaS), a Redis database, and a PostgreSQL database).
- In a Multi-node installation scenario, this is the node that will become the Salt Master(s).
To install Salt on the Salt Master node:
Install the SaltStack repository and key:
sudo yum install https://repo.saltstack.com/py3/redhat/salt-py3-repo-latest.el7.noarch.rpm
Note
This script installs the latest Salt release on Redhat/Centos 7 PY3. If your machine is running a different operating system or version of Python, the script will not work. For information about installing Salt on other operating systems or Python versions, see the SaltStack Package Repo.
Clear the cache:
sudo yum clean expire-cache
Install the Salt Master service and the Salt Minion service on the Salt Master node:
sudo yum install salt-master sudo yum install salt-minion
Warning
During a single-node installation, if either the Salt Master or the Salt Minion packages are installed, but not both, the SaltStack Enterprise installation script will terminate. The script terminates as a safeguard to prevent the user from accidentally disrupting an existing installation.
For that reason, ensure that you install both the Salt Master and the Salt Minion packages.
Edit the
master.conf
file in the/etc/salt/minion
directory. In this file, set the Salt Master’s IP address to point to itself:master: localhost
Start the Salt Master and the Salt Minion service:
sudo systemctl start salt-master sudo systemctl enable salt-minion sudo systemctl start salt-minion
Note
Use
service salt-minion restart
to restart the minions if needed.
If you are running a Single-node installation scenario, no further steps are needed. For more information, see Next steps.
If you are running a Multi-node installation scenario, proceed to the next section.
Install Salt on the Salt Minions¶
This section is only required for multi-node installations. After installing Salt on the Salt Master as described in the previous section, the next step is to install the Salt Minion service (not the Salt Master service) on the three nodes that will become the Enterprise API (RaaS), a Redis database, and a PostgreSQL database.
Then, you need to configure the Salt Minions to communicate with the Salt Master. For more detailed information about installing the Salt Minion service, see Minion Configuration in the Salt documentation.
To install the Salt Minion service:
Install only the Salt Minion service by running the following command:
sudo yum install salt-minion
Answer
y
to all prompts to accept all changes.Configure each Salt Minion to communicate with the Salt Master by editing the
master.conf
file in the/etc/salt/minion
directory. In this file, provide the Salt Master’s IP address. For example:master: 192.0.2.1
Start the Salt Minions:
sudo systemctl enable salt-minion sudo systemctl start salt-minion
Note
Use
service salt-minion restart
to restart the minions if needed.Repeat the previous steps for all remaining nodes.
After successfully installing the Salt Minion service on all nodes, proceed to the next section.
Accept the minion keys on the Salt Master(s)¶
This section is only needed for multi-node installations. At this point, you have installed the Salt Master and Salt Minion services, and provided your minions with the master’s IP address. Now, in order for the Salt Master to send commands to the Salt Minions, the next step to accept the minion keys on the Salt Master.
Before proceeding:
- Ensure the Salt Master service is enabled and started (see the final step in the Install Salt on the Salt Master(s) section if needed).
- Ensure the Salt Minion is enabled and started on all the nodes (see the final step in the Install Salt on the Salt Minions section if needed).
To accept the keys:
In the Salt Master’s terminal, list all the keys that are on the Salt Master:
salt-key -L
Check that all the minion IDs are listed in
Unaccepted keys
.Note
If they appear in
Accepted keys
, no further action is needed as this is the end goal.Accept each minion ID using the following command, replacing the <your-minion-id> with the ID from your network:
salt-key -a <your-minion-ID>
Note
Running
salt-key -A
accepts all keys.Answer
y
to all prompts.Run the
salt-key -L
command a second time to confirm all minions appear inAccepted keys
.
After all Salt Minion keys are accepted, you have successfully installed Salt and can proceed to the next pre-installation step. For more information, see Next steps.
Upgrade Salt and Python¶
To upgrade Salt and Python to the latest stable versions on RedHat and CentOS:
In the terminal, check whether Python 3 is running on this node:
python3 --version
If needed, install or update to Python 3 using the following command:
sudo yum upgrade python3
Update Salt by running the following commands:
sudo yum install https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum install python36-pyOpenSSL
Restart all upgraded services:
sudo systemctl restart salt-minion
For information about upgrading Salt on other operating systems, see the SaltStack Package Repo.
Next steps¶
Once you have installed or updated Salt and its dependencies, you must complete additional pre-installation steps. The next step is to download, verify, and transfer the installation files for your installation scenario. To continue the pre-installation process, see Transfer and import files.