mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 01:30:21 +00:00
Merge remote-tracking branch 'upstream/develop' into stable for release
This commit is contained in:
commit
1370165d86
5 changed files with 259 additions and 35 deletions
|
@ -13,11 +13,13 @@ Angelo Gründler plueschopath angelo.gruendler@w1r3.net
|
|||
Ari Aosved devaos ari.aosved@gmail.com
|
||||
Boris Feld Lothiraldan
|
||||
Brad Thurber bradthurber
|
||||
Bret Fisher BretFisher bret@fishbrains.com
|
||||
bruce-one bruce-one
|
||||
C. R. Oldham cro cr@saltstack.com
|
||||
Cam camereonsparr
|
||||
Chris Rebert cvrebert chris.rebert@hulu.com
|
||||
Christer Edwards cedwards
|
||||
denmat denmat
|
||||
Dag Viggo Lokøen dagvl dag.viggo@lokoen.org
|
||||
Dan Mick dmick dan.mick@inktank.com
|
||||
David J. Felix DavidJFelix
|
||||
|
@ -41,6 +43,7 @@ Jeff Strunk jstrunk
|
|||
Juan A. Moyano wincus wincus.public@gmail.com
|
||||
Karl Grzeszczak karlgrz
|
||||
Kenneth Wilke KennethWilke
|
||||
lomeroe lomeroe
|
||||
Liu Xiaohui oreh herolxh@gmail.com
|
||||
Mark Lee malept
|
||||
markgaylard markgaylard
|
||||
|
@ -73,5 +76,6 @@ Tony Narlock tony
|
|||
Valentin Bud valentinbud valentin@databus.pro
|
||||
Vladimir Kozhukalov kozhukalov
|
||||
Whit Morriss whitmo whit@nocoast.us
|
||||
Wolodja Wentland babilen w@babilen5.org
|
||||
Wout wfhg
|
||||
========================== ===================== ============================
|
||||
|
|
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Version 2015.07.17:
|
||||
* Make sure setuptools is installed before using it. #598.
|
||||
* `systemd` is only fully supported from 15.04 onwards. #602
|
||||
* Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606
|
||||
* Fix python-jinja2 repo move on RHEL6. Thanks lomeroe. #621
|
||||
* Allow skipping services. Thanks denmat. #455
|
||||
* Fix missing Debian init script. #607 saltstack/salt#25270 and saltstack/salt#25456
|
||||
* Fix SmartOS etc path. Thanks Bret Fisher. #624
|
||||
* Fix possible unbound variable in Gentoo. #625
|
||||
* Properly detect the git binary in SmartOS. #611
|
||||
|
||||
Version 2015.05.07:
|
||||
* Lower required requests version dependency. Use system requests package where possible.
|
||||
* Allow Ubuntu alternate ppas. Thanks Peter Tripp(notpeter). #563
|
||||
|
|
|
@ -61,6 +61,9 @@ Install a specific version from git using ``wget``:
|
|||
wget -O install_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -P git v0.16.4
|
||||
|
||||
On the above example we added `-P` which will allow PIP packages to be installed if required but
|
||||
it's no a necessary flag for git based bootstraps.
|
||||
|
||||
|
||||
If you already have python installed, ``python 2.6``, then it's as easy as:
|
||||
|
||||
|
|
154
bootstrap-salt.ps1
Normal file
154
bootstrap-salt.ps1
Normal file
|
@ -0,0 +1,154 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
A simple Powershell script to download and install a salt minion on windows.
|
||||
.DESCRIPTION
|
||||
The script will download the official salt package from saltstack. It will install a specific
|
||||
package version and accept parameters for the master and minion ids. Finally, it can stop and
|
||||
set the windows service to "manual" for local testing.
|
||||
.EXAMPLE
|
||||
./bootstrap-salt.ps1
|
||||
Runs without any parameters. Uses all the default values/settings.
|
||||
.EXAMPLE
|
||||
./bootstrap-salt.ps1 -version 2015.4.1-3
|
||||
Specifies a particular version of the installer.
|
||||
.EXAMPLE
|
||||
./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
|
||||
.EXAMPLE
|
||||
./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 "minion" and "master".
|
||||
.EXAMPLE
|
||||
./bootstrap-salt.ps1 -minion minion-box -master master-box -version 2015.5.2 -runservice false
|
||||
Specifies all the optional parameters in no particular order.
|
||||
.PARAMETER version - Default version defined in this script.
|
||||
|
||||
.PARAMETER runservice - Boolean flag to stop the windows service and set to "manual".
|
||||
Installer starts it by default.
|
||||
|
||||
.PARAMETER minion - Name of the minion being installed on this host.
|
||||
Installer defaults to "minion".
|
||||
|
||||
.PARAMETER master - Name or IP of the master server the minion. Installer defaults to "master".
|
||||
|
||||
.NOTES
|
||||
All of the parameters are optional. The default should be the latest version. The architecture
|
||||
is dynamically determined by the script.
|
||||
|
||||
.LINK
|
||||
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
|
||||
SaltStack Download Location - http://docs.saltstack.com/downloads/
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||
# Doesn't support versions prior to "YYYY.M.R-B"
|
||||
[ValidatePattern('^(201[0-9]\.[0-9]\.[0-9](\-\d{1})?)$')]
|
||||
[string]$version = "2015.5.2",
|
||||
|
||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||
[ValidateSet("true","false")]
|
||||
[string]$runservice = "true",
|
||||
|
||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||
[string]$minion = "salt-minion",
|
||||
|
||||
[Parameter(Mandatory=$false,ValueFromPipeline=$true)]
|
||||
[string]$master = "master"
|
||||
)
|
||||
|
||||
Write-Verbose "Parameters passed in:"
|
||||
Write-Verbose "version: $version"
|
||||
Write-Verbose "runservice: $runservice"
|
||||
Write-Verbose "master: $master"
|
||||
Write-Verbose "minion: $minion"
|
||||
|
||||
If ($runservice.ToLower() -eq "true"){
|
||||
Write-Verbose "Windows service will be set to run"
|
||||
[bool]$runservice = $True
|
||||
}
|
||||
ElseIf ($runservice.ToLower() -eq "false"){
|
||||
Write-Verbose "Windows service will be stopped and set to manual"
|
||||
[bool]$runservice = $False
|
||||
}
|
||||
Else {
|
||||
# Param passed in wasn't clear so defaulting to true.
|
||||
Write-Verbose "Windows service defaulting to run automatically"
|
||||
[bool]$runservice = $True
|
||||
}
|
||||
|
||||
# Create C:\tmp\ - if Vagrant doesn't upload keys and/or config it might not exist
|
||||
New-Item C:\tmp\ -ItemType directory -force | out-null
|
||||
|
||||
# Copy minion keys & config to correct location
|
||||
New-Item C:\salt\conf\pki\minion\ -ItemType directory -force | out-null
|
||||
|
||||
# Check if minion keys have been uploaded
|
||||
If (Test-Path C:\tmp\minion.pem) {
|
||||
cp C:\tmp\minion.pem C:\salt\conf\pki\minion\
|
||||
cp C:\tmp\minion.pub C:\salt\conf\pki\minion\
|
||||
}
|
||||
|
||||
# Detect architecture
|
||||
If ([IntPtr]::Size -eq 4) {
|
||||
$arch = "x86"
|
||||
} Else {
|
||||
$arch = "AMD64"
|
||||
}
|
||||
|
||||
# Download minion setup file
|
||||
Write-Host "Downloading Salt minion installer Salt-Minion-$version-$arch-Setup.exe"
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$url = "https://docs.saltstack.com/downloads/Salt-Minion-$version-$arch-Setup.exe"
|
||||
$file = "C:\tmp\salt.exe"
|
||||
$webclient.DownloadFile($url, $file)
|
||||
|
||||
# Install minion silently
|
||||
Write-Host "Installing Salt minion"
|
||||
#Wait for process to exit before continuing.
|
||||
C:\tmp\salt.exe /S /minion-name=$minion /master=$master | Out-Null
|
||||
|
||||
|
||||
# Check if minion config has been uploaded
|
||||
If (Test-Path C:\tmp\minion) {
|
||||
cp C:\tmp\minion C:\salt\conf\
|
||||
}
|
||||
|
||||
# Wait for salt-minion service to be registered before trying to start it
|
||||
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
||||
While (!$service) {
|
||||
Start-Sleep -s 2
|
||||
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
If($runservice) {
|
||||
# Start service
|
||||
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
||||
|
||||
# Check if service is started, otherwise retry starting the
|
||||
# service 4 times.
|
||||
$try = 0
|
||||
While (($service.Status -ne "Running") -and ($try -ne 4)) {
|
||||
Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue
|
||||
$service = Get-Service salt-minion -ErrorAction SilentlyContinue
|
||||
Start-Sleep -s 2
|
||||
$try += 1
|
||||
}
|
||||
|
||||
# If the salt-minion service is still not running, something probably
|
||||
# went wrong and user intervention is required - report failure.
|
||||
If ($service.Status -eq "Stopped") {
|
||||
Write-Host "Failed to start salt minion"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Else {
|
||||
Write-Host "Stopping salt minion and setting it to 'Manual'"
|
||||
Set-Service "salt-minion" -startupType "Manual"
|
||||
Stop-Service "salt-minion"
|
||||
}
|
||||
|
||||
Write-Host "Salt minion successfully installed"
|
|
@ -17,7 +17,7 @@
|
|||
# CREATED: 10/15/2012 09:49:37 PM WEST
|
||||
#======================================================================================================================
|
||||
set -o nounset # Treat unset variables as an error
|
||||
__ScriptVersion="2015.05.07"
|
||||
__ScriptVersion="2015.07.17"
|
||||
__ScriptName="bootstrap-salt.sh"
|
||||
|
||||
#======================================================================================================================
|
||||
|
@ -211,6 +211,7 @@ _LIBCLOUD_MIN_VERSION="0.14.0"
|
|||
_PY_REQUESTS_MIN_VERSION="2.0"
|
||||
_EXTRA_PACKAGES=""
|
||||
_HTTP_PROXY=""
|
||||
_DISABLE_SALT_CHECKS=$BS_FALSE
|
||||
__SALT_GIT_CHECKOUT_DIR=${BS_SALT_GIT_CHECKOUT_DIR:-/tmp/git/salt}
|
||||
|
||||
|
||||
|
@ -277,6 +278,9 @@ usage() {
|
|||
-L Install the Apache Libcloud package if possible(required for salt-cloud)
|
||||
-p Extra-package to install while installing salt dependencies. One package
|
||||
per -p flag. You're responsible for providing the proper package name.
|
||||
-d Disable check_service functions. Setting this flag disables the
|
||||
'install_<distro>_check_services' checks. You can also do this by
|
||||
touching /tmp/disable_salt_checks on the target host. Defaults \${BS_FALSE}
|
||||
-H Use the specified http proxy for the installation
|
||||
-Z Enable external software source for newer ZeroMQ(Only available for RHEL/CentOS/Fedora based distributions)
|
||||
|
||||
|
@ -284,7 +288,7 @@ EOT
|
|||
} # ---------- end of function usage ----------
|
||||
|
||||
|
||||
while getopts ":hvnDc:Gg:k:MSNXCPFUKIA:i:Lp:H:Z" opt
|
||||
while getopts ":hvnDc:Gg:k:MSNXCPFUKIA:i:Lp:dH:Z" opt
|
||||
do
|
||||
case "${opt}" in
|
||||
|
||||
|
@ -333,6 +337,7 @@ do
|
|||
i ) _SALT_MINION_ID=$OPTARG ;;
|
||||
L ) _INSTALL_CLOUD=$BS_TRUE ;;
|
||||
p ) _EXTRA_PACKAGES="$_EXTRA_PACKAGES $OPTARG" ;;
|
||||
d ) _DISABLE_SALT_CHECKS=$BS_TRUE ;;
|
||||
H ) _HTTP_PROXY="$OPTARG" ;;
|
||||
Z) _ENABLE_EXTERNAL_ZMQ_REPOS=$BS_TRUE ;;
|
||||
|
||||
|
@ -467,6 +472,12 @@ if [ "${CALLER}x" = "${0}x" ]; then
|
|||
CALLER="PIPED THROUGH"
|
||||
fi
|
||||
|
||||
# Work around for 'Docker + salt-bootstrap failure' https://github.com/saltstack/salt-bootstrap/issues/394
|
||||
if [ ${_DISABLE_SALT_CHECKS} -eq 0 ]; then
|
||||
[ -f /tmp/disable_salt_checks ] && _DISABLE_SALT_CHECKS=$BS_TRUE && \
|
||||
echowarn "Found file: /tmp/disable_salt_checks, setting \$_DISABLE_SALT_CHECKS=true"
|
||||
fi
|
||||
|
||||
echoinfo "${CALLER} ${0} -- Version ${__ScriptVersion}"
|
||||
#echowarn "Running the unstable version of ${__ScriptName}"
|
||||
|
||||
|
@ -1147,7 +1158,7 @@ fi
|
|||
if ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$ITYPE" = "daily" ]); then
|
||||
echoerror "${DISTRO_NAME} does not have daily packages support"
|
||||
exit 1
|
||||
elif ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$STABLE_REV" != "latest" ]); then
|
||||
elif ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]); then
|
||||
echoerror "${DISTRO_NAME} does not have major version pegged packages support"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -1899,7 +1910,8 @@ install_ubuntu_daily() {
|
|||
|
||||
install_ubuntu_git() {
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || return 1
|
||||
python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
python setup.py --salt-config-dir="$_SALT_ETC_DIR" install --install-layout=deb || return 1
|
||||
else
|
||||
python setup.py install --install-layout=deb || return 1
|
||||
fi
|
||||
|
@ -1915,7 +1927,7 @@ install_ubuntu_git_post() {
|
|||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
|
||||
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
|
@ -1954,8 +1966,8 @@ install_ubuntu_git_post() {
|
|||
install_ubuntu_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
# Ensure upstart configs are loaded
|
||||
if [ -f /bin/systemctl ]; then
|
||||
# Ensure upstart configs / systemd units are loaded
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
systemctl daemon-reload
|
||||
elif [ -f /sbin/initctl ]; then
|
||||
/sbin/initctl reload-configuration
|
||||
|
@ -1970,7 +1982,7 @@ install_ubuntu_restart_daemons() {
|
|||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
echodebug "There's systemd support while checking salt-$fname"
|
||||
systemctl stop salt-$fname > /dev/null 2>&1
|
||||
systemctl start salt-$fname.service
|
||||
|
@ -2015,7 +2027,7 @@ install_ubuntu_check_services() {
|
|||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
__check_services_systemd salt-$fname || return 1
|
||||
elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then
|
||||
__check_services_upstart salt-$fname || return 1
|
||||
|
@ -2137,7 +2149,7 @@ _eof
|
|||
# We NEED to install the unstable dpkg or mime-support WILL fail to install
|
||||
__apt_get_install_noinput -t unstable dpkg liblzma5 python mime-support || return 1
|
||||
__apt_get_install_noinput -t unstable libzmq3 libzmq3-dev || return 1
|
||||
__apt_get_install_noinput build-essential python-dev python-pip || return 1
|
||||
__apt_get_install_noinput build-essential python-dev python-pip python-setuptools || return 1
|
||||
|
||||
# Saltstack's Unstable Debian repository
|
||||
if [ "$(grep -R 'debian.saltstack.com' /etc/apt)" = "" ]; then
|
||||
|
@ -2179,6 +2191,14 @@ _eof
|
|||
|
||||
__apt_get_install_noinput python-zmq || return 1
|
||||
|
||||
if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then
|
||||
# Building pyzmq from source to build it against libzmq3.
|
||||
# Should override current installation
|
||||
# Using easy_install instead of pip because at least on Debian 6,
|
||||
# there's no default virtualenv active.
|
||||
easy_install -U pyzmq || return 1
|
||||
fi
|
||||
|
||||
if [ "${_EXTRA_PACKAGES}" != "" ]; then
|
||||
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
|
||||
# shellcheck disable=SC2086
|
||||
|
@ -2210,7 +2230,7 @@ install_debian_7_deps() {
|
|||
|
||||
# Debian Backports
|
||||
if [ "$(grep -R 'wheezy-backports' /etc/apt | grep -v "^#")" = "" ]; then
|
||||
echo "deb http://http.debian.net/debian wheezy-backports main" >> \
|
||||
echo "deb http://httpredir.debian.org/debian wheezy-backports main" >> \
|
||||
/etc/apt/sources.list.d/backports.list
|
||||
fi
|
||||
|
||||
|
@ -2278,7 +2298,7 @@ install_debian_8_deps() {
|
|||
|
||||
# Debian Backports
|
||||
if [ "$(grep -R 'jessie-backports' /etc/apt | grep -v "^#")" = "" ]; then
|
||||
echo "deb http://http.debian.net/debian jessie-backports main" >> \
|
||||
echo "deb http://httpredir.debian.org/debian jessie-backports main" >> \
|
||||
/etc/apt/sources.list.d/backports.list
|
||||
fi
|
||||
|
||||
|
@ -2380,7 +2400,7 @@ install_debian_6_git_deps() {
|
|||
install_debian_6_deps || return 1
|
||||
if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then
|
||||
__PACKAGES="build-essential lsb-release python python-dev python-pkg-resources python-crypto"
|
||||
__PACKAGES="${__PACKAGES} python-m2crypto python-yaml msgpack-python python-pip"
|
||||
__PACKAGES="${__PACKAGES} python-m2crypto python-yaml msgpack-python python-pip python-setuptools"
|
||||
|
||||
if [ "$(which git)" = "" ]; then
|
||||
__PACKAGES="${__PACKAGES} git"
|
||||
|
@ -2435,14 +2455,6 @@ __install_debian_stable() {
|
|||
# shellcheck disable=SC2086
|
||||
__apt_get_install_noinput ${__PACKAGES} || return 1
|
||||
|
||||
if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then
|
||||
# Building pyzmq from source to build it against libzmq3.
|
||||
# Should override current installation
|
||||
# Using easy_install instead of pip because at least on Debian 6,
|
||||
# there's no default virtualenv active.
|
||||
easy_install -U pyzmq || return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -2465,7 +2477,8 @@ install_debian_8_stable() {
|
|||
install_debian_git() {
|
||||
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || return 1
|
||||
python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
python setup.py --salt-config-dir="$_SALT_ETC_DIR" install --install-layout=deb || return 1
|
||||
else
|
||||
python setup.py install --install-layout=deb || return 1
|
||||
fi
|
||||
|
@ -2509,6 +2522,8 @@ install_debian_git_post() {
|
|||
elif [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" ]; then
|
||||
copyfile "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" "/etc/init.d/salt-$fname"
|
||||
else
|
||||
__fetch_url "/etc/init.d/salt-$fname" "http://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init"
|
||||
fi
|
||||
if [ ! -f "/etc/init.d/salt-$fname" ]; then
|
||||
echowarn "The init script for salt-$fname was not found, skipping it..."
|
||||
|
@ -2665,7 +2680,8 @@ install_fedora_git_deps() {
|
|||
|
||||
install_fedora_git() {
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1
|
||||
python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1
|
||||
else
|
||||
python setup.py install || return 1
|
||||
fi
|
||||
|
@ -2989,7 +3005,8 @@ install_centos_git() {
|
|||
_PYEXE=python2
|
||||
fi
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
$_PYEXE setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1
|
||||
$_PYEXE setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
$_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1
|
||||
else
|
||||
$_PYEXE setup.py install || return 1
|
||||
fi
|
||||
|
@ -3137,11 +3154,17 @@ install_centos_check_services() {
|
|||
__test_rhel_optionals_packages() {
|
||||
__install_epel_repository || return 1
|
||||
|
||||
# Make sure yum-utils is installed
|
||||
yum list installed yum-utils > /dev/null 2>&1 || yum -y install yum-utils --enablerepo=${_EPEL_REPO} || return 1
|
||||
|
||||
if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then
|
||||
yum-config-manager --enable \*server-optional || return 1
|
||||
fi
|
||||
|
||||
if [ "$DISTRO_MAJOR_VERSION" -ge 6 ]; then
|
||||
#python-jinja2 is in repo server-releases-optional in EC2/RHEL6
|
||||
yum-config-manager --enable rhui-\*-server-releases-optional || return 1
|
||||
|
||||
# Let's enable package installation testing, kind of, --dry-run
|
||||
echoinfo "Testing if packages usually on the optionals repository are available:"
|
||||
__YUM_CONF_DIR="$(mktemp -d)"
|
||||
|
@ -3746,7 +3769,8 @@ install_arch_linux_stable() {
|
|||
|
||||
install_arch_linux_git() {
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
python2 setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1
|
||||
python2 setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1
|
||||
else
|
||||
python2 setup.py install || return 1
|
||||
fi
|
||||
|
@ -4060,6 +4084,17 @@ install_freebsd_git() {
|
|||
--salt-base-master-roots-dir="${_SALT_ETC_DIR}/salt-master" \
|
||||
--salt-logs-dir=/var/log/salt \
|
||||
--salt-pidfile-dir=/var/run \
|
||||
|| /usr/local/bin/python2 setup.py \
|
||||
--salt-root-dir=/usr/local \
|
||||
--salt-config-dir="${_SALT_ETC_DIR}" \
|
||||
--salt-cache-dir=/var/cache/salt \
|
||||
--salt-sock-dir=/var/run/salt \
|
||||
--salt-srv-root-dir=/srv \
|
||||
--salt-base-file-roots-dir="${_SALT_ETC_DIR}/states" \
|
||||
--salt-base-pillar-roots-dir="${_SALT_ETC_DIR}/pillar" \
|
||||
--salt-base-master-roots-dir="${_SALT_ETC_DIR}/salt-master" \
|
||||
--salt-logs-dir=/var/log/salt \
|
||||
--salt-pidfile-dir=/var/run install \
|
||||
|| return 1
|
||||
fi
|
||||
|
||||
|
@ -4137,6 +4172,11 @@ install_freebsd_restart_daemons() {
|
|||
install_smartos_deps() {
|
||||
pkgin -y install zeromq py27-m2crypto py27-crypto py27-msgpack py27-yaml py27-jinja2 py27-zmq py27-requests || return 1
|
||||
|
||||
# Set _SALT_ETC_DIR to SmartOS default if they didn't specify
|
||||
_SALT_ETC_DIR=${BS_SALT_ETC_DIR:-/opt/local/etc/salt}
|
||||
# We also need to redefine the PKI directory
|
||||
_PKI_DIR=${_SALT_ETC_DIR}/pki
|
||||
|
||||
# Let's trigger config_salt()
|
||||
if [ "$_TEMP_CONFIG_DIR" = "null" ]; then
|
||||
# Let's set the configuration directory to /tmp
|
||||
|
@ -4156,6 +4196,10 @@ install_smartos_deps() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
|
||||
pkgin -y install py27-apache-libcloud || return 1
|
||||
fi
|
||||
|
||||
if [ "${_EXTRA_PACKAGES}" != "" ]; then
|
||||
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
|
||||
# shellcheck disable=SC2086
|
||||
|
@ -4169,8 +4213,9 @@ install_smartos_deps() {
|
|||
install_smartos_git_deps() {
|
||||
install_smartos_deps || return 1
|
||||
|
||||
if [ "$(which git)" = "" ]; then
|
||||
pkgin -y install scmgit || return 1
|
||||
which git > /dev/null 2>&1
|
||||
if [ $? -eq 1 ]; then
|
||||
pkgin -y install git || return 1
|
||||
fi
|
||||
|
||||
if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then
|
||||
|
@ -4202,7 +4247,9 @@ install_smartos_stable() {
|
|||
|
||||
install_smartos_git() {
|
||||
# Use setuptools in order to also install dependencies
|
||||
USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install || return 1
|
||||
# lets force our config path on the setup for now, since salt/syspaths.py only got fixed in 2015.5.0
|
||||
USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \
|
||||
USE_SETUPTOOLS=1 /opt/local/bin/python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -4742,7 +4789,7 @@ __gentoo_config_protection() {
|
|||
# this point, manually merge the changes using etc-update/dispatch-conf/
|
||||
# cfg-update and then restart the bootstrapping script, so instead we allow
|
||||
# at this point to modify certain config files directly
|
||||
export CONFIG_PROTECT_MASK="$CONFIG_PROTECT_MASK /etc/portage/package.keywords /etc/portage/package.unmask /etc/portage/package.use /etc/portage/package.license"
|
||||
export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK:-} /etc/portage/package.keywords /etc/portage/package.unmask /etc/portage/package.use /etc/portage/package.license"
|
||||
}
|
||||
|
||||
__gentoo_pre_dep() {
|
||||
|
@ -5166,12 +5213,17 @@ done
|
|||
echodebug "DAEMONS_RUNNING_FUNC=${DAEMONS_RUNNING_FUNC}"
|
||||
|
||||
# Let's get the check services function
|
||||
CHECK_SERVICES_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_check_services"
|
||||
if [ ${_DISABLE_SALT_CHECKS} -eq $BS_FALSE ]; then
|
||||
CHECK_SERVICES_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_${ITYPE}_check_services"
|
||||
CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_check_services"
|
||||
else
|
||||
CHECK_SERVICES_FUNC_NAMES=False
|
||||
echowarn "DISABLE_SALT_CHECKS set, not setting \$CHECK_SERVICES_FUNC_NAMES"
|
||||
fi
|
||||
|
||||
CHECK_SERVICES_FUNC="null"
|
||||
for FUNC_NAME in $(__strip_duplicates "$CHECK_SERVICES_FUNC_NAMES"); do
|
||||
|
|
Loading…
Add table
Reference in a new issue