26
26
# ======================================================================================================================
27
27
set -o nounset # Treat unset variables as an error
28
28
29
- __ScriptVersion=" 2024.11.26 "
29
+ __ScriptVersion=" 2024.11.27 "
30
30
__ScriptName=" bootstrap-salt.sh"
31
31
32
32
__ScriptFullName=" $0 "
@@ -2742,44 +2742,6 @@ __install_salt_from_repo() {
2742
2742
2743
2743
echodebug " Installed pip version: $( ${_pip_cmd} --version) "
2744
2744
2745
- CHECK_PIP_VERSION_SCRIPT=$( cat << EOM
2746
- import sys
2747
- try:
2748
- import pip
2749
- installed_pip_version=tuple([int(part.strip()) for part in pip.__version__.split('.') if part.isdigit()])
2750
- desired_pip_version=($( echo ${_MINIMUM_PIP_VERSION} | sed ' s/\./, /g' ) )
2751
- if installed_pip_version < desired_pip_version:
2752
- print('Desired pip version {!r} > Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version))))
2753
- sys.exit(1)
2754
- print('Desired pip version {!r} < Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version))))
2755
- sys.exit(0)
2756
- except ImportError:
2757
- print('Failed to import pip')
2758
- sys.exit(1)
2759
- EOM
2760
- )
2761
- if ! ${_py_exe} -c " $CHECK_PIP_VERSION_SCRIPT " ; then
2762
- # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip"
2763
- echodebug " Running '${_pip_cmd} install ${_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION} '"
2764
- ${_pip_cmd} install ${_PIP_INSTALL_ARGS} -v " pip>=${_MINIMUM_PIP_VERSION} "
2765
- sleep 1
2766
- echodebug " PATH: ${PATH} "
2767
- _pip_cmd=" pip${_py_version} "
2768
- if ! __check_command_exists " ${_pip_cmd} " ; then
2769
- echodebug " The pip binary '${_pip_cmd} ' was not found in PATH"
2770
- _pip_cmd=" pip$( echo " ${_py_version} " | cut -c -1) "
2771
- if ! __check_command_exists " ${_pip_cmd} " ; then
2772
- echodebug " The pip binary '${_pip_cmd} ' was not found in PATH"
2773
- _pip_cmd=" pip"
2774
- if ! __check_command_exists " ${_pip_cmd} " ; then
2775
- echoerror " Unable to find a pip binary"
2776
- return 1
2777
- fi
2778
- fi
2779
- fi
2780
- echodebug " Installed pip version: $( ${_pip_cmd} --version) "
2781
- fi
2782
-
2783
2745
_setuptools_dep=" setuptools>=${_MINIMUM_SETUPTOOLS_VERSION} ,<${_MAXIMUM_SETUPTOOLS_VERSION} "
2784
2746
if [ " $_PY_MAJOR_VERSION " -ne 3 ]; then
2785
2747
echoerror " Python version is no longer supported, only Python 3"
@@ -2802,7 +2764,6 @@ EOM
2802
2764
2803
2765
mkdir -p /tmp/git/deps
2804
2766
echodebug " Created directory /tmp/git/deps"
2805
- echodebug " Installing Salt dependencies for Salt version $( python3 salt/version.py) "
2806
2767
2807
2768
if [ ${DISTRO_NAME_L} = " ubuntu" ] && [ " $DISTRO_MAJOR_VERSION " -eq 22 ]; then
2808
2769
echodebug " Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', upgrading from default pip works"
@@ -2815,20 +2776,23 @@ EOM
2815
2776
fi
2816
2777
fi
2817
2778
2818
- echoinfo " Downloading Salt Dependencies from PyPi"
2819
- echodebug " Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'"
2820
- ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .
2779
+ rm -f /tmp/git/deps/*
2780
+
2781
+ echodebug " Installing Salt requirements from PyPi, ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} -r requirements/static/ci/py${_py_version} /linux.txt"
2782
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} -r " requirements/static/ci/py${_py_version} /linux.txt"
2821
2783
# shellcheck disable=SC2181
2822
2784
if [ $? -ne 0 ]; then
2823
- echo " Failed to download salt dependencies "
2785
+ echo " Failed to install salt requirements for the version of Python ${_py_version} "
2824
2786
return 1
2825
2787
fi
2826
2788
2827
-
2828
- echoinfo " Installing Downloaded Salt Dependencies"
2829
- echodebug " Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} /tmp/git/deps/*'"
2830
- ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1
2831
- rm -f /tmp/git/deps/*
2789
+ if [ " ${OS_NAME} " = " Linux" ]; then
2790
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.functools==4.1.0" || return 1
2791
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.text==4.0.0" || return 1
2792
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.collections==5.1.0" || return 1
2793
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.context==6.0.1" || return 1
2794
+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.classes==3.4.0" || return 1
2795
+ fi
2832
2796
2833
2797
echoinfo " Building Salt Python Wheel"
2834
2798
if [ " $_ECHO_DEBUG " -eq $BS_TRUE ]; then
@@ -5139,79 +5103,79 @@ install_oracle_linux_check_services() {
5139
5103
5140
5104
# ######################################################################################################################
5141
5105
#
5142
- # RockyLinux Install Functions
5106
+ # ALmaLinux Install Functions
5143
5107
#
5144
- install_rockylinux_stable_deps () {
5108
+ install_almalinux_stable_deps () {
5145
5109
install_centos_stable_deps || return 1
5146
5110
return 0
5147
5111
}
5148
5112
5149
- install_rockylinux_git_deps () {
5113
+ install_almalinux_git_deps () {
5150
5114
install_centos_git_deps || return 1
5151
5115
return 0
5152
5116
}
5153
5117
5154
- install_rockylinux_onedir_deps () {
5118
+ install_almalinux_onedir_deps () {
5155
5119
install_centos_onedir_deps || return 1
5156
5120
return 0
5157
5121
}
5158
5122
5159
- install_rockylinux_testing_deps () {
5123
+ install_almalinux_testing_deps () {
5160
5124
install_centos_testing_deps || return 1
5161
5125
return 0
5162
5126
}
5163
5127
5164
- install_rockylinux_stable () {
5128
+ install_almalinux_stable () {
5165
5129
install_centos_stable || return 1
5166
5130
return 0
5167
5131
}
5168
5132
5169
- install_rockylinux_git () {
5133
+ install_almalinux_git () {
5170
5134
install_centos_git || return 1
5171
5135
return 0
5172
5136
}
5173
5137
5174
- install_rockylinux_onedir () {
5138
+ install_almalinux_onedir () {
5175
5139
install_centos_onedir || return 1
5176
5140
return 0
5177
5141
}
5178
5142
5179
- install_rockylinux_testing () {
5143
+ install_almalinux_testing () {
5180
5144
install_centos_testing || return 1
5181
5145
return 0
5182
5146
}
5183
5147
5184
- install_rockylinux_stable_post () {
5148
+ install_almalinux_stable_post () {
5185
5149
install_centos_stable_post || return 1
5186
5150
return 0
5187
5151
}
5188
5152
5189
- install_rockylinux_git_post () {
5153
+ install_almalinux_git_post () {
5190
5154
install_centos_git_post || return 1
5191
5155
return 0
5192
5156
}
5193
5157
5194
- install_rockylinux_onedir_post () {
5158
+ install_almalinux_onedir_post () {
5195
5159
install_centos_onedir_post || return 1
5196
5160
return 0
5197
5161
}
5198
5162
5199
- install_rockylinux_testing_post () {
5163
+ install_almalinux_testing_post () {
5200
5164
install_centos_testing_post || return 1
5201
5165
return 0
5202
5166
}
5203
5167
5204
- install_rockylinux_restart_daemons () {
5168
+ install_almalinux_restart_daemons () {
5205
5169
install_centos_restart_daemons || return 1
5206
5170
return 0
5207
5171
}
5208
5172
5209
- install_rockylinux_check_services () {
5173
+ install_almalinux_check_services () {
5210
5174
install_centos_check_services || return 1
5211
5175
return 0
5212
5176
}
5213
5177
#
5214
- # Ended RockyLinux Install Functions
5178
+ # Ended AlmaLinux Install Functions
5215
5179
#
5216
5180
# ######################################################################################################################
5217
5181
@@ -6373,7 +6337,7 @@ install_photon_deps() {
6373
6337
__PACKAGES=" ${__PACKAGES} libyaml procps-ng python${PY_PKG_VER} -crypto python${PY_PKG_VER} -jinja2"
6374
6338
__PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -msgpack python${PY_PKG_VER} -requests python${PY_PKG_VER} -zmq"
6375
6339
__PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -pip python${PY_PKG_VER} -m2crypto python${PY_PKG_VER} -pyyaml"
6376
- __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -systemd"
6340
+ __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -systemd sudo shadow "
6377
6341
6378
6342
if [ " ${_EXTRA_PACKAGES} " != " " ]; then
6379
6343
echoinfo " Installing the following extra packages as requested: ${_EXTRA_PACKAGES} "
@@ -6423,6 +6387,14 @@ install_photon_git_deps() {
6423
6387
__PACKAGES=" ${__PACKAGES} git"
6424
6388
fi
6425
6389
6390
+ if ! __check_command_exists sudo; then
6391
+ __PACKAGES=" ${__PACKAGES} sudo"
6392
+ fi
6393
+
6394
+ if ! __check_command_exists usermod; then
6395
+ __PACKAGES=" ${__PACKAGES} shadow"
6396
+ fi
6397
+
6426
6398
if [ -n " ${__PACKAGES} " ]; then
6427
6399
# shellcheck disable=SC2086
6428
6400
__tdnf_install_noinput ${__PACKAGES} || return 1
@@ -6471,6 +6443,8 @@ install_photon_git() {
6471
6443
return 1
6472
6444
fi
6473
6445
6446
+ install_photon_git_deps
6447
+
6474
6448
if [ -f " ${_SALT_GIT_CHECKOUT_DIR} /salt/syspaths.py" ]; then
6475
6449
${_PYEXE} setup.py --salt-config-dir=" $_SALT_ETC_DIR " --salt-cache-dir=" ${_SALT_CACHE_DIR} " ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
6476
6450
else
@@ -6579,7 +6553,7 @@ install_photon_onedir_deps() {
6579
6553
__install_saltstack_photon_onedir_repository || return 1
6580
6554
fi
6581
6555
6582
- __PACKAGES=" procps-ng"
6556
+ __PACKAGES=" procps-ng sudo shadow "
6583
6557
6584
6558
# shellcheck disable=SC2086
6585
6559
__tdnf_install_noinput ${__PACKAGES} || return 1
0 commit comments