2015-07-07 21:34:57 -06:00
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
2022-05-18 09:49:12 -06:00
|
|
|
A simple Powershell script to download and install a Salt minion on Windows.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.DESCRIPTION
|
2022-05-18 09:49:12 -06:00
|
|
|
The script will download the official Salt package from SaltProject. It will
|
2016-06-17 16:03:01 -06:00
|
|
|
install a specific package version and accept parameters for the master and
|
2022-05-18 09:49:12 -06:00
|
|
|
minion ids. Finally, it can stop and set the Windows service to "manual" for
|
2016-06-17 16:03:01 -06:00
|
|
|
local testing.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.EXAMPLE
|
2016-06-17 16:03:01 -06:00
|
|
|
./bootstrap-salt.ps1
|
|
|
|
Runs without any parameters. Uses all the default values/settings.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.EXAMPLE
|
2017-08-08 10:22:20 -04:00
|
|
|
./bootstrap-salt.ps1 -version 2017.7.0
|
2016-06-17 16:03:01 -06:00
|
|
|
Specifies a particular version of the installer.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2017-08-08 10:22:20 -04:00
|
|
|
.EXAMPLE
|
|
|
|
./bootstrap-salt.ps1 -pythonVersion 3
|
2022-05-18 09:49:12 -06:00
|
|
|
Specifies the Python version of the installer. Can be "2" or "3". Defaults
|
|
|
|
to "2". Python 3 installers are only available for Salt 2017.7.0 and newer.
|
|
|
|
Starting with Python 3002 only Python 3 installers are available.
|
2017-08-08 10:22:20 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.EXAMPLE
|
2016-06-17 16:03:01 -06:00
|
|
|
./bootstrap-salt.ps1 -runservice false
|
|
|
|
Specifies the salt-minion service to stop and be set to manual. Useful for
|
|
|
|
testing locally from the command line with the --local switch
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.EXAMPLE
|
2016-06-17 16:03:01 -06:00
|
|
|
./bootstrap-salt.ps1 -minion minion-box -master master-box
|
|
|
|
Specifies the minion and master ids in the minion config. Defaults to the
|
|
|
|
installer values of host name for the minion id and "salt" for the master.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2015-07-07 21:34:57 -06:00
|
|
|
.EXAMPLE
|
2017-08-08 10:22:20 -04:00
|
|
|
./bootstrap-salt.ps1 -minion minion-box -master master-box -version 2017.7.0 -runservice false
|
2016-06-17 16:03:01 -06:00
|
|
|
Specifies all the optional parameters in no particular order.
|
2016-04-13 12:46:36 -04:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
.PARAMETER version
|
|
|
|
Default version defined in this script.
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2017-08-08 10:22:20 -04:00
|
|
|
.PARAMETER pythonVersion
|
|
|
|
The version of Python the installer should use. Specify either "2" or "3".
|
|
|
|
Beginning with Salt 2017.7.0, Salt will run on either Python 2 or Python 3.
|
|
|
|
The default is Python 2 if not specified. This parameter only works for Salt
|
|
|
|
versions >= 2017.7.0.
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
.PARAMETER runservice
|
|
|
|
Boolean flag to start or stop the minion service. True will start the minion
|
|
|
|
service. False will stop the minion service and set it to "manual". The
|
|
|
|
installer starts it by default.
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
.PARAMETER minion
|
|
|
|
Name of the minion being installed on this host. Installer defaults to the
|
|
|
|
host name.
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
.PARAMETER master
|
|
|
|
Name or IP of the master server. Installer defaults to "salt".
|
|
|
|
|
|
|
|
.PARAMETER repourl
|
2021-01-21 22:44:46 +00:00
|
|
|
URL to the windows packages. Default is "https://repo.saltproject.io/windows"
|
2015-07-07 21:34:57 -06:00
|
|
|
|
|
|
|
.NOTES
|
2016-06-17 16:03:01 -06:00
|
|
|
All of the parameters are optional. The default should be the latest
|
|
|
|
version. The architecture is dynamically determined by the script.
|
2015-07-07 21:34:57 -06:00
|
|
|
|
|
|
|
.LINK
|
2016-06-17 16:03:01 -06:00
|
|
|
Bootstrap GitHub Project (script home) - https://github.com/saltstack/salt-windows-bootstrap
|
|
|
|
Original Vagrant Provisioner Project -https://github.com/saltstack/salty-vagrant
|
|
|
|
Vagrant Project (utilizes this script) - https://github.com/mitchellh/vagrant
|
2021-01-21 22:44:46 +00:00
|
|
|
SaltStack Download Location - https://repo.saltproject.io/windows/
|
2015-07-07 21:34:57 -06:00
|
|
|
#>
|
2016-05-25 16:02:03 -07:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2022-05-18 09:49:12 -06:00
|
|
|
# Bind Parameters
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2015-07-07 21:34:57 -06:00
|
|
|
[CmdletBinding()]
|
2022-05-18 09:49:12 -06:00
|
|
|
param(
|
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
2016-06-17 16:03:01 -06:00
|
|
|
# Doesn't support versions prior to "YYYY.M.R-B"
|
2020-02-13 17:07:17 -07:00
|
|
|
# Supports new version and latest
|
|
|
|
# Option 1 means case insensitive
|
|
|
|
[ValidatePattern('^(\d{4}(\.\d{1,2}){0,2}(\-\d{1})?)|(latest)$', Options=1)]
|
2022-05-18 09:49:12 -06:00
|
|
|
[string]$Version = '',
|
2016-06-17 16:03:01 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
2020-02-13 17:07:17 -07:00
|
|
|
# Doesn't support Python versions prior to "2017.7.0"
|
2017-08-08 10:22:20 -04:00
|
|
|
[ValidateSet("2","3")]
|
2022-05-18 09:49:12 -06:00
|
|
|
[string]$PythonVersion = "3",
|
2017-08-08 10:22:20 -04:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
2016-06-17 16:03:01 -06:00
|
|
|
[ValidateSet("true","false")]
|
2022-05-18 09:49:12 -06:00
|
|
|
[string]$RunService = "true",
|
2016-06-17 16:03:01 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
|
|
|
[string]$Minion = "not-specified",
|
2016-06-17 16:03:01 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
|
|
|
[string]$Master = "not-specified",
|
2016-06-17 16:03:01 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
|
|
|
[string]$RepoUrl= "https://repo.saltproject.io/windows",
|
2021-01-19 20:15:09 +00:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
2021-01-19 20:15:09 +00:00
|
|
|
[switch]$ConfigureOnly
|
2015-07-07 21:34:57 -06:00
|
|
|
)
|
|
|
|
|
2020-02-13 17:07:17 -07:00
|
|
|
# Powershell supports only TLS 1.0 by default. Add support for TLS 1.2
|
|
|
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
2019-04-12 13:56:06 -06:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2016-05-25 16:02:03 -07:00
|
|
|
# Script Functions
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2016-05-25 16:02:03 -07:00
|
|
|
function Get-IsAdministrator
|
|
|
|
{
|
|
|
|
$Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
|
|
|
$Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
|
|
|
|
$Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
|
|
}
|
|
|
|
|
|
|
|
function Get-IsUacEnabled
|
|
|
|
{
|
|
|
|
(Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).EnableLua -ne 0
|
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2016-05-25 16:02:03 -07:00
|
|
|
# Check for Elevated Privileges
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2022-05-18 09:49:12 -06:00
|
|
|
if (!(Get-IsAdministrator)) {
|
|
|
|
if (Get-IsUacEnabled) {
|
2016-05-25 16:02:03 -07:00
|
|
|
# We are not running "as Administrator" - so relaunch as administrator
|
|
|
|
# Create a new process object that starts PowerShell
|
|
|
|
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
|
|
|
|
|
|
|
|
# Specify the current script path and name as a parameter`
|
|
|
|
$parameters = ""
|
2021-11-16 13:34:40 -05:00
|
|
|
foreach ($boundParam in $PSBoundParameters.GetEnumerator())
|
|
|
|
{
|
|
|
|
$parameters = "$parameters -{0} '{1}'" -f $boundParam.Key, $boundParam.Value
|
|
|
|
}
|
2016-05-25 16:02:03 -07:00
|
|
|
$newProcess.Arguments = $myInvocation.MyCommand.Definition, $parameters
|
2021-11-16 13:52:38 -05:00
|
|
|
|
2016-05-25 16:02:03 -07:00
|
|
|
# Specify the current working directory
|
|
|
|
$newProcess.WorkingDirectory = "$script_path"
|
|
|
|
|
|
|
|
# Indicate that the process should be elevated
|
|
|
|
$newProcess.Verb = "runas";
|
|
|
|
|
|
|
|
# Start the new process
|
|
|
|
[System.Diagnostics.Process]::Start($newProcess);
|
|
|
|
|
|
|
|
# Exit from the current, unelevated, process
|
2022-05-18 09:49:12 -06:00
|
|
|
exit
|
2016-06-17 16:03:01 -06:00
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
else {
|
|
|
|
throw "You must be administrator to run this script"
|
2016-05-25 16:02:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
|
|
|
# Verify Parameters
|
|
|
|
#===============================================================================
|
2015-07-07 21:34:57 -06:00
|
|
|
Write-Verbose "Parameters passed in:"
|
|
|
|
Write-Verbose "version: $version"
|
|
|
|
Write-Verbose "runservice: $runservice"
|
|
|
|
Write-Verbose "master: $master"
|
|
|
|
Write-Verbose "minion: $minion"
|
2016-06-17 16:03:01 -06:00
|
|
|
Write-Verbose "repourl: $repourl"
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
if ($runservice.ToLower() -eq "true") {
|
2016-06-17 16:03:01 -06:00
|
|
|
Write-Verbose "Windows service will be set to run"
|
|
|
|
[bool]$runservice = $True
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
elseif ($runservice.ToLower() -eq "false") {
|
2016-06-17 16:03:01 -06:00
|
|
|
Write-Verbose "Windows service will be stopped and set to manual"
|
|
|
|
[bool]$runservice = $False
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
else {
|
2016-06-17 16:03:01 -06:00
|
|
|
# Param passed in wasn't clear so defaulting to true.
|
|
|
|
Write-Verbose "Windows service defaulting to run automatically"
|
|
|
|
[bool]$runservice = $True
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
|
|
|
# Ensure Directories are present, copy Vagrant Configs if found
|
|
|
|
#===============================================================================
|
2021-01-19 20:15:09 +00:00
|
|
|
|
|
|
|
$ConfiguredAnything = $False
|
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
$RootDir = "C:\salt"
|
2022-01-18 13:23:23 +00:00
|
|
|
$SaltRegKey = "HKLM:\SOFTWARE\Salt Project\Salt"
|
2022-05-18 09:49:12 -06:00
|
|
|
if (Test-Path -Path $SaltRegKey) {
|
|
|
|
if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) {
|
|
|
|
$RootDir = (Get-ItemProperty $SaltRegKey).root_dir
|
|
|
|
}
|
2022-01-18 13:23:23 +00:00
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
|
2022-01-18 13:23:23 +00:00
|
|
|
$ConfDir = "$RootDir\conf"
|
|
|
|
$PkiDir = "$ConfDir\pki\minion"
|
2022-05-18 09:49:12 -06:00
|
|
|
Write-Verbose "ConfDir: $ConfDir"
|
2022-01-18 13:23:23 +00:00
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
# Create C:\tmp\
|
2016-05-24 13:37:44 -06:00
|
|
|
New-Item C:\tmp\ -ItemType directory -Force | Out-Null
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
#===============================================================================
|
|
|
|
# Copy Vagrant Files to their proper location.
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
# Vagrant files will be placed in C:\tmp
|
2016-06-17 16:03:01 -06:00
|
|
|
# Check if minion keys have been uploaded, copy to correct location
|
2022-05-18 09:49:12 -06:00
|
|
|
if (Test-Path C:\tmp\minion.pem) {
|
2022-01-18 13:23:23 +00:00
|
|
|
New-Item $PkiDir -ItemType Directory -Force | Out-Null
|
|
|
|
Copy-Item -Path C:\tmp\minion.pem -Destination $PkiDir -Force | Out-Null
|
|
|
|
Copy-Item -Path C:\tmp\minion.pub -Destination $PkiDir -Force | Out-Null
|
2021-01-19 20:15:09 +00:00
|
|
|
$ConfiguredAnything = $True
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
|
|
|
|
2016-05-24 13:37:44 -06:00
|
|
|
# Check if minion config has been uploaded
|
|
|
|
# This should be done before the installer is run so that it can be updated with
|
|
|
|
# id: and master: settings when the installer runs
|
2022-05-18 09:49:12 -06:00
|
|
|
if (Test-Path C:\tmp\minion) {
|
2022-01-18 13:23:23 +00:00
|
|
|
New-Item $ConfDir -ItemType Directory -Force | Out-Null
|
|
|
|
Copy-Item -Path C:\tmp\minion -Destination $ConfDir -Force | Out-Null
|
2021-01-19 20:15:09 +00:00
|
|
|
$ConfiguredAnything = $True
|
|
|
|
}
|
|
|
|
|
2021-01-04 16:33:22 +00:00
|
|
|
# Check if grains config has been uploaded
|
2022-05-18 09:49:12 -06:00
|
|
|
if (Test-Path C:\tmp\grains) {
|
2022-01-18 13:23:23 +00:00
|
|
|
New-Item $ConfDir -ItemType Directory -Force | Out-Null
|
|
|
|
Copy-Item -Path C:\tmp\grains -Destination $ConfDir -Force | Out-Null
|
2021-01-04 16:33:22 +00:00
|
|
|
$ConfiguredAnything = $True
|
|
|
|
}
|
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
if ($ConfigureOnly -and !$ConfiguredAnything) {
|
2021-01-19 20:15:09 +00:00
|
|
|
Write-Output "No configuration or keys were copied over. No configuration was done!"
|
|
|
|
exit 0
|
2016-05-24 13:37:44 -06:00
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2015-07-07 21:34:57 -06:00
|
|
|
# Detect architecture
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2022-05-18 09:49:12 -06:00
|
|
|
if ([IntPtr]::Size -eq 4) {
|
2016-06-17 16:03:01 -06:00
|
|
|
$arch = "x86"
|
2022-05-18 09:49:12 -06:00
|
|
|
} else {
|
2016-06-17 16:03:01 -06:00
|
|
|
$arch = "AMD64"
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2019-11-25 13:00:06 -07:00
|
|
|
# Use version "Latest" if no version is passed
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
2022-05-18 09:49:12 -06:00
|
|
|
if ((!$version) -or ($version.ToLower() -eq 'latest')){
|
|
|
|
$versionSection = "Latest-Py$PythonVersion"
|
2019-11-25 13:28:52 -07:00
|
|
|
} else {
|
|
|
|
$versionSection = $version
|
|
|
|
$year = $version.Substring(0, 4)
|
2022-05-18 09:49:12 -06:00
|
|
|
if ([int]$year -ge 2017) {
|
|
|
|
if ($PythonVersion -eq "3") {
|
2019-11-25 13:28:52 -07:00
|
|
|
$versionSection = "$version-Py3"
|
2022-05-18 09:49:12 -06:00
|
|
|
} else {
|
2019-11-25 13:28:52 -07:00
|
|
|
$versionSection = "$version-Py2"
|
|
|
|
}
|
2017-08-08 10:22:20 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
if (!$ConfigureOnly) {
|
2021-01-19 20:15:09 +00:00
|
|
|
#===============================================================================
|
|
|
|
# Download minion setup file
|
|
|
|
#===============================================================================
|
|
|
|
$saltExe = "Salt-Minion-$versionSection-$arch-Setup.exe"
|
|
|
|
Write-Output "Downloading Salt minion installer $saltExe"
|
|
|
|
$webclient = New-Object System.Net.WebClient
|
|
|
|
$url = "$repourl/$saltExe"
|
|
|
|
$file = "C:\Windows\Temp\$saltExe"
|
|
|
|
$webclient.DownloadFile($url, $file)
|
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
# Set the parameters for the installer
|
|
|
|
#===============================================================================
|
|
|
|
# Unless specified, use the installer defaults
|
|
|
|
# - id: <hostname>
|
|
|
|
# - master: salt
|
|
|
|
# - Start the service
|
|
|
|
$parameters = ""
|
2022-05-18 09:49:12 -06:00
|
|
|
if($minion -ne "not-specified") {$parameters = "/minion-name=$minion"}
|
|
|
|
if($master -ne "not-specified") {$parameters = "$parameters /master=$master"}
|
|
|
|
if($runservice -eq $false) {$parameters = "$parameters /start-service=0"}
|
2021-01-19 20:15:09 +00:00
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
# Install minion silently
|
|
|
|
#===============================================================================
|
|
|
|
#Wait for process to exit before continuing.
|
|
|
|
Write-Output "Installing Salt minion"
|
|
|
|
Start-Process C:\Windows\Temp\$saltExe -ArgumentList "/S $parameters" -Wait -NoNewWindow -PassThru | Out-Null
|
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
# Configure the minion service
|
|
|
|
#===============================================================================
|
|
|
|
# Wait for salt-minion service to be registered before trying to start it
|
|
|
|
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
2022-05-18 09:49:12 -06:00
|
|
|
while (!$service) {
|
2021-01-19 20:15:09 +00:00
|
|
|
Start-Sleep -s 2
|
|
|
|
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
|
|
|
}
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2022-05-18 09:49:12 -06:00
|
|
|
if($runservice) {
|
2021-01-19 20:15:09 +00:00
|
|
|
# Start service
|
|
|
|
Write-Output "Starting the Salt minion service"
|
|
|
|
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
2015-07-07 21:34:57 -06:00
|
|
|
|
2021-01-19 20:15:09 +00:00
|
|
|
# Check if service is started, otherwise retry starting the
|
|
|
|
# service 4 times.
|
|
|
|
$try = 0
|
2022-05-18 09:49:12 -06:00
|
|
|
while (($service.Status -ne "Running") -and ($try -ne 4)) {
|
2021-01-19 20:15:09 +00:00
|
|
|
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
|
|
|
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
|
|
|
Start-Sleep -s 2
|
|
|
|
$try += 1
|
|
|
|
}
|
2016-06-17 16:03:01 -06:00
|
|
|
|
2021-01-19 20:15:09 +00:00
|
|
|
# If the salt-minion service is still not running, something probably
|
|
|
|
# went wrong and user intervention is required - report failure.
|
2022-05-18 09:49:12 -06:00
|
|
|
if ($service.Status -eq "Stopped") {
|
2021-01-19 20:15:09 +00:00
|
|
|
Write-Output -NoNewline "Failed to start salt minion"
|
|
|
|
exit 1
|
|
|
|
}
|
2016-06-17 16:03:01 -06:00
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
else {
|
2021-01-19 20:15:09 +00:00
|
|
|
Write-Output -NoNewline "Stopping salt minion and setting it to 'Manual'"
|
|
|
|
Set-Service "salt-minion" -StartupType "Manual"
|
|
|
|
Stop-Service "salt-minion"
|
2016-06-17 16:03:01 -06:00
|
|
|
}
|
2015-07-07 21:34:57 -06:00
|
|
|
}
|
|
|
|
|
2016-06-17 16:03:01 -06:00
|
|
|
#===============================================================================
|
|
|
|
# Script Complete
|
|
|
|
#===============================================================================
|
2022-05-18 09:49:12 -06:00
|
|
|
if ($ConfigureOnly) {
|
2021-01-19 20:15:09 +00:00
|
|
|
Write-Output "Salt minion successfully configured"
|
|
|
|
}
|
2022-05-18 09:49:12 -06:00
|
|
|
else {
|
2021-01-19 20:15:09 +00:00
|
|
|
Write-Output "Salt minion successfully installed"
|
|
|
|
}
|