The dependencies for running Salt at the time of writing are as follows:
- Python 2 – Version 2.6 or greater (Salt is not Python 3-compatible)
- Msgpack – python
- YAML
- Jinja2
- MarkupSafe
- ZeroMQ – Version 3.2.0 or greater
- PyZMQ – Version 2.2.0 or greater
- Tornado
- PyCrypto
- M2Crypto
The easiest way to ensure that the dependencies for Salt are met is to use system-specific package management systems, such as apt
on Ubuntu systems, that will handle the dependency-resolution automatically. You can also use the Salt Bootstrap script to handle all of the system-specific commands for you. Salt Bootstrap is an open source project with the goal of creating a Bourne shell-compatible script that will install Salt on any compatible server. The project is managed and hosted by the SaltStack team. You can find more information at https://github.com/saltstack/salt-bootstrap.
We will explore each of these methods of installation in turn, on a few different platforms.
Installation with system packages (Ubuntu)
The latest release of Salt for Ubuntu is provided via the official SaltStack package repository at http://repo.saltstack.com.
First, you must add the official SaltStack GPG key so that the packages can be verified:
Now, you must open the file /etc/apt/sources.list
and add the following line:
Save and close that file.
After you have added the repository, you must update the package management database, as follows:
You should then be able to install the Salt master and the Salt minion with the following command:
Assuming there are no errors after running this command, you should be done! Salt is now installed on your machine.
Note that we have installed both the Salt master and the Salt minion. The term master
refers to the central server—the server from which we will be controlling all of our other servers. The term minion
refers to the servers connected to and controlled by a master.
Installation with system packages (CentOS 6)
The latest release of Salt for RedHat/CentOS systems is also provided via the official SaltStack package repository at http://repo.saltstack.com.
You can set up both the repository and the keys required with a single command:
Make sure that the caches are clean with the following command:
Then, install the Salt master and Salt minion with the following commands:
Assuming that there are no errors after running this command, you should be done! Salt is now installed on your machine.
As with Ubuntu, we installed both the Salt master and the Salt minion. The term master refers to the central server—the server from which we will be controlling all of our other servers. The term minion refers to the servers connected to and controlled by a master.
Installation with system packages (Windows)
The latest release of Salt for Windows systems is also provided via official packages from SaltStack. However, because Windows doesn't currently have a built-in package manager, the process is more manual. You download the installer and then run it like you would install most other software on Windows.
Start by going to the Windows section of the SaltStack repo: http://repo.saltstack.com/#windows.
Here, you'll see links to the x86 and AMD64 versions of the Salt minion for Windows:
For most setups, you'll want the 64-bit version, highlighted in the preceding image. When you download and run that file, you'll see the following screen:
Continue the installation process by clicking Next and agreeing to the license agreement.
You'll then be shown a configuration page:
Here, you can enter the hostname or IP address of your Salt master, so the minion knows where to connect. You'll also have the option of setting the ID of the minion. Set it to something that describes the purpose of the minion so that when you have many minions, you'll be able to tell each of them apart. Then, click Install.
Once the installation completes, you'll have the option of starting the minion. Leave this box checked and click Finish:
You are done! Salt is now installed on your machine.
Note that the Salt master is not supported on Windows machines, so we only installed the Salt minion on this machine.
Installing with Salt Bootstrap
Information about manual installation on other major Linux distributions can be found online at http://docs.saltstack.com. However, in most cases, it is easier and more straightforward to use the
Salt Bootstrap script. In-depth documentation can be found on the project page at https://github.com/saltstack/salt-bootstrap; however, the tool is actually quite easy to use, as follows:
We won't include the help text for Salt Bootstrap here as it would take up too much space. However, it should be noted that, by default, Salt Bootstrap will only install the Salt minion. We want both the Salt minion and the Salt master, which can be accomplished by passing in the -M
flag. We also want to pass in the -P
flag to allow bootstrap to install Tornado using pip
:
The preceding command will result in a fully functional installation of Salt on your machine! The supported operating system list is extensive, as shown in the salt-bootstrap documentation at https://github.com/saltstack/salt-bootstrap.
Note
The version of Salt used for the examples in this book is the 2015.8 release. Here is the full version information:
It's probable that the version of Salt you installed is a newer release and might have slightly different output. However, the examples should still all work in the latest version of Salt.