Salt has full support for running the Salt minion on Windows. You must connect Windows Salt minions to a Salt master on a supported operating system to control your Salt Minions.
Many of the standard Salt modules have been ported to work on Windows and many of the Salt States currently work on Windows as well.
Latest stable build from the selected branch:
Python2 x86: Salt-Minion-3001-x86-Setup.exe | md5
Python2 AMD64: Salt-Minion-3001-AMD64-Setup.exe | md5
Python3 x86: Salt-Minion-3001-x86-Setup.exe | md5
Python3 AMD64: Salt-Minion-3001-AMD64-Setup.exe | md5
The output of md5sum <salt minion exe>
should match the contents of the
corresponding md5 file.
Earlier builds from supported branches
Archived builds from unsupported branches
Note
The installation executable installs dependencies that the Salt minion requires.
The 64bit installer has been tested on Windows 7 64bit and Windows Server 2008R2 64bit. The 32bit installer has been tested on Windows 2008 Server 32bit. Please file a bug report on our GitHub repo if issues for other platforms are found.
There are installers available for Python 2 and Python 3.
The installer will detect previous installations of Salt and ask if you would like to remove them. Clicking OK will remove the Salt binaries and related files but leave any existing config, cache, and PKI information.
If the system is missing the appropriate version of the Visual C++
Redistributable (vcredist) the user will be prompted to install it. Click OK
to install the vcredist. Click Cancel
to abort the installation without
making modifications to the system.
If Salt is already installed on the system the user will be prompted to remove
the previous installation. Click OK
to uninstall Salt without removing the
configuration, PKI information, or cached files. Click Cancel
to abort the
installation before making any modifications to the system.
After the Welcome and the License Agreement, the installer asks for two bits of information to configure the minion; the master hostname and the minion name. The installer will update the minion config with these options.
If the installer finds an existing minion config file, these fields will be
populated with values from the existing config, but they will be grayed out.
There will also be a checkbox to use the existing config. If you continue, the
existing config will be used. If the checkbox is unchecked, default values are
displayed and can be changed. If you continue, the existing config file in
c:\salt\conf
will be removed along with the c:\salt\conf\minion.d
directory. The values entered will be used with the default config.
The final page allows you to start the minion service and optionally change its
startup type. By default, the minion is set to Automatic
. You can change the
minion start type to Automatic (Delayed Start)
by checking the 'Delayed
Start' checkbox.
Note
Highstates that require a reboot may fail after reboot because salt continues the highstate before Windows has finished the booting process. This can be fixed by changing the startup type to 'Automatic (Delayed Start)'. The drawback is that it may increase the time it takes for the 'salt-minion' service to actually start.
The salt-minion
service will appear in the Windows Service Manager and can
be managed there or from the command line like any other Windows service.
sc start salt-minion
net start salt-minion
Most Salt functionality should work just fine right out of the box. A few Salt modules rely on PowerShell. The minimum version of PowerShell required for Salt is version 3. If you intend to work with DSC then Powershell version 5 is the minimum.
The installer can be run silently by providing the /S
option at the command
line. The installer also accepts the following options for configuring the Salt
Minion silently:
Option |
Description |
---|---|
|
A string value to set the IP address or hostname of the master. Default value is 'salt'. You can pass a single master or a comma-separated list of masters. Setting the master will cause the installer to use the default config or a custom config if defined. |
|
A string value to set the minion name. Default value is 'hostname'. Setting the minion name causes the installer to use the default config or a custom config if defined. |
|
Either a 1 or 0. '1' will start the salt-minion service, '0' will not. Default is to start the service after installation. |
|
Set the minion start type to
|
|
Overwrite the existing config if present with the
default config for salt. Default is to use the
existing config if present. If |
|
A string value specifying the name of a custom config
file in the same path as the installer or the full
path to a custom config file. If |
|
Runs the installation silently. Uses the above settings or the defaults. |
|
Displays command line help. |
Note
/start-service
has been deprecated but will continue to function as
expected for the time being.
Note
/default-config
and /custom-config=
will backup an existing config
if found. A timestamp and a .bak
extension will be added. That includes
the minion
file and the minion.d
directory.
Here are some examples of using the silent installer:
# Install the Salt Minion
# Configure the minion and start the service
Salt-Minion-2017.7.1-Py2-AMD64-Setup.exe /S /master=yoursaltmaster /minion-name=yourminionname
# Install the Salt Minion
# Configure the minion but don't start the minion service
Salt-Minion-2017.7.1-Py3-AMD64-Setup.exe /S /master=yoursaltmaster /minion-name=yourminionname /start-minion=0
# Install the Salt Minion
# Configure the minion using a custom config and configuring multimaster
Salt-Minion-2017.7.1-Py3-AMD64-Setup.exe /S /custom-config=windows_minion /master=prod_master1,prod_master2
Notes:
These instructions were tested with Windows Server 2008 R2
They are generalizable to any version of Windows that supports a salt-minion
Click Start
> Control Panel
> User Accounts
.
Click Add or remove user accounts
.
Click Create new account
.
Enter salt-user
(or a name of your preference) in the New account name
field.
Select the Standard user
radio button.
Click the Create Account
button.
Click on the newly created user account.
Click the Create a password
link.
In the New password
and Confirm new password
fields, provide
a password (e.g "SuperSecretMinionPassword4Me!").
In the Type a password hint
field, provide appropriate text (e.g. "My Salt Password").
Click the Create password
button.
Close the Change an Account
window.
In a File Explorer window, browse to the path where Salt is installed (the default path is C:\Salt
).
Right-click on the Salt
folder and select Properties
.
Click on the Security
tab.
Click the Edit
button.
Click the Add
button.
Type the name of your designated Salt user and click the OK
button.
Check the box to Allow
the Modify
permission.
Click the OK
button.
Click the OK
button to close the Salt Properties
window.
salt-minion
Service¶Click Start
> Administrative Tools
> Services
.
In the Services list, right-click on salt-minion
and select Properties
.
Click the Log On
tab.
Click the This account
radio button.
Provide the account credentials created in section A.
Click the OK
button.
Click the OK
button to the prompt confirming that the user has been
granted the Log On As A Service right
.
Click the OK
button to the prompt confirming that The new logon name
will not take effect until you stop and restart the service
.
Right-Click on salt-minion
and select Stop
.
Right-Click on salt-minion
and select Start
.
This document will explain how to set up a development environment for Salt on Windows. The development environment allows you to work with the source code to customize or fix bugs. It will also allow you to build your own installation.
There are several scripts to automate creating a Windows installer as well as
setting up an environment that facilitates developing and troubleshooting Salt
code. They are located in the pkg\windows
directory in the Salt repo
(here).
Script |
Description |
---|---|
|
A PowerShell script that sets up a Python 2 build environment |
|
A PowerShell script that sets up a Python 3 build environment |
|
A batch file that builds a Windows installer based on the
contents of the |
|
A batch file that fully automates the building of the Windows installer using the above two scripts |
Note
The build.bat
and build_pkg.bat
scripts both accept a parameter to
specify the version of Salt that will be displayed in the Windows installer.
If no version is passed, the version will be determined using git.
Both scripts also accept an additional parameter to specify the version of Python to use. The default is 2.
The only prerequisite is Git for Windows.
Create a Salt-Dev
directory on the root of C:
. This will be our working
directory. Navigate to Salt-Dev
and clone the
Salt repo from GitHub.
Open a command line and type:
cd \
md Salt-Dev
cd Salt-Dev
git clone https://github.com/saltstack/salt
Go into the salt
directory and checkout the version of salt to work with
(2016.3 or higher).
cd salt
git checkout 2017.7.2
Navigate to the pkg\windows
directory and execute the build_env.ps1
PowerShell script.
cd pkg\windows
powershell -file build_env_2.ps1
Note
You can also do this from Explorer by navigating to the pkg\windows
directory, right clicking the build_env_2.ps1 powershell script and
selecting Run with PowerShell
This will download and install Python 2 with all the dependencies needed to develop and build Salt.
Note
If you get an error or the script fails to run you may need to change the execution policy. Open a powershell window and type the following command:
Set-ExecutionPolicy RemoteSigned
Editable mode allows you to more easily modify and test the source code. For more information see the Pip documentation.
Navigate to the root of the salt
directory and install Salt in editable mode
with pip
cd \Salt-Dev\salt
pip install -e .
Note
The .
is important
Note
If pip
is not recognized, you may need to restart your shell to get the
updated path
Note
If pip
is still not recognized make sure that the Python Scripts folder
is in the System %PATH%
. (C:\Python2\Scripts
)
Salt requires a minion configuration file and a few other directories. The
default config file is named minion
located in C:\salt\conf
. The
easiest way to set this up is to copy the contents of the
salt\pkg\windows\buildenv
directory to C:\salt
.
cd \
md salt
xcopy /s /e \Salt-Dev\salt\pkg\windows\buildenv\* \salt\
Now go into the C:\salt\conf
directory and edit the minion config file named
minion
(no extension). You need to configure the master and id parameters in
this file. Edit the following lines:
master: <ip or name of your master>
id: <name of your minion>
To create a Windows installer, follow steps 1 and 2 from Create a Build Environment above. Then proceed to 3 below:
To create the installer for Window we install Salt using Python instead of pip.
Navigate to the root salt
directory and install Salt.
cd \Salt-Dev\salt
python setup.py install
Navigate to the pkg\windows
directory and run the build_pkg.bat
with the build version (2017.7.2) and the Python version as parameters.
cd pkg\windows
build_pkg.bat 2017.7.2 2
^^^^^^^^ ^
| |
# build version -- |
# python version ------
Note
If no version is passed, the build_pkg.bat
will guess the version number
using git. If the python version is not passed, the default is 2.
Clone the Salt repo from GitHub into the
directory of your choice. We're going to use Salt-Dev
.
cd \
md Salt-Dev
cd Salt-Dev
git clone https://github.com/saltstack/salt
Go into the salt
directory and checkout the version of Salt you want to
build.
cd salt
git checkout 2017.7.2
Then navigate to pkg\windows
and run the build.bat
script with the
version you're building.
cd pkg\windows
build.bat 2017.7.2 3
^^^^^^^^ ^
| |
# build version |
# python version --
This will install everything needed to build a Windows installer for Salt using
Python 3. The binary will be in the salt\pkg\windows\installer
directory.
Create the directory C:\salt
(if it doesn't exist already)
conf
and var
directories frompkg\windows\buildenv
into C:\salt
Edit C:\salt\conf\minion
master: ipaddress or hostname of your salt-master
Start the salt-minion
cd C:\Python27\Scripts python salt-minion -l debug
On the salt-master accept the new minion's key
sudo salt-key -AThis accepts all unaccepted keys. If you're concerned about security just accept the key for this specific minion.
Test that your minion is responding
On the salt-master run:
sudo salt '*' test.version
You should get the following response: {'your minion hostname': True}
Windows Server 2003 and Windows XP have both reached End of Support. Though Salt is not officially supported on operating systems that are EoL, some functionality may continue to work.
On Windows Server 2003, you need to install optional component "WMI Windows Installer Provider" to get a full list of installed packages. If you don't have this, salt-minion can't report some installed software.