mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
A few fixes
Actually default to Py2 like the docs say Allow and actual version to be passed Handle older versions Write-Output when starting service
This commit is contained in:
parent
15968cbdf6
commit
495464f6dd
1 changed files with 12 additions and 13 deletions
|
@ -83,7 +83,7 @@ Param(
|
||||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||||
# Doesn't support versions prior to "2017.7.0"
|
# Doesn't support versions prior to "2017.7.0"
|
||||||
[ValidateSet("2","3")]
|
[ValidateSet("2","3")]
|
||||||
[string]$pythonVersion = "",
|
[string]$pythonVersion = "2",
|
||||||
|
|
||||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||||
[ValidateSet("true","false")]
|
[ValidateSet("true","false")]
|
||||||
|
@ -214,18 +214,16 @@ Else {
|
||||||
# Use version "Latest" if no version is passed
|
# Use version "Latest" if no version is passed
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
If (!$version) {
|
If (!$version) {
|
||||||
$version = "Latest"
|
$versionSection = "Latest-Py$pythonVersion"
|
||||||
}
|
} else {
|
||||||
|
$versionSection = $version
|
||||||
$versionSection = $version
|
$year = $version.Substring(0, 4)
|
||||||
|
If ([int]$year -ge 2017) {
|
||||||
$year = $version.Substring(0, 4)
|
If ($pythonVersion -eq "3") {
|
||||||
If ([int]$year -ge 2017) {
|
$versionSection = "$version-Py3"
|
||||||
If ($pythonVersion -eq "3") {
|
} Else {
|
||||||
$versionSection = "$version-Py3"
|
$versionSection = "$version-Py2"
|
||||||
}
|
}
|
||||||
Else {
|
|
||||||
$versionSection = "$version-Py2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,6 +268,7 @@ While (!$service) {
|
||||||
|
|
||||||
If($runservice) {
|
If($runservice) {
|
||||||
# Start service
|
# Start service
|
||||||
|
Write-Output "Starting the Salt minion service"
|
||||||
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# Check if service is started, otherwise retry starting the
|
# Check if service is started, otherwise retry starting the
|
||||||
|
|
Loading…
Add table
Reference in a new issue