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 Config 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 Config 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 Config 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?.

Tip

SaltStack Config is powered by Salt. Consult these guides to ensure your environment is following best practices when implementing Salt in your infrastructure:

Prerequisites

The pages in the SaltStack Config 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:

Note

As part of VMware’s initiative to remove problematic terminology, the term Salt master will be replaced with Salt controller in SaltStack Config and related products and documentation. This terminology update may take a few release cycles before it is fully complete.

Install the SaltStack Config installer dependencies

The SaltStack Config 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 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, the RaaS, the Redis database, and the PostgreSQL database.

If you don’t install these dependencies, the SaltStack Config installer will fail during either installation scenarios.

To check that these dependencies are present:

  1. 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
    
  2. 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 Config 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 Config 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 or masters
  • Install Salt on the minions
  • Accept the minion keys on the master or masters

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 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 minion service on the Salt master host:

  • In a Single-node installation scenario, the master is the node on which you will install all the SaltStack Config architectural components (master, RaaS, a Redis database, and a PostgreSQL database).
  • In a Multi-node installation scenario, this is the node that will become the master or masters.

To install Salt on the master node:

  1. Install the Salt project repository and key:

    sudo rpm --import https://repo.saltproject.io/py3/redhat/7/x86_64/latest/SALTSTACK-GPG-KEY.pub
    curl -fsSL https://repo.saltproject.io/py3/redhat/7/x86_64/latest.repo | sudo tee /etc/yum.repos.d/salt.repo
    

    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.

  2. Clear the cache:

    sudo yum clean expire-cache
    
  3. Install the Salt master service and the minion service on the master node:

    sudo yum install salt-master
    sudo yum install salt-minion
    

    Warning

    During a single-node installation, if either the master or the minion services are installed, but not both, the SaltStack Config 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 master and the minion services.

  4. Edit the master.conf file in the /etc/salt/minion directory. In this file, set the master’s IP address to point to itself:

    master: localhost
    
  5. Start the Salt master service and 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 master as described in the previous section, the next step is to install the minion service (not the Salt master service) on the three nodes that will become the RaaS, a Redis database, and a PostgreSQL database.

Then, you need to configure the minions to communicate with the master. For more detailed information about installing the minion service, see Minion Configuration in the Salt documentation.

To install the minion service:

  1. Install only the minion service by running the following command:

    sudo yum install salt-minion
    
  2. Answer y to all prompts to accept all changes.

  3. Configure each minion to communicate with the master by editing the master.conf file in the /etc/salt/minion directory. In this file, provide the master’s IP address. For example:

    master: 192.0.2.1
    
  4. Start the minion service:

    sudo systemctl enable salt-minion
    sudo systemctl start salt-minion
    

    Note

    Use service salt-minion restart to restart the minions if needed.

  5. Repeat the previous steps for all remaining nodes.

After successfully installing the minion service on all nodes, proceed to the next section.

Accept the minion keys on the master(s)

This section is only needed for multi-node installations. At this point, you have installed the Salt master service and minion service, and you have provided your minions with the master’s IP address. Now, in order for the master to send commands to the minions, the next step to accept the minion keys on the master.

Before proceeding:

To accept the keys:

  1. In the master’s terminal, list all the keys that are on master:

    salt-key -L
    
  2. 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.

  3. 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.

  4. Answer y to all prompts.

  5. Run the salt-key -L command a second time to confirm all minions appear in Accepted keys.

After all 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:

  1. In the terminal, check whether Python 3 is running on this node:

    python3 --version
    
  2. If needed, install or update to Python 3 using the following command:

    sudo yum upgrade python3
    
  3. 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
    
  4. 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.