23
23
# ======================================================================================================================
24
24
set -o nounset # Treat unset variables as an error
25
25
26
- __ScriptVersion=" 2023.04.26 "
26
+ __ScriptVersion=" 2023.06.28 "
27
27
__ScriptName=" bootstrap-salt.sh"
28
28
29
29
__ScriptFullName=" $0 "
@@ -224,7 +224,6 @@ _KEEP_TEMP_FILES=${BS_KEEP_TEMP_FILES:-$BS_FALSE}
224
224
_TEMP_CONFIG_DIR=" null"
225
225
_SALTSTACK_REPO_URL=" https://github.com/saltstack/salt.git"
226
226
_SALT_REPO_URL=${_SALTSTACK_REPO_URL}
227
- _DOWNSTREAM_PKG_REPO=$BS_FALSE
228
227
_TEMP_KEYS_DIR=" null"
229
228
_SLEEP=" ${__DEFAULT_SLEEP} "
230
229
_INSTALL_MASTER=$BS_FALSE
@@ -311,21 +310,31 @@ __usage() {
311
310
- onedir_rc Install latest onedir RC release.
312
311
- onedir_rc [version] Install a specific version. Only supported for
313
312
onedir RC packages available at repo.saltproject.io
313
+ - old-stable Install latest old stable release.
314
+ - old-stable [branch] Install latest version on a branch. Only supported
315
+ for packages available at repo.saltproject.io
316
+ - old-stable [version] Install a specific version. Only supported for
317
+ packages available at repo.saltproject.io
318
+ To pin a 3xxx minor version, specify it as 3xxx.0
314
319
315
320
Examples:
316
321
- ${__ScriptName}
317
322
- ${__ScriptName} stable
318
- - ${__ScriptName} stable 2017.7
319
- - ${__ScriptName} stable 2017.7.2
323
+ - ${__ScriptName} stable 3006
324
+ - ${__ScriptName} stable 3006.1
320
325
- ${__ScriptName} testing
321
326
- ${__ScriptName} git
322
327
- ${__ScriptName} git 2017.7
323
328
- ${__ScriptName} git v2017.7.2
324
329
- ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358
325
330
- ${__ScriptName} onedir
326
- - ${__ScriptName} onedir 3005
331
+ - ${__ScriptName} onedir 3006
327
332
- ${__ScriptName} onedir_rc
328
- - ${__ScriptName} onedir_rc 3005
333
+ - ${__ScriptName} onedir_rc 3006
334
+ - ${__ScriptName} old-stable
335
+ - ${__ScriptName} old-stable 3005
336
+ - ${__ScriptName} old-stable 3005.1
337
+
329
338
330
339
Options:
331
340
-a Pip install all Python pkg dependencies for Salt. Requires -V to install
@@ -401,9 +410,6 @@ __usage() {
401
410
-v Display script version
402
411
-V Install Salt into virtualenv
403
412
(only available for Ubuntu based distributions)
404
- -w Install packages from downstream package repository rather than
405
- upstream, saltstack package repository. This is currently only
406
- implemented for SUSE.
407
413
-x Changes the Python version used to install Salt.
408
414
For CentOS 6 git installations python2.7 is supported.
409
415
Fedora git installation, CentOS 7, Ubuntu 18.04 support python3.
420
426
} # ---------- end of function __usage ----------
421
427
422
428
423
- while getopts ' :hvnDc:g:Gyx:wk :s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt
429
+ while getopts ' :hvnDc:g:Gyx:k :s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt
424
430
do
425
431
case " ${opt} " in
426
432
436
442
echowarn " No need to provide this option anymore, now it is a default behavior."
437
443
;;
438
444
439
- w ) _DOWNSTREAM_PKG_REPO=$BS_TRUE ;;
440
445
k ) _TEMP_KEYS_DIR=" $OPTARG " ;;
441
446
s ) _SLEEP=$OPTARG ;;
442
447
M ) _INSTALL_MASTER=$BS_TRUE ;;
@@ -595,7 +600,7 @@ if [ "$#" -gt 0 ];then
595
600
fi
596
601
597
602
# Check installation type
598
- if [ " $( echo " $ITYPE " | grep -E ' (stable|testing|git|onedir|onedir_rc)' ) " = " " ]; then
603
+ if [ " $( echo " $ITYPE " | grep -E ' (stable|testing|git|onedir|onedir_rc|old-stable )' ) " = " " ]; then
599
604
echoerror " Installation type \" $ITYPE \" is not known..."
600
605
exit 1
601
606
fi
@@ -619,28 +624,41 @@ elif [ "$ITYPE" = "stable" ]; then
619
624
_ONEDIR_REV=" latest"
620
625
ITYPE=" onedir"
621
626
else
622
- if [ " $( echo " $1 " | grep -E ' ^(nightly|latest|3006)$' ) " != " " ]; then
627
+ if [ " $( echo " $1 " | grep -E ' ^(nightly|latest|3005| 3006)$' ) " != " " ]; then
623
628
ONEDIR_REV=" $1 "
624
629
_ONEDIR_REV=" $1 "
625
630
ITYPE=" onedir"
626
631
shift
627
- elif [ " $( echo " $1 " | grep -E ' ^(3003|3004|3005)$' ) " != " " ]; then
628
- STABLE_REV=" $1 "
629
- shift
630
- elif [ " $( echo " $1 " | grep -E ' ^([3-9][0-5]{2}[6-9](\.[0-9]*)?)' ) " != " " ]; then
632
+ elif [ " $( echo " $1 " | grep -E ' ^([3-9][0-5]{2}[5-9](\.[0-9]*)?)' ) " != " " ]; then
631
633
ONEDIR_REV=" minor/$1 "
632
634
_ONEDIR_REV=" $1 "
633
635
ITYPE=" onedir"
634
636
shift
637
+ else
638
+ echo " Unknown stable version: $1 (valid: 3005, 3006, latest)"
639
+ exit 1
640
+ fi
641
+ fi
642
+
643
+ # If doing old-stable install, check if version specified
644
+ elif [ " $ITYPE " = " old-stable" ]; then
645
+ if [ " $# " -eq 0 ]; then
646
+ ITYPE=" stable"
647
+ else
648
+ if [ " $( echo " $1 " | grep -E ' ^(3003|3004|3005)$' ) " != " " ]; then
649
+ STABLE_REV=" $1 "
650
+ ITYPE=" stable"
651
+ shift
635
652
elif [ " $( echo " $1 " | grep -E ' ^([3-9][0-5]{3}(\.[0-9]*)?)$' ) " != " " ]; then
636
653
# Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix
654
+ ITYPE=" stable"
637
655
STABLE_REV=$( echo " $1 " | sed -E ' s/^([3-9][0-9]{3})\.0$/\1/' )
638
656
if [ " $( uname) " != " Darwin" ]; then
639
657
STABLE_REV=" archive/$STABLE_REV "
640
658
fi
641
659
shift
642
660
else
643
- echo " Unknown stable version: $1 (valid: 3003, 3004, 3005, 3006, latest )"
661
+ echo " Unknown old stable version: $1 (valid: 3003, 3004, 3005)"
644
662
exit 1
645
663
fi
646
664
fi
@@ -4573,6 +4591,12 @@ install_fedora_onedir_post() {
4573
4591
# CentOS Install Functions
4574
4592
#
4575
4593
__install_saltstack_rhel_repository () {
4594
+ if [ " ${DISTRO_MAJOR_VERSION} " -ge 9 ]; then
4595
+ echoerror " Old stable repository unavailable on RH variants greater than or equal to 9"
4596
+ echoerror " Use the stable install type."
4597
+ exit 1
4598
+ fi
4599
+
4576
4600
if [ " $ITYPE " = " stable" ]; then
4577
4601
repo_rev=" $STABLE_REV "
4578
4602
else
@@ -4827,7 +4851,6 @@ install_centos_git_deps() {
4827
4851
# Set ONEDIR_REV to STABLE_REV in case we
4828
4852
# end up calling install_centos_onedir_deps
4829
4853
ONEDIR_REV=${STABLE_REV}
4830
- install_centos_stable_deps || \
4831
4854
install_centos_onedir_deps || \
4832
4855
return 1
4833
4856
@@ -7698,13 +7721,8 @@ __set_suse_pkg_repo() {
7698
7721
DISTRO_REPO=" SLE_${DISTRO_MAJOR_VERSION} _SP${SUSE_PATCHLEVEL} "
7699
7722
fi
7700
7723
7701
- if [ " $_DOWNSTREAM_PKG_REPO " -eq $BS_TRUE ]; then
7702
- suse_pkg_url_base=" https://download.opensuse.org/repositories/systemsmanagement:/saltstack"
7703
- suse_pkg_url_path=" ${DISTRO_REPO} /systemsmanagement:saltstack.repo"
7704
- else
7705
- suse_pkg_url_base=" ${HTTP_VAL} ://repo.saltproject.io/opensuse"
7706
- suse_pkg_url_path=" ${DISTRO_REPO} /systemsmanagement:saltstack:products.repo"
7707
- fi
7724
+ suse_pkg_url_base=" https://download.opensuse.org/repositories/systemsmanagement:/saltstack"
7725
+ suse_pkg_url_path=" ${DISTRO_REPO} /systemsmanagement:saltstack.repo"
7708
7726
SUSE_PKG_URL=" $suse_pkg_url_base /$suse_pkg_url_path "
7709
7727
}
7710
7728
@@ -7724,7 +7742,7 @@ __version_lte() {
7724
7742
zypper --non-interactive install --auto-agree-with-licenses python || return 1
7725
7743
fi
7726
7744
7727
- if [ " $( python -c ' import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1<=V2' " $1 " " $2 " ) " = " True" ]; then
7745
+ if [ " $( ${_PY_EXE} -c ' import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print( V1<=V2) ' " $1 " " $2 " ) " = " True" ]; then
7728
7746
__ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE}
7729
7747
else
7730
7748
__ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE}
@@ -8130,6 +8148,11 @@ install_opensuse_15_git() {
8130
8148
return 0
8131
8149
}
8132
8150
8151
+ install_opensuse_15_onedir_deps () {
8152
+ __opensuse_prep_install || return 1
8153
+ return 0
8154
+ }
8155
+
8133
8156
#
8134
8157
# End of openSUSE Leap 15
8135
8158
#
@@ -8159,6 +8182,13 @@ install_suse_15_git_deps() {
8159
8182
return 0
8160
8183
}
8161
8184
8185
+ install_suse_15_onedir_deps () {
8186
+ __opensuse_prep_install || return 1
8187
+ install_opensuse_15_onedir_deps || return 1
8188
+
8189
+ return 0
8190
+ }
8191
+
8162
8192
install_suse_15_stable () {
8163
8193
install_opensuse_stable || return 1
8164
8194
return 0
@@ -8169,6 +8199,11 @@ install_suse_15_git() {
8169
8199
return 0
8170
8200
}
8171
8201
8202
+ install_suse_15_onedir () {
8203
+ install_opensuse_stable || return 1
8204
+ return 0
8205
+ }
8206
+
8172
8207
install_suse_15_stable_post () {
8173
8208
install_opensuse_stable_post || return 1
8174
8209
return 0
@@ -8179,6 +8214,11 @@ install_suse_15_git_post() {
8179
8214
return 0
8180
8215
}
8181
8216
8217
+ install_suse_15_onedir_post () {
8218
+ install_opensuse_stable_post || return 1
8219
+ return 0
8220
+ }
8221
+
8182
8222
install_suse_15_restart_daemons () {
8183
8223
install_opensuse_restart_daemons || return 1
8184
8224
return 0
@@ -8261,6 +8301,11 @@ install_suse_12_git_deps() {
8261
8301
return 0
8262
8302
}
8263
8303
8304
+ install_suse_12_onedir_deps () {
8305
+ install_suse_12_stable_deps || return 1
8306
+ return 0
8307
+ }
8308
+
8264
8309
install_suse_12_stable () {
8265
8310
install_opensuse_stable || return 1
8266
8311
return 0
@@ -8271,6 +8316,11 @@ install_suse_12_git() {
8271
8316
return 0
8272
8317
}
8273
8318
8319
+ install_suse_12_onedir () {
8320
+ install_opensuse_stable || return 1
8321
+ return 0
8322
+ }
8323
+
8274
8324
install_suse_12_stable_post () {
8275
8325
install_opensuse_stable_post || return 1
8276
8326
return 0
@@ -8281,6 +8331,11 @@ install_suse_12_git_post() {
8281
8331
return 0
8282
8332
}
8283
8333
8334
+ install_suse_12_onedir_post () {
8335
+ install_opensuse_stable_post || return 1
8336
+ return 0
8337
+ }
8338
+
8284
8339
install_suse_12_restart_daemons () {
8285
8340
install_opensuse_restart_daemons || return 1
8286
8341
return 0
@@ -8357,6 +8412,11 @@ install_suse_11_git_deps() {
8357
8412
return 0
8358
8413
}
8359
8414
8415
+ install_suse_11_onedir_deps () {
8416
+ install_suse_11_stable_deps || return 1
8417
+ return 0
8418
+ }
8419
+
8360
8420
install_suse_11_stable () {
8361
8421
install_opensuse_stable || return 1
8362
8422
return 0
@@ -8367,6 +8427,11 @@ install_suse_11_git() {
8367
8427
return 0
8368
8428
}
8369
8429
8430
+ install_suse_11_onedir () {
8431
+ install_opensuse_stable || return 1
8432
+ return 0
8433
+ }
8434
+
8370
8435
install_suse_11_stable_post () {
8371
8436
install_opensuse_stable_post || return 1
8372
8437
return 0
@@ -8377,6 +8442,11 @@ install_suse_11_git_post() {
8377
8442
return 0
8378
8443
}
8379
8444
8445
+ install_suse_11_onedir_post () {
8446
+ install_opensuse_stable_post || return 1
8447
+ return 0
8448
+ }
8449
+
8380
8450
install_suse_11_restart_daemons () {
8381
8451
install_opensuse_restart_daemons || return 1
8382
8452
return 0
0 commit comments