Skip to content

Commit 7e4aaef

Browse files
author
Nicole Thomas
committed
Merge pull request #843 from rallytime/merge-stable
[stable] Merge develop into stable branch
2 parents 0b3decf + d032d49 commit 7e4aaef

4 files changed

Lines changed: 293 additions & 188 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 2016.05.10:
2+
* Removed libzmq4 and forking-deamon-patch for Opensuse13. (jtand) #840
3+
* Ubuntu 12.04 needs to be updated before installing packages. (jtand) #829
4+
* Always download and install *latest* `epel-release` package on RHEL systems. (vutny) #825
5+
* Fix Amazon Linux EOL check. (vutny) #818
6+
17
Version 2016.04.18:
28
* Add support for openSUSE Leap. Thanks Roman Inflianskas(rominf). #693
39
* Fix missing deps installation on Debian. Thanks Steve Groesz(wolfpackmars2). #699

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ with the bootstrap script:
506506

507507
.. code:: console
508508
509-
docker built -t local/salt-bootstrap .
509+
docker build -t local/salt-bootstrap .
510510
511511
Start your new container with Salt services up and running:
512512

bootstrap-salt.ps1

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
<#
22
.SYNOPSIS
33
A simple Powershell script to download and install a salt minion on windows.
4+
45
.DESCRIPTION
56
The script will download the official salt package from saltstack. It will install a specific
67
package version and accept parameters for the master and minion ids. Finally, it can stop and
78
set the windows service to "manual" for local testing.
9+
810
.EXAMPLE
911
./bootstrap-salt.ps1
1012
Runs without any parameters. Uses all the default values/settings.
13+
1114
.EXAMPLE
1215
./bootstrap-salt.ps1 -version 2015.4.1-3
1316
Specifies a particular version of the installer.
17+
1418
.EXAMPLE
1519
./bootstrap-salt.ps1 -runservice false
1620
Specifies the salt-minion service to stop and be set to manual.
1721
Useful for testing locally from the command line with the --local switch
22+
1823
.EXAMPLE
1924
./bootstrap-salt.ps1 -minion minion-box -master master-box
2025
Specifies the minion and master ids in the minion config.
2126
Defaults to the installer values of "minion" and "master".
27+
2228
.EXAMPLE
2329
./bootstrap-salt.ps1 -minion minion-box -master master-box -version 2015.5.2 -runservice false
2430
Specifies all the optional parameters in no particular order.
31+
2532
.PARAMETER version - Default version defined in this script.
2633
2734
.PARAMETER runservice - Boolean flag to stop the windows service and set to "manual".
@@ -47,7 +54,7 @@ Param(
4754
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
4855
# Doesn't support versions prior to "YYYY.M.R-B"
4956
[ValidatePattern('^(201[0-9]\.[0-9]\.[0-9](\-\d{1})?)$')]
50-
[string]$version = "2015.8.8-2",
57+
[string]$version = '',
5158

5259
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
5360
[ValidateSet("true","false")]
@@ -99,15 +106,33 @@ If ([IntPtr]::Size -eq 4) {
99106
$arch = "AMD64"
100107
}
101108

109+
# If version isn't supplied, use latest.
110+
if (!$version) {
111+
# Find latest version of Salt Minion
112+
$repo = Invoke-Restmethod 'http://repo.saltstack.com/windows/'
113+
$regex = "<\s*a\s*[^>]*?href\s*=\s*[`"']*([^`"'>]+)[^>]*?>"
114+
$returnMatches = new-object System.Collections.ArrayList
115+
$resultingMatches = [Regex]::Matches($repo, $regex, "IgnoreCase")
116+
foreach($match in $resultingMatches)
117+
{
118+
$cleanedMatch = $match.Groups[1].Value.Trim()
119+
[void] $returnMatches.Add($cleanedMatch)
120+
}
121+
if ($arch -eq 'x86') {$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*x86-Setup.exe"}}
122+
else {$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*AMD64-Setup.exe"}}
123+
124+
$version = $(($returnMatches | Sort-Object -Descending)[0]).Split(("n-","-A","-x"),([System.StringSplitOptions]::RemoveEmptyEntries))[1]
125+
}
126+
102127
# Download minion setup file
103-
Write-Host -NoNewline "Downloading Salt minion installer Salt-Minion-$version-$arch-Setup.exe"
128+
Write-Output -NoNewline "Downloading Salt minion installer Salt-Minion-$version-$arch-Setup.exe"
104129
$webclient = New-Object System.Net.WebClient
105130
$url = "https://repo.saltstack.com/windows/Salt-Minion-$version-$arch-Setup.exe"
106131
$file = "C:\tmp\salt.exe"
107132
$webclient.DownloadFile($url, $file)
108133

109134
# Install minion silently
110-
Write-Host -NoNewline "Installing Salt minion"
135+
Write-Output -NoNewline "Installing Salt minion"
111136
#Wait for process to exit before continuing.
112137
C:\tmp\salt.exe /S /minion-name=$minion /master=$master | Out-Null
113138

@@ -141,14 +166,14 @@ If($runservice) {
141166
# If the salt-minion service is still not running, something probably
142167
# went wrong and user intervention is required - report failure.
143168
If ($service.Status -eq "Stopped") {
144-
Write-Host -NoNewline "Failed to start salt minion"
169+
Write-Output -NoNewline "Failed to start salt minion"
145170
exit 1
146171
}
147172
}
148173
Else {
149-
Write-Host -NoNewline "Stopping salt minion and setting it to 'Manual'"
174+
Write-Output -NoNewline "Stopping salt minion and setting it to 'Manual'"
150175
Set-Service "salt-minion" -startupType "Manual"
151176
Stop-Service "salt-minion"
152177
}
153178

154-
Write-Host -NoNewline "Salt minion successfully installed"
179+
Write-Output "Salt minion successfully installed"

0 commit comments

Comments
 (0)