From 4987f08ad82dfb014745fb54648529575829fb62 Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Wed, 3 Apr 2024 15:19:13 +0000 Subject: [PATCH 01/80] Update README.rst with 2024.04.03 release sha256sum --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index f597622..2424286 100644 --- a/README.rst +++ b/README.rst @@ -32,6 +32,7 @@ sum** of the downloaded ``bootstrap-salt.sh`` file. The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: +- 2024.04.03: ``450ba5cde4af8d6cb5c56c66791f87b918bcda70ccdfb10abf3cc294143c8073`` - 2024.01.04: ``cebcbc67895e238d1cf0024922a7fe5c772b9aaba346490c8fa6193bb0d993d4`` - 2023.11.16: ``3757ed82161113fed4c711fd7332e922265eeeb54e6e4f657a08ea82d57cc3a2`` - 2023.11.07: ``91f8a3bfb8b14476f7793c7f20cec7bfc638c10c073786f9a8904a858a929784`` From e55bccd52eb0e337c98c2bc3872108f9786f042c Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Thu, 11 Apr 2024 10:56:44 -0600 Subject: [PATCH 02/80] Add script version to powershell script --- .github/workflows/scripts/cut-release.py | 17 +++++++++++++++++ bootstrap-salt.ps1 | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/cut-release.py b/.github/workflows/scripts/cut-release.py index 3b6eabf..96b76c2 100644 --- a/.github/workflows/scripts/cut-release.py +++ b/.github/workflows/scripts/cut-release.py @@ -188,6 +188,7 @@ def main(): + changelog_file.read_text() ) + # Update Script Version for the bash script bootstrap_script_path = REPO_ROOT / "bootstrap-salt.sh" print( f"* Updating {bootstrap_script_path.relative_to(REPO_ROOT)} ...", @@ -201,6 +202,22 @@ def main(): bootstrap_script_path.read_text(), ) ) + + # Update the Script Version for the powershell script + bootstrap_script_path = REPO_ROOT / "bootstrap-salt.ps1" + print( + f"* Updating {bootstrap_script_path.relative_to(REPO_ROOT)} ...", + file=sys.stderr, + flush=True, + ) + bootstrap_script_path.write_text( + re.sub( + r'\$__ScriptVersion = "(.*)"', + f'$__ScriptVersion = "{options.release_tag.lstrip("v")}"', + bootstrap_script_path.read_text(), + ) + ) + parser.exit(status=0, message="CHANGELOG.md and bootstrap-salt.sh updated\n") diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 6481ae6..451c0c0 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -94,7 +94,12 @@ param( [Parameter(Mandatory=$false)] [Alias("h")] # Displays help for this script. - [Switch] $Help + [Switch] $Help, + + [Parameter(Mandatory=$false)] + [Alias("e")] + # Displays the Version for this script. + [Switch] $ScriptVersion ) # We'll check for help first because it really has no requirements @@ -105,6 +110,15 @@ if ($help) { exit 0 } +$__ScriptVersion = "2024.04.03" +$ScriptName = $myInvocation.MyCommand.Name + +# We'll check for the Version next, because it also has no requirements +if ($ScriptVersion) { + Write-Host $__ScriptVersion + exit 0 +} + #=============================================================================== # Script Preferences #=============================================================================== @@ -303,6 +317,8 @@ if ( [Uri]($RepoUrl).AbsoluteUri -eq $defaultUrl ) { #=============================================================================== # Verify Parameters #=============================================================================== +Write-Verbose "Running Script: $ScriptName" +Write-Verbose "Script Version: $__ScriptVersion" Write-Verbose "Parameters passed in:" Write-Verbose "version: $Version" Write-Verbose "runservice: $RunService" From ac23048cd621ae62eb15860ca04c41300cd5873e Mon Sep 17 00:00:00 2001 From: John Hubbard Date: Wed, 24 Apr 2024 10:52:13 -0600 Subject: [PATCH 03/80] Add support for mint-21 Mint 21 is an Ubuntu 22.04 derivative so add it to the list. --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index d06d144..85f3e7c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1456,6 +1456,7 @@ __ubuntu_derivatives_translation() { linuxmint_18_ubuntu_base="16.04" linuxmint_19_ubuntu_base="18.04" linuxmint_20_ubuntu_base="20.04" + linuxmint_21_ubuntu_base="22.04" linaro_12_ubuntu_base="12.04" elementary_os_02_ubuntu_base="12.04" neon_16_ubuntu_base="16.04" From a43d1395209b64303ecf4c2028a44a4c67268ea5 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 2 Feb 2024 15:32:40 -0700 Subject: [PATCH 04/80] Added support for Amazon 2023 and cleaned up with shellcheck --- bootstrap-salt.sh | 1864 +++++++++++++++++++++++++-------------------- 1 file changed, 1034 insertions(+), 830 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 85f3e7c..1362dbb 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3,6 +3,7 @@ # WARNING: Changes to this file in the salt repo will be overwritten! # Please submit pull requests against the salt-bootstrap repo: # https://github.com/saltstack/salt-bootstrap +# shellcheck disable=SC2317 #====================================================================================================================== # vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en cc=120 @@ -132,7 +133,7 @@ __check_pip_allowed() { _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" fi - if [ "$_PIP_ALLOWED" -eq $BS_FALSE ]; then + if [ "$_PIP_ALLOWED" -eq "$BS_FALSE" ]; then echoerror "$_PIP_ALLOWED_ERROR_MSG" __usage exit 1 @@ -534,7 +535,7 @@ __exit_cleanup() { EXIT_CODE=$? if [ "$ITYPE" = "git" ] && [ -d "${_SALT_GIT_CHECKOUT_DIR}" ]; then - if [ $_KEEP_TEMP_FILES -eq $BS_FALSE ]; then + if [ "$_KEEP_TEMP_FILES" -eq "$BS_FALSE" ]; then # Clean up the checked out repository echodebug "Cleaning up the Salt Temporary Git Repository" # shellcheck disable=SC2164 @@ -563,7 +564,7 @@ __exit_cleanup() { # shellcheck disable=SC2009 TEE_PID=$(ps ax | grep tee | grep "$LOGFILE" | awk '{print $1}') - [ "$TEE_PID" = "" ] && exit $EXIT_CODE + [ "$TEE_PID" = "" ] && exit "$EXIT_CODE" echodebug "Killing logging pipe tee's with pid(s): $TEE_PID" @@ -572,7 +573,7 @@ __exit_cleanup() { __trap_errors() { echoinfo "Errors Trapped: $EXIT_CODE" # Exit with the "original" exit code, not the trapped code - exit $EXIT_CODE + exit "$EXIT_CODE" } trap "__trap_errors" INT ABRT QUIT TERM @@ -580,7 +581,7 @@ __exit_cleanup() { kill -s TERM "$TEE_PID" # In case the 127 errno is not triggered, exit with the "original" exit code - exit $EXIT_CODE + exit "$EXIT_CODE" } trap "__exit_cleanup" EXIT INT @@ -837,7 +838,7 @@ fi # -a and -V only work from git if [ "$ITYPE" != "git" ]; then - if [ $_PIP_ALL -eq $BS_TRUE ]; then + if [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then echoerror "Pip installing all python packages with -a is only possible when installing Salt via git" exit 1 fi @@ -852,14 +853,14 @@ if [ "$_CUSTOM_REPO_URL" != "null" ]; then _REPO_URL="$_CUSTOM_REPO_URL" # Check for -r since -R is being passed. Set -r with a warning. - if [ "$_DISABLE_REPOS" -eq $BS_FALSE ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then echowarn "Detected -R option. No other repositories will be configured when -R is used. Setting -r option to True." - _DISABLE_REPOS=$BS_TRUE + _DISABLE_REPOS="$BS_TRUE" fi fi # Check the _DISABLE_SSL value and set HTTP or HTTPS. -if [ "$_DISABLE_SSL" -eq $BS_TRUE ]; then +if [ "$_DISABLE_SSL" -eq "$BS_TRUE" ]; then HTTP_VAL="http" else HTTP_VAL="https" @@ -1180,7 +1181,7 @@ __gather_linux_system_info() { # We already have the distribution name and version return fi - # shellcheck disable=SC2035,SC2086 + # shellcheck disable=SC2035,SC2086,SC2269 for rsource in $(__sort_release_files "$( cd /etc && /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \ sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ @@ -1295,7 +1296,7 @@ __install_python() { __PACKAGES="$_PY_PKG_VER" - if [ ${_DISABLE_REPOS} -eq ${BS_FALSE} ]; then + if [ "${_DISABLE_REPOS}" -eq "${BS_FALSE}" ]; then echoinfo "Attempting to install a repo to help provide a separate python package" echoinfo "$DISTRO_NAME_L" case "$DISTRO_NAME_L" in @@ -1995,7 +1996,7 @@ if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$_VIRTUALENV_DIR" != "null" ]; then fi # Only Ubuntu has support for pip installing all packages -if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ $_PIP_ALL -eq $BS_TRUE ]; then +if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then echoerror "${DISTRO_NAME} does not have -a support" exit 1 fi @@ -2080,7 +2081,7 @@ __wait_for_apt(){ APT_RETURN=$? # Make sure we're not waiting on a lock - while [ $APT_RETURN -ne 0 ] && grep -q '^E: Could not get lock' "$APT_ERR"; do + while [ "$APT_RETURN" -ne 0 ] && grep -q '^E: Could not get lock' "$APT_ERR"; do echoinfo "Aware of the lock. Patiently waiting $WAIT_TIMEOUT more seconds..." sleep 1 WAIT_TIMEOUT=$((WAIT_TIMEOUT - 1)) @@ -2095,7 +2096,7 @@ __wait_for_apt(){ fi done - return $APT_RETURN + return "$APT_RETURN" } #--- FUNCTION ------------------------------------------------------------------------------------------------------- @@ -2133,7 +2134,7 @@ __temp_gpg_pub() { tempfile="/tmp/salt-gpg-$$.pub" fi - echo $tempfile + echo "$tempfile" } # ----------- end of function __temp_gpg_pub ----------- @@ -2368,11 +2369,11 @@ __copyfile() { # The destination file does not exist, copy echodebug "Copying $sfile to $dfile" cp "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -eq $BS_TRUE ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then # The destination exist and we're overwriting echodebug "Overwriting $dfile with $sfile" cp -f "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -ne $BS_TRUE ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then echodebug "Not overwriting $dfile with $sfile" fi return 0 @@ -2398,7 +2399,7 @@ __movefile() { exit 1 fi - if [ $_KEEP_TEMP_FILES -eq $BS_TRUE ]; then + if [ "$_KEEP_TEMP_FILES" -eq "$BS_TRUE" ]; then # We're being told not to move files, instead copy them so we can keep # them around echodebug "Since BS_KEEP_TEMP_FILES=1 we're copying files instead of moving them" @@ -2424,11 +2425,11 @@ __movefile() { # The destination file does not exist, move echodebug "Moving $sfile to $dfile" mv "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -eq $BS_TRUE ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then # The destination exist and we're overwriting echodebug "Overriding $dfile with $sfile" mv -f "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -ne $BS_TRUE ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then echodebug "Not overriding $dfile with $sfile" fi @@ -2474,11 +2475,11 @@ __linkfile() { # The destination file does not exist, create link echodebug "Creating $linkname symlink pointing to $sfile" ln -s "$sfile" "$linkname" || return 1 - elif [ -e "$linkname" ] && [ "$overwrite" -eq $BS_TRUE ]; then + elif [ -e "$linkname" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then # The destination exist and we're overwriting echodebug "Overwriting $linkname symlink to point on $sfile" ln -sf "$sfile" "$linkname" || return 1 - elif [ -e "$linkname" ] && [ "$overwrite" -ne $BS_TRUE ]; then + elif [ -e "$linkname" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then echodebug "Not overwriting $linkname symlink to point on $sfile" fi done @@ -2522,7 +2523,7 @@ __overwriteconfig() { fi # Convert json string to a yaml string and write it to config file. Output is dumped into tempfile. - "$good_python" -c "import json; import yaml; jsn=json.loads('$json'); yml=yaml.safe_dump(jsn, line_break='\\n', default_flow_style=False); config_file=open('$target', 'w'); config_file.write(yml); config_file.close();" 2>$tempfile + "$good_python" -c "import json; import yaml; jsn=json.loads('$json'); yml=yaml.safe_dump(jsn, line_break='\\n', default_flow_style=False); config_file=open('$target', 'w'); config_file.write(yml); config_file.close();" 2>"$tempfile" # No python errors output to the tempfile if [ ! -s "$tempfile" ]; then @@ -2707,7 +2708,7 @@ __check_services_openrc() { __create_virtualenv() { if [ ! -d "$_VIRTUALENV_DIR" ]; then echoinfo "Creating virtualenv ${_VIRTUALENV_DIR}" - if [ $_PIP_ALL -eq $BS_TRUE ]; then + if [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then virtualenv --no-site-packages "${_VIRTUALENV_DIR}" || return 1 else virtualenv --system-site-packages "${_VIRTUALENV_DIR}" || return 1 @@ -2814,7 +2815,7 @@ __install_pip_deps() { fi __PIP_PACKAGES='' - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # shellcheck disable=SC2089 __PIP_PACKAGES="${__PIP_PACKAGES} 'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'" fi @@ -2862,7 +2863,7 @@ import sys try: import pip installed_pip_version=tuple([int(part.strip()) for part in pip.__version__.split('.') if part.isdigit()]) - desired_pip_version=($(echo ${_MINIMUM_PIP_VERSION} | sed 's/\./, /g' )) + desired_pip_version=($(echo "${_MINIMUM_PIP_VERSION}" | sed 's/\./, /g' )) if installed_pip_version < desired_pip_version: print('Desired pip version {!r} > Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version)))) sys.exit(1) @@ -2877,10 +2878,10 @@ EOM # Upgrade pip to at least 1.2 which is when we can start using "python -m pip" if [ "${_py_version}" = "3.5" ]; then echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION},<21.0'" - ${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} -v "pip>=${_MINIMUM_PIP_VERSION},<21.0" + ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION},<21.0" else echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION}'" - ${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} -v "pip>=${_MINIMUM_PIP_VERSION}" + ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" fi sleep 1 echodebug "PATH: ${PATH}" @@ -2907,7 +2908,7 @@ EOM fi echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" - ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" + ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" echoinfo "Installing salt using ${_py_exe}" cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -2915,21 +2916,21 @@ EOM mkdir /tmp/git/deps echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" - ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) + ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" - ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 + ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 rm -f /tmp/git/deps/* echoinfo "Building Salt Python Wheel" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then SETUP_PY_INSTALL_ARGS="-v" fi echodebug "Running '${_py_exe} setup.py --salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS} bdist_wheel'" - ${_py_exe} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} bdist_wheel || return 1 + ${_py_exe} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" bdist_wheel || return 1 mv dist/salt*.whl /tmp/git/deps/ || return 1 cd "${__SALT_GIT_CHECKOUT_PARENT_DIR}" || return 1 @@ -2938,7 +2939,7 @@ EOM ${_pip_cmd} uninstall --yes salt 2>/dev/null || true echodebug "Running '${_pip_cmd} install --no-deps --force-reinstall ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'" ${_pip_cmd} install --no-deps --force-reinstall \ - ${_POST_NEON_PIP_INSTALL_ARGS} \ + "${_POST_NEON_PIP_INSTALL_ARGS}" \ --global-option="--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" \ /tmp/git/deps/salt*.whl || return 1 @@ -2964,12 +2965,14 @@ EOM } # ---------- end of function __install_salt_from_repo_post_neon ---------- -if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then +if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + # shellcheck disable=SC2268 if [ "x${_PY_MAJOR_VERSION}" = "x" ]; then # Default to python 2 for pre Neon installs _PY_MAJOR_VERSION=2 fi else + # shellcheck disable=SC2268 if [ "x${_PY_MAJOR_VERSION}" = "x" ]; then # Default to python 3 for post Neon install _PY_MAJOR_VERSION=3 @@ -3167,7 +3170,7 @@ __install_saltstack_ubuntu_onedir_repository() { } install_ubuntu_deps() { - if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then # Install add-apt-repository if ! __check_command_exists add-apt-repository; then __apt_get_install_noinput software-properties-common || return 1 @@ -3230,7 +3233,7 @@ install_ubuntu_stable_deps() { _SLEEP=10 fi - if [ $_START_DAEMONS -eq $BS_FALSE ]; then + if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3239,8 +3242,8 @@ install_ubuntu_stable_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then + if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3267,7 +3270,7 @@ install_ubuntu_git_deps() { __apt_get_install_noinput git-core || return 1 fi - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __apt_get_install_noinput ca-certificates fi @@ -3279,12 +3282,12 @@ install_ubuntu_git_deps() { PY_PKG_VER="" fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __PACKAGES="" # See how we are installing packages - if [ "${_PIP_ALL}" -eq $BS_TRUE ]; then + if [ "${_PIP_ALL}" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python-dev swig libssl-dev libzmq3 libzmq3-dev" if ! __check_command_exists pip; then @@ -3312,7 +3315,7 @@ install_ubuntu_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python-concurrent.futures" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # Install python-libcloud if asked to __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" fi @@ -3346,7 +3349,7 @@ install_ubuntu_onedir_deps() { _SLEEP=10 fi - if [ $_START_DAEMONS -eq $BS_FALSE ]; then + if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3355,8 +3358,8 @@ install_ubuntu_onedir_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then + if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3379,21 +3382,21 @@ install_ubuntu_onedir_deps() { install_ubuntu_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -3410,7 +3413,7 @@ install_ubuntu_git() { _PYEXE=python2.7 fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then # We can use --prefix on debian based ditributions if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" @@ -3428,16 +3431,16 @@ install_ubuntu_git() { _SERVICE_DIR="pkg" fi - sed -i 's:/usr/bin:/usr/local/bin:g' ${_SERVICE_DIR}/*.service + sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then # shellcheck disable=SC2086 - "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --install-layout=deb || return 1 + "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 else # shellcheck disable=SC2086 - "${_PYEXE}" setup.py ${SETUP_PY_INSTALL_ARGS} install --install-layout=deb || return 1 + "${_PYEXE}" setup.py "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 fi return 0 @@ -3446,21 +3449,21 @@ install_ubuntu_git() { install_ubuntu_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -3468,23 +3471,23 @@ install_ubuntu_onedir() { install_ubuntu_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then # Using systemd - /bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( - /bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && - /bin/systemctl enable salt-$fname.service > /dev/null 2>&1 + /bin/systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( + /bin/systemctl preset "salt-$fname.service" > /dev/null 2>&1 && + /bin/systemctl enable "salt-$fname.service" > /dev/null 2>&1 ) sleep 1 /bin/systemctl daemon-reload - elif [ -f /etc/init.d/salt-$fname ]; then - update-rc.d salt-$fname defaults + elif [ -f "/etc/init.d/salt-$fname" ]; then + update-rc.d "salt-$fname defaults" fi done @@ -3494,11 +3497,11 @@ install_ubuntu_stable_post() { install_ubuntu_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -3511,23 +3514,23 @@ install_ubuntu_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload elif [ -f /sbin/initctl ]; then _upstart_conf="/etc/init/salt-$fname.conf" # We have upstart support echodebug "There's upstart support" - if [ ! -f $_upstart_conf ]; then + if [ ! -f "$_upstart_conf" ]; then # upstart does not know about our service, let's copy the proper file echowarn "Upstart does not appear to know about salt-$fname" echodebug "Copying ${_SERVICE_DIR}/salt-$fname.upstart to $_upstart_conf" __copyfile "${_SERVICE_DIR}/salt-${fname}.upstart" "$_upstart_conf" # Set service to know about virtualenv if [ "${_VIRTUALENV_DIR}" != "null" ]; then - echo "SALT_USE_VIRTUALENV=${_VIRTUALENV_DIR}" > /etc/default/salt-${fname} + echo "SALT_USE_VIRTUALENV=${_VIRTUALENV_DIR}" > "/etc/default/salt-${fname}" fi /sbin/initctl reload-configuration || return 1 fi @@ -3536,12 +3539,12 @@ install_ubuntu_git_post() { echodebug "There's NO upstart support!?" echodebug "Copying ${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init to /etc/init.d/salt-$fname" __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init" "/etc/init.d/salt-$fname" - chmod +x /etc/init.d/salt-$fname + chmod +x "/etc/init.d/salt-$fname" # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - update-rc.d salt-$fname defaults + update-rc.d "salt-$fname" defaults else echoerror "Neither upstart nor init.d was setup for salt-$fname" fi @@ -3551,7 +3554,7 @@ install_ubuntu_git_post() { } install_ubuntu_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return # Ensure upstart configs / systemd units are loaded if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then @@ -3562,21 +3565,21 @@ install_ubuntu_restart_daemons() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then echodebug "There's systemd support while checking salt-$fname" - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue + systemctl stop "salt-$fname" > /dev/null 2>&1 + systemctl start "salt-$fname.service" && continue # We failed to start the service, let's test the SysV code below echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi fi @@ -3584,22 +3587,22 @@ install_ubuntu_restart_daemons() { if [ -f /sbin/initctl ]; then echodebug "There's upstart support while checking salt-$fname" - if status salt-$fname 2>/dev/null | grep -q running; then - stop salt-$fname || (echodebug "Failed to stop salt-$fname" && return 1) + if status "salt-$fname" 2>/dev/null | grep -q running; then + stop "salt-$fname" || (echodebug "Failed to stop salt-$fname" && return 1) fi - start salt-$fname && continue + start "salt-$fname" && continue # We failed to start the service, let's test the SysV code below echodebug "Failed to start salt-$fname using Upstart" fi - if [ ! -f /etc/init.d/salt-$fname ]; then + if [ ! -f "/etc/init.d/salt-$fname" ]; then echoerror "No init.d support for salt-$fname was found" return 1 fi - /etc/init.d/salt-$fname stop > /dev/null 2>&1 - /etc/init.d/salt-$fname start + "/etc/init.d/salt-$fname" stop > /dev/null 2>&1 + "/etc/init.d/salt-$fname" start done return 0 @@ -3608,19 +3611,19 @@ install_ubuntu_restart_daemons() { install_ubuntu_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; 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 - elif [ -f /etc/init.d/salt-$fname ]; then - __check_services_debian salt-$fname || return 1 + __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 + elif [ -f "/etc/init.d/salt-$fname" ]; then + __check_services_debian "salt-$fname" || return 1 fi done @@ -3658,7 +3661,7 @@ __install_saltstack_debian_repository() { fi # shellcheck disable=SC2086,SC2090 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" @@ -3692,7 +3695,7 @@ __install_saltstack_debian_onedir_repository() { fi # shellcheck disable=SC2086,SC2090 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${ONEDIR_REV}/" @@ -3714,7 +3717,7 @@ __install_saltstack_debian_onedir_repository() { } install_debian_deps() { - if [ $_START_DAEMONS -eq $BS_FALSE ]; then + if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3723,9 +3726,9 @@ install_debian_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3750,7 +3753,7 @@ install_debian_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __check_dpkg_architecture || return 1 @@ -3760,14 +3763,14 @@ install_debian_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 + __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi return 0 } install_debian_onedir_deps() { - if [ $_START_DAEMONS -eq $BS_FALSE ]; then + if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3776,9 +3779,9 @@ install_debian_onedir_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3803,7 +3806,7 @@ install_debian_onedir_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __check_dpkg_architecture || return 1 @@ -3813,7 +3816,7 @@ install_debian_onedir_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 + __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -3824,7 +3827,7 @@ install_debian_git_pre() { __apt_get_install_noinput git || return 1 fi - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __apt_get_install_noinput ca-certificates fi @@ -3847,23 +3850,23 @@ install_debian_git_deps() { PY_PKG_VER="" fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname" __PACKAGES="${__PACKAGES} python-crypto python-jinja2 python-msgpack python-m2crypto" __PACKAGES="${__PACKAGES} python-requests python-tornado python-yaml python-zmq" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # Install python-libcloud if asked to __PACKAGES="${__PACKAGES} python-libcloud" fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 else __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" echodebug "install_debian_git_deps() Installing ${__PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 fi return 0 @@ -3878,7 +3881,7 @@ install_debian_7_git_deps() { install_debian_8_git_deps() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then echodebug "CALLING install_debian_git_deps" install_debian_git_deps || return 1 return 0 @@ -3890,7 +3893,7 @@ install_debian_8_git_deps() { __apt_get_install_noinput git || return 1 fi - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __apt_get_install_noinput ca-certificates fi @@ -3900,7 +3903,7 @@ install_debian_8_git_deps() { __PACKAGES="${__PACKAGES} python-m2crypto python-msgpack python-requests python-systemd" __PACKAGES="${__PACKAGES} python-yaml python-zmq python-concurrent.futures" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # Install python-libcloud if asked to __PACKAGES="${__PACKAGES} python-libcloud" fi @@ -3915,7 +3918,7 @@ install_debian_8_git_deps() { __PACKAGES="${__PACKAGES} python-pip" fi # Attempt to configure backports repo on non-x86_64 system - elif [ $_DISABLE_REPOS -eq $BS_FALSE ] && [ "$DPKG_ARCHITECTURE" != "amd64" ]; then + elif [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] && [ "$DPKG_ARCHITECTURE" != "amd64" ]; then # Check if Debian Backports repo already configured if ! apt-cache policy | grep -q 'Debian Backports'; then echo 'deb http://httpredir.debian.org/debian jessie-backports main' > \ @@ -3931,11 +3934,11 @@ install_debian_8_git_deps() { fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 if [ "${__PIP_PACKAGES}" != "" ]; then # shellcheck disable=SC2086,SC2090 - pip install -U ${__PIP_PACKAGES} || return 1 + pip install -U "${__PIP_PACKAGES}" || return 1 fi # Let's trigger config_salt() @@ -3949,7 +3952,7 @@ install_debian_8_git_deps() { install_debian_9_git_deps() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then install_debian_git_deps || return 1 return 0 fi @@ -3972,7 +3975,7 @@ install_debian_9_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-systemd" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # Install python-libcloud if asked to __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" fi @@ -3985,7 +3988,7 @@ install_debian_9_git_deps() { install_debian_10_git_deps() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then install_debian_git_deps || return 1 return 0 fi @@ -4003,12 +4006,12 @@ install_debian_10_git_deps() { __PACKAGES="" fi - __install_tornado_pip ${_py}|| return 1 + __install_tornado_pip "${_py}" || return 1 __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -4016,21 +4019,21 @@ install_debian_10_git_deps() { install_debian_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -4057,7 +4060,7 @@ install_debian_git() { _PYEXE=python fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then # We can use --prefix on debian based ditributions if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" @@ -4075,16 +4078,16 @@ install_debian_git() { _SERVICE_DIR="pkg" fi - sed -i 's:/usr/bin:/usr/local/bin:g' ${_SERVICE_DIR}/*.service + sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then # shellcheck disable=SC2086 - "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --install-layout=deb || return 1 + "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 else # shellcheck disable=SC2086 - "${_PYEXE}" setup.py ${SETUP_PY_INSTALL_ARGS} install --install-layout=deb || return 1 + "${_PYEXE}" setup.py "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 fi } @@ -4106,21 +4109,21 @@ install_debian_9_git() { install_debian_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -4129,10 +4132,10 @@ install_debian_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -4143,15 +4146,15 @@ install_debian_git_post() { # Configure SystemD for Debian 8 "Jessie" and later if [ -f /bin/systemctl ]; then - if [ ! -f /lib/systemd/system/salt-${fname}.service ] || \ - { [ -f /lib/systemd/system/salt-${fname}.service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]; }; then + if [ ! -f "/lib/systemd/system/salt-${fname}.service" ] || \ + { [ -f "/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then if [ -f "${_SERVICE_DIR}/salt-${fname}.service" ]; then __copyfile "${_SERVICE_DIR}/salt-${fname}.service" /lib/systemd/system __copyfile "${_SERVICE_DIR}/salt-${fname}.environment" "/etc/default/salt-${fname}" else # workaround before adding Debian-specific unit files to the Salt main repo __copyfile "${_SERVICE_DIR}/salt-${fname}.service" /lib/systemd/system - sed -i -e '/^Type/ s/notify/simple/' /lib/systemd/system/salt-${fname}.service + sed -i -e '/^Type/ s/notify/simple/' "/lib/systemd/system/salt-${fname}.service" fi fi @@ -4159,11 +4162,11 @@ install_debian_git_post() { [ "$fname" = "api" ] && continue /bin/systemctl enable "salt-${fname}.service" - SYSTEMD_RELOAD=$BS_TRUE + SYSTEMD_RELOAD="$BS_TRUE" # Install initscripts for Debian 7 "Wheezy" elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then + { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}" __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}" @@ -4190,29 +4193,29 @@ install_debian_2021_post() { } install_debian_restart_daemons() { - [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then # Debian 8 uses systemd - /bin/systemctl stop salt-$fname > /dev/null 2>&1 - /bin/systemctl start salt-$fname.service && continue - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + /bin/systemctl stop "salt-$fname" > /dev/null 2>&1 + /bin/systemctl start "salt-$fname.service" && continue + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi - elif [ -f /etc/init.d/salt-$fname ]; then + elif [ -f "/etc/init.d/salt-$fname" ]; then # Still in SysV init - /etc/init.d/salt-$fname stop > /dev/null 2>&1 - /etc/init.d/salt-$fname start + "/etc/init.d/salt-$fname" stop > /dev/null 2>&1 + "/etc/init.d/salt-$fname" start fi done } @@ -4220,17 +4223,17 @@ install_debian_restart_daemons() { install_debian_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then - __check_services_systemd salt-$fname || return 1 - elif [ -f /etc/init.d/salt-$fname ]; then - __check_services_debian salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 + elif [ -f "/etc/init.d/salt-$fname" ]; then + __check_services_debian "salt-$fname" || return 1 fi done return 0 @@ -4261,7 +4264,7 @@ __install_saltstack_fedora_onedir_repository() { REPO_FILE="/etc/yum.repos.d/salt.repo" - if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then + if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" @@ -4281,7 +4284,7 @@ __install_saltstack_fedora_onedir_repository() { } install_fedora_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then dnf -y update || return 1 fi @@ -4303,7 +4306,7 @@ install_fedora_deps() { fi # shellcheck disable=SC2086 - __dnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 + __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 return 0 } @@ -4313,6 +4316,7 @@ install_fedora_stable() { __SALT_VERSION="" else __SALT_VERSION="$(dnf list --showduplicates salt | grep "$STABLE_REV" | head -n 1 | awk '{print $2}')" + # shellcheck disable=SC2268 if [ "x${__SALT_VERSION}" = "x" ]; then echoerror "Could not find a stable install for Salt ${STABLE_REV}" exit 1 @@ -4322,21 +4326,21 @@ install_fedora_stable() { fi __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud${__SALT_VERSION}" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master${__SALT_VERSION}" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion${__SALT_VERSION}" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" fi # shellcheck disable=SC2086 - __dnf_install_noinput ${__PACKAGES} || return 1 + __dnf_install_noinput "${__PACKAGES}" || return 1 __python="python3" if ! __check_command_exists python3; then @@ -4344,9 +4348,9 @@ install_fedora_stable() { return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" - __installed_tornado_rpm=$(rpm -qa | grep python${PY_PKG_VER}-tornado) + __installed_tornado_rpm=$(rpm -qa | grep "python${PY_PKG_VER}-tornado") if [ -n "${__installed_tornado_rpm}" ]; then echodebug "Removing system package ${__installed_tornado_rpm}" rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 @@ -4367,14 +4371,14 @@ EOM install_fedora_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload done @@ -4398,18 +4402,18 @@ install_fedora_git_deps() { if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 - __dnf_install_noinput ${__PACKAGES} || return 1 + __dnf_install_noinput "${__PACKAGES}" || return 1 __PACKAGES="" fi __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __PACKAGES="${__PACKAGES} ca-certificates" fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" fi @@ -4443,7 +4447,7 @@ install_fedora_git_deps() { __PACKAGES="${__PACKAGES} gcc-c++" fi # shellcheck disable=SC2086 - __dnf_install_noinput ${__PACKAGES} || return 1 + __dnf_install_noinput "${__PACKAGES}" || return 1 fi # Let's trigger config_salt() @@ -4463,15 +4467,15 @@ install_fedora_git() { _PYEXE='python2' fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 else - ${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 fi return 0 } @@ -4479,11 +4483,11 @@ install_fedora_git() { install_fedora_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -4499,31 +4503,31 @@ install_fedora_git_post() { #fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload done } install_fedora_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue + systemctl stop "salt-$fname" > /dev/null 2>&1 + systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi done @@ -4532,14 +4536,14 @@ install_fedora_restart_daemons() { install_fedora_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 done return 0 @@ -4547,7 +4551,7 @@ install_fedora_check_services() { install_fedora_onedir_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -4577,12 +4581,12 @@ install_fedora_onedir_deps() { __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -4591,32 +4595,32 @@ install_fedora_onedir_deps() { install_fedora_onedir() { - STABLE_REV=$ONEDIR_REV + STABLE_REV="$ONEDIR_REV" #install_fedora_stable || return 1 __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 return 0 } install_fedora_onedir_post() { - STABLE_REV=$ONEDIR_REV + STABLE_REV="$ONEDIR_REV" install_fedora_stable_post || return 1 return 0 @@ -4666,7 +4670,7 @@ __install_saltstack_rhel_repository() { repo_file="/etc/yum.repos.d/salt.repo" - if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then + if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then cat <<_eof > "$repo_file" [saltstack] name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever @@ -4727,7 +4731,7 @@ __install_saltstack_rhel_onedir_repository() { repo_file="/etc/yum.repos.d/salt.repo" - if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then + if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then cat <<_eof > "$repo_file" [saltstack] name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever @@ -4757,7 +4761,7 @@ _eof } install_centos_stable_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -4784,7 +4788,7 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig" fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then # YAML module is used for generating custom master/minion configs if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then @@ -4812,12 +4816,12 @@ install_centos_stable_deps() { __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi @@ -4827,21 +4831,21 @@ install_centos_stable_deps() { install_centos_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 # Workaround for 3.11 broken on CentOS Stream 8.x # Re-install Python 3.6 @@ -4858,26 +4862,26 @@ install_centos_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then - /bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( - /bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && - /bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 + /bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( + /bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && + /bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 ) SYSTEMD_RELOAD=$BS_TRUE elif [ -f "/etc/init.d/salt-${fname}" ]; then - /sbin/chkconfig salt-${fname} on + /sbin/chkconfig "salt-${fname}" on fi done - if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then + if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then /bin/systemctl daemon-reload fi @@ -4890,11 +4894,11 @@ install_centos_git_deps() { # package repos available. # Set ONEDIR_REV to STABLE_REV in case we # end up calling install_centos_onedir_deps - ONEDIR_REV=${STABLE_REV} + ONEDIR_REV="${STABLE_REV}" install_centos_onedir_deps || \ return 1 - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __yum_install_noinput ca-certificates || return 1 fi @@ -4928,7 +4932,7 @@ install_centos_git_deps() { fi fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then _install_m2crypto_req=false if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then _py=${_PY_EXE} @@ -4951,7 +4955,7 @@ install_centos_git_deps() { fi if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __install_tornado_pip ${_py} || return 1 + __install_tornado_pip "${_py}" || return 1 __PACKAGES="${__PACKAGES} python3-m2crypto" else __PACKAGES="${__PACKAGES} m2crypto python${PY_PKG_VER}-crypto" @@ -4961,7 +4965,7 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-zmq" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" fi @@ -4975,7 +4979,7 @@ install_centos_git_deps() { _PIP_PACKAGES="m2crypto!=0.33.0 jinja2 msgpack-python pycrypto PyYAML tornado<5.0 zmq futures>=2.0" # install swig and openssl on cent6 - if $_install_m2crypto_req; then + if "$_install_m2crypto_req"; then __yum_install_noinput openssl-devel swig || return 1 fi @@ -4997,7 +5001,7 @@ install_centos_git_deps() { __install_pip_pkgs "${_PIP_PACKAGES}" "${_PY_EXE}" || return 1 else # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi else if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then @@ -5006,7 +5010,7 @@ install_centos_git_deps() { fi __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi # Let's trigger config_salt() @@ -5027,15 +5031,15 @@ install_centos_git() { fi echodebug "_PY_EXE: $_PY_EXE" - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 else - $_PYEXE setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + $_PYEXE setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 fi return 0 @@ -5046,11 +5050,11 @@ install_centos_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -5060,19 +5064,19 @@ install_centos_git_post() { fi if [ -f /bin/systemctl ]; then if [ ! -f "/usr/lib/systemd/system/salt-${fname}.service" ] || \ - { [ -f "/usr/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then + { [ -f "/usr/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then __copyfile "${_SERVICE_FILE}" /usr/lib/systemd/system fi - SYSTEMD_RELOAD=$BS_TRUE + SYSTEMD_RELOAD="$BS_TRUE" elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then + { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}" /etc/init.d - chmod +x /etc/init.d/salt-${fname} + chmod +x "/etc/init.d/salt-${fname}" fi done - if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then + if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then /bin/systemctl daemon-reload fi @@ -5082,7 +5086,7 @@ install_centos_git_post() { } install_centos_onedir_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -5112,12 +5116,12 @@ install_centos_onedir_deps() { __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi @@ -5127,50 +5131,50 @@ install_centos_onedir_deps() { install_centos_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 return 0 } install_centos_onedir_post() { - SYSTEMD_RELOAD=$BS_FALSE + SYSTEMD_RELOAD="$BS_FALSE" for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then - /bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( - /bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && - /bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 + /bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( + /bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && + /bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 ) SYSTEMD_RELOAD=$BS_TRUE elif [ -f "/etc/init.d/salt-${fname}" ]; then - /sbin/chkconfig salt-${fname} on + "/sbin/chkconfig salt-${fname}" on fi done - if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then + if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then /bin/systemctl daemon-reload fi @@ -5178,43 +5182,43 @@ install_centos_onedir_post() { } install_centos_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then + if [ -f /sbin/initctl ] && [ -f "/etc/init/salt-${fname}.conf" ]; then # We have upstart support and upstart knows about our service - if ! /sbin/initctl status salt-$fname > /dev/null 2>&1; then + if ! /sbin/initctl status "salt-$fname" > /dev/null 2>&1; then # Everything is in place and upstart gave us an error code? Fail! return 1 fi # upstart knows about this service. # Let's try to stop it, and then start it - /sbin/initctl stop salt-$fname > /dev/null 2>&1 + /sbin/initctl stop "salt-$fname" > /dev/null 2>&1 # Restart service - if ! /sbin/initctl start salt-$fname > /dev/null 2>&1; then + if ! /sbin/initctl start "salt-$fname" > /dev/null 2>&1; then # Failed the restart?! return 1 fi - elif [ -f /etc/init.d/salt-$fname ]; then + elif [ -f "/etc/init.d/salt-$fname" ]; then # Disable stdin to fix shell session hang on killing tee pipe - service salt-$fname stop < /dev/null > /dev/null 2>&1 - service salt-$fname start < /dev/null + service "salt-$fname" stop < /dev/null > /dev/null 2>&1 + service "salt-$fname" start < /dev/null elif [ -f /usr/bin/systemctl ]; then # CentOS 7 uses systemd - /usr/bin/systemctl stop salt-$fname > /dev/null 2>&1 - /usr/bin/systemctl start salt-$fname.service && continue + /usr/bin/systemctl stop "salt-$fname" > /dev/null 2>&1 + /usr/bin/systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi fi @@ -5239,19 +5243,19 @@ install_centos_testing_post() { install_centos_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then - __check_services_upstart salt-$fname || return 1 - elif [ -f /etc/init.d/salt-$fname ]; then - __check_services_sysvinit salt-$fname || return 1 + if [ -f /sbin/initctl ] && [ -f "/etc/init/salt-${fname}.conf" ]; then + __check_services_upstart "salt-$fname" || return 1 + elif [ -f "/etc/init.d/salt-$fname" ]; then + __check_services_sysvinit "salt-$fname" || return 1 elif [ -f /usr/bin/systemctl ]; then - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 fi done @@ -5561,12 +5565,12 @@ install_red_hat_enterprise_workstation_testing_post() { # install_oracle_linux_stable_deps() { # Install Oracle's EPEL. - if [ ${_EPEL_REPOS_INSTALLED} -eq $BS_FALSE ]; then - _EPEL_REPO=oracle-epel-release-el${DISTRO_MAJOR_VERSION} + if [ "${_EPEL_REPOS_INSTALLED}" -eq "$BS_FALSE" ]; then + _EPEL_REPO="oracle-epel-release-el${DISTRO_MAJOR_VERSION}" if ! rpm -q "${_EPEL_REPO}" > /dev/null; then __yum_install_noinput "${_EPEL_REPO}" fi - _EPEL_REPOS_INSTALLED=$BS_TRUE + _EPEL_REPOS_INSTALLED="$BS_TRUE" fi install_centos_stable_deps || return 1 @@ -5975,7 +5979,7 @@ install_alpine_linux_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then apk -U add python2 py-virtualenv py2-crypto py2-m2crypto py2-setuptools \ py2-jinja2 py2-yaml py2-markupsafe py2-msgpack py2-psutil \ py2-zmq zeromq py2-requests || return 1 @@ -6003,46 +6007,46 @@ install_alpine_linux_git_deps() { install_alpine_linux_stable() { __PACKAGES="salt" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - apk -U add ${__PACKAGES} || return 1 + apk -U add "${__PACKAGES}" || return 1 return 0 } install_alpine_linux_git() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install || return 1 + python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 else - python2 setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1 + python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 fi } install_alpine_linux_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /sbin/rc-update ]; then script_url="${_SALTSTACK_REPO_URL%.git}/raw/master/pkg/alpine/salt-$fname" @@ -6057,7 +6061,7 @@ install_alpine_linux_post() { fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue /sbin/rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 fi @@ -6065,60 +6069,60 @@ install_alpine_linux_post() { } install_alpine_linux_restart_daemons() { - [ "${_START_DAEMONS}" -eq $BS_FALSE ] && return + [ "${_START_DAEMONS}" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Disable stdin to fix shell session hang on killing tee pipe - /sbin/rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 - /sbin/rc-service salt-$fname start < /dev/null || return 1 + /sbin/rc-service "salt-$fname" stop < /dev/null > /dev/null 2>&1 + /sbin/rc-service "salt-$fname" start < /dev/null || return 1 done } install_alpine_linux_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_openrc salt-$fname || return 1 + __check_services_openrc "salt-$fname" || return 1 done return 0 } daemons_running_alpine_linux() { - [ "${_START_DAEMONS}" -eq $BS_FALSE ] && return + [ "${_START_DAEMONS}" -eq "$BS_FALSE" ] && return FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # shellcheck disable=SC2009 - if [ "$(ps wwwaux | grep -v grep | grep salt-$fname)" = "" ]; then + if [ "$(ps wwwaux | grep -v grep | grep "salt-$fname")" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return $FAILED_DAEMONS + return "$FAILED_DAEMONS" } # @@ -6132,9 +6136,10 @@ daemons_running_alpine_linux() { # Amazon Linux AMI Install Functions # +# Support for Amazon Linux (EOL) install_amazon_linux_ami_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS=$BS_FALSE + _USEAWS="$BS_FALSE" pkg_append="python" if [ "$ITYPE" = "stable" ]; then @@ -6143,7 +6148,7 @@ install_amazon_linux_ami_deps() { repo_rev="latest" fi - if echo $repo_rev | grep -E -q '^archive'; then + if echo "$repo_rev" | grep -E -q '^archive'; then year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) else year=$(echo "$repo_rev" | cut -c1-4) @@ -6151,7 +6156,7 @@ install_amazon_linux_ami_deps() { if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ [ "$year" -gt 2016 ]; then - _USEAWS=$BS_TRUE + _USEAWS="$BS_TRUE" pkg_append="python27" fi @@ -6160,15 +6165,15 @@ install_amazon_linux_ami_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi - if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" # Set a few vars to make life easier. - if [ $_USEAWS -eq $BS_TRUE ]; then + if [ "$_USEAWS" -eq "$BS_TRUE" ]; then base_url="$HTTP_VAL://${_REPO_URL}/yum/amazon/latest/\$basearch/$repo_rev/" gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" repo_name="SaltStack repo for Amazon Linux" @@ -6195,25 +6200,25 @@ _eof fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 # which is already installed __PACKAGES="m2crypto ${pkg_append}-crypto ${pkg_append}-jinja2 ${pkg_append}-PyYAML" __PACKAGES="${__PACKAGES} ${pkg_append}-msgpack ${pkg_append}-requests ${pkg_append}-zmq" __PACKAGES="${__PACKAGES} ${pkg_append}-futures" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi } install_amazon_linux_ami_git_deps() { - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then yum -y install ca-certificates || return 1 fi @@ -6237,11 +6242,11 @@ install_amazon_linux_ami_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __PACKAGES="" __PIP_PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" __PACKAGES="${__PACKAGES} python27-pip" __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" @@ -6257,17 +6262,17 @@ install_amazon_linux_ami_git_deps() { if [ "${__PACKAGES}" != "" ]; then # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${__PIP_PACKAGES}" != "" ]; then # shellcheck disable=SC2086 - ${PIP_EXE} install ${__PIP_PACKAGES} || return 1 + ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 fi else __PACKAGES="python27-pip python27-setuptools python27-devel gcc" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi # Let's trigger config_salt() @@ -6279,8 +6284,44 @@ install_amazon_linux_ami_git_deps() { return 0 } +install_amazon_linux_ami_stable() { + install_centos_stable || return 1 + return 0 +} + +install_amazon_linux_ami_stable_post() { + install_centos_stable_post || return 1 + return 0 +} + +install_amazon_linux_ami_restart_daemons() { + install_centos_restart_daemons || return 1 + return 0 +} + +install_amazon_linux_ami_git() { + install_centos_git || return 1 + return 0 +} + +install_amazon_linux_ami_git_post() { + install_centos_git_post || return 1 + return 0 +} + +install_amazon_linux_ami_testing() { + install_centos_testing || return 1 + return 0 +} + +install_amazon_linux_ami_testing_post() { + install_centos_testing_post || return 1 + return 0 +} + +# Support for Amazon Linux 2 install_amazon_linux_ami_2_git_deps() { - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then yum -y install ca-certificates || return 1 fi @@ -6297,7 +6338,7 @@ install_amazon_linux_ami_2_git_deps() { if ! __check_command_exists "${PIP_EXE}"; then # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if ! __check_command_exists git; then @@ -6306,7 +6347,7 @@ install_amazon_linux_ami_2_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __PACKAGES="" __PIP_PACKAGES="" @@ -6345,17 +6386,17 @@ install_amazon_linux_ami_2_git_deps() { if [ "${__PACKAGES}" != "" ]; then # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${__PIP_PACKAGES}" != "" ]; then # shellcheck disable=SC2086 - ${PIP_EXE} install ${__PIP_PACKAGES} || return 1 + ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 fi else __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi # Let's trigger config_salt() @@ -6369,7 +6410,7 @@ install_amazon_linux_ami_2_git_deps() { install_amazon_linux_ami_2_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS=$BS_FALSE + _USEAWS="$BS_FALSE" pkg_append="python" if [ "$ITYPE" = "stable" ]; then @@ -6378,7 +6419,7 @@ install_amazon_linux_ami_2_deps() { repo_rev="latest" fi - if echo $repo_rev | grep -E -q '^archive'; then + if echo "$repo_rev" | grep -E -q '^archive'; then year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) else year=$(echo "$repo_rev" | cut -c1-4) @@ -6386,7 +6427,7 @@ install_amazon_linux_ami_2_deps() { if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ [ "$year" -gt 2016 ]; then - _USEAWS=$BS_TRUE + _USEAWS="$BS_TRUE" pkg_append="python" fi @@ -6395,11 +6436,11 @@ install_amazon_linux_ami_2_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi - if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" __PY_VERSION_REPO="yum" PY_PKG_VER="" @@ -6436,7 +6477,7 @@ _eof fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 # which is already installed if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then @@ -6449,19 +6490,19 @@ _eof __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi } install_amazon_linux_ami_2_onedir_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS=$BS_FALSE + _USEAWS="$BS_FALSE" pkg_append="python" if [ "$ITYPE" = "onedir" ]; then @@ -6470,7 +6511,7 @@ install_amazon_linux_ami_2_onedir_deps() { repo_rev="latest" fi - if echo $repo_rev | grep -E -q '^archive'; then + if echo "$repo_rev" | grep -E -q '^archive'; then year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) else year=$(echo "$repo_rev" | cut -c1-4) @@ -6481,11 +6522,11 @@ install_amazon_linux_ami_2_onedir_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi - if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" __PY_VERSION_REPO="yum" PY_PKG_VER="" @@ -6530,7 +6571,7 @@ _eof fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 # which is already installed if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then @@ -6543,51 +6584,16 @@ _eof __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" # shellcheck disable=SC2086 - __yum_install_noinput ${__PACKAGES} || return 1 + __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi } -install_amazon_linux_ami_stable() { - install_centos_stable || return 1 - return 0 -} - -install_amazon_linux_ami_stable_post() { - install_centos_stable_post || return 1 - return 0 -} - -install_amazon_linux_ami_restart_daemons() { - install_centos_restart_daemons || return 1 - return 0 -} - -install_amazon_linux_ami_git() { - install_centos_git || return 1 - return 0 -} - -install_amazon_linux_ami_git_post() { - install_centos_git_post || return 1 - return 0 -} - -install_amazon_linux_ami_testing() { - install_centos_testing || return 1 - return 0 -} - -install_amazon_linux_ami_testing_post() { - install_centos_testing_post || return 1 - return 0 -} - install_amazon_linux_ami_2_stable() { install_centos_stable || return 1 return 0 @@ -6638,6 +6644,204 @@ install_amazon_linux_ami_2_onedir_post() { return 0 } +# Support for Amazon Linux 2023 +# the following code needs adjustment to allow for 2023, 2024, 2025, etc - 2023 for now +install_amazon_linux_ami_2023_git_deps() { + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + yum -y install ca-certificates || return 1 + fi + + install_amazon_linux_ami_2023_onedir_deps || return 1 + + PY_PKG_VER=3 + PIP_EXE='/bin/pip3' + __PACKAGES="python${PY_PKG_VER}-pip" + + if ! __check_command_exists "${PIP_EXE}"; then + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 + fi + + if ! __check_command_exists git; then + __yum_install_noinput git || return 1 + fi + + __git_clone_and_checkout || return 1 + + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + + __PACKAGES="" + __PIP_PACKAGES="" + + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + __PACKAGES="${__PACKAGES} python3-pip" + __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" + __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" + fi + + if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # We're on the master branch, install whichever tornado is on the requirements file + __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + if [ "${__REQUIRED_TORNADO}" != "" ]; then + __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" + fi + fi + + if [ "${__PIP_PACKAGES}" != "" ]; then + __check_pip_allowed "You need to allow pip based installations (-P) in order to install ${__PIP_PACKAGES}" + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip" + fi + + if [ "${__PACKAGES}" != "" ]; then + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 + fi + + if [ "${__PIP_PACKAGES}" != "" ]; then + # shellcheck disable=SC2086 + ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 + fi + else + __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 + fi + + # Let's trigger config_salt() + if [ "$_TEMP_CONFIG_DIR" = "null" ]; then + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + CONFIG_SALT_FUNC="config_salt" + fi + + return 0 +} + +install_amazon_linux_ami_2023_onedir_deps() { + # Shim to figure out if we're using old (rhel) or new (aws) rpms. + _USEAWS="$BS_FALSE" + pkg_append="python" + + if [ "$ITYPE" = "onedir" ]; then + repo_rev="$ONEDIR_REV" + else + repo_rev="latest" + fi + + if echo "$repo_rev" | grep -E -q '^archive'; then + year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) + else + year=$(echo "$repo_rev" | cut -c1-4) + fi + + # We need to install yum-utils before doing anything else when installing on + # Amazon Linux ECS-optimized images. See issue #974. + __yum_install_noinput yum-utils + + # Do upgrade early + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + yum -y update || return 1 + fi + + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + __REPO_FILENAME="salt.repo" + __PY_VERSION_REPO="yum" + __PY_VERSION_REPO="py3" + PY_PKG_VER=3 + repo_label="saltstack-py3-repo" + repo_name="SaltStack Python 3 repo for Amazon Linux 2023" + + base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/amazon/2023/\$basearch/$repo_rev/" + if [ "${ONEDIR_REV}" = "nightly" ] ; then + base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/amazon/2023/\$basearch/" + fi + + gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.pub" + + # This should prob be refactored to use __install_saltstack_rhel_repository() + # With args passed in to do the right thing. Reformatted to be more like the + # amazon linux yum file. + if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then + cat <<_eof > "/etc/yum.repos.d/${__REPO_FILENAME}" +[$repo_label] +name=$repo_name +failovermethod=priority +priority=10 +gpgcheck=1 +gpgkey=$gpg_key +baseurl=$base_url +_eof + fi + fi + + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 + # which is already installed + __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" + __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" + __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" + + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 + fi + + if [ "${_EXTRA_PACKAGES}" != "" ]; then + echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" + # shellcheck disable=SC2086 + __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + fi +} + +install_amazon_linux_ami_2023_stable() { + install_centos_stable || return 1 + return 0 +} + +install_amazon_linux_ami_2023_stable_post() { + install_centos_stable_post || return 1 + return 0 +} + +install_amazon_linux_ami_2023_restart_daemons() { + install_centos_restart_daemons || return 1 + return 0 +} + +install_amazon_linux_ami_2023_git() { + install_centos_git || return 1 + return 0 +} + +install_amazon_linux_ami_2023_git_post() { + install_centos_git_post || return 1 + return 0 +} + +install_amazon_linux_ami_2023_testing() { + install_centos_testing || return 1 + return 0 +} + +install_amazon_linux_ami_2023_testing_post() { + install_centos_testing_post || return 1 + return 0 +} + +install_amazon_linux_ami_2023_check_services() { + install_centos_check_services || return 1 + return 0 +} + +install_amazon_linux_ami_2023_onedir() { + install_centos_stable || return 1 + return 0 +} + +install_amazon_linux_ami_2023_onedir_post() { + install_centos_stable_post || return 1 + return 0 +} + # # Ended Amazon Linux AMI Install Functions # @@ -6674,7 +6878,7 @@ install_arch_linux_stable_deps() { # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-yaml - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-apache-libcloud || return 1 fi @@ -6682,7 +6886,7 @@ install_arch_linux_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - pacman -Su --noconfirm --needed ${_EXTRA_PACKAGES} || return 1 + pacman -Su --noconfirm --needed "${_EXTRA_PACKAGES}" || return 1 fi } @@ -6696,7 +6900,7 @@ install_arch_linux_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then pacman -R --noconfirm python2-distribute pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \ @@ -6717,7 +6921,7 @@ install_arch_linux_git_deps() { fi __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 - pacman -Su --noconfirm --needed ${__PACKAGES} + pacman -Su --noconfirm --needed "${__PACKAGES}" fi # Let's trigger config_salt() @@ -6753,15 +6957,15 @@ install_arch_linux_git() { _POST_NEON_PIP_INSTALL_ARGS="${_POST_NEON_PIP_INSTALL_ARGS} --use-pep517" _PIP_DOWNLOAD_ARGS="${_PIP_DOWNLOAD_ARGS} --use-pep517" - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install || return 1 + python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 else - python2 setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1 + python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 fi return 0 } @@ -6769,28 +6973,28 @@ install_arch_linux_git() { install_arch_linux_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Since Arch's pacman renames configuration files if [ "$_TEMP_CONFIG_DIR" != "null" ] && [ -f "$_SALT_ETC_DIR/$fname.pacorig" ]; then # Since a configuration directory was provided, it also means that any # configuration file copied was renamed by Arch, see: # https://wiki.archlinux.org/index.php/Pacnew_and_Pacsave_Files#.pacorig - __copyfile "$_SALT_ETC_DIR/$fname.pacorig" "$_SALT_ETC_DIR/$fname" $BS_TRUE + __copyfile "$_SALT_ETC_DIR/$fname.pacorig" "$_SALT_ETC_DIR/$fname" "$BS_TRUE" fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue if [ -f /usr/bin/systemctl ]; then # Using systemd - /usr/bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( - /usr/bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && - /usr/bin/systemctl enable salt-$fname.service > /dev/null 2>&1 + /usr/bin/systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( + /usr/bin/systemctl preset "salt-$fname.service" > /dev/null 2>&1 && + /usr/bin/systemctl enable "salt-$fname.service" > /dev/null 2>&1 ) sleep 1 /usr/bin/systemctl daemon-reload @@ -6804,11 +7008,11 @@ install_arch_linux_post() { install_arch_linux_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -6821,11 +7025,11 @@ install_arch_linux_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - /usr/bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( - /usr/bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && - /usr/bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 + /usr/bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( + /usr/bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && + /usr/bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 ) sleep 1 /usr/bin/systemctl daemon-reload @@ -6834,34 +7038,34 @@ install_arch_linux_git_post() { # SysV init!? __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-$fname" "/etc/rc.d/init.d/salt-$fname" - chmod +x /etc/rc.d/init.d/salt-$fname + chmod +x "/etc/rc.d/init.d/salt-$fname" done } install_arch_linux_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /usr/bin/systemctl ]; then - /usr/bin/systemctl stop salt-$fname.service > /dev/null 2>&1 - /usr/bin/systemctl start salt-$fname.service && continue + /usr/bin/systemctl stop "salt-$fname.service" > /dev/null 2>&1 + /usr/bin/systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi fi - /etc/rc.d/salt-$fname stop > /dev/null 2>&1 - /etc/rc.d/salt-$fname start + "/etc/rc.d/salt-$fname" stop > /dev/null 2>&1 + "/etc/rc.d/salt-$fname" start done } @@ -6873,14 +7077,14 @@ install_arch_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 done return 0 @@ -6921,7 +7125,7 @@ __install_saltstack_photon_onedir_repository() { REPO_FILE="/etc/yum.repos.d/salt.repo" - if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then + if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" @@ -6943,7 +7147,7 @@ __install_saltstack_photon_onedir_repository() { } install_photon_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then tdnf -y update || return 1 fi @@ -6964,7 +7168,7 @@ install_photon_deps() { fi # shellcheck disable=SC2086 - __tdnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 + __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 return 0 } @@ -6972,14 +7176,14 @@ install_photon_deps() { install_photon_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload done @@ -7009,12 +7213,12 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __PACKAGES="${__PACKAGES} ca-certificates" fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" fi @@ -7045,7 +7249,7 @@ install_photon_git_deps() { else __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" # shellcheck disable=SC2086 - __tdnf_install_noinput ${__PACKAGES} || return 1 + __tdnf_install_noinput "${__PACKAGES}" || return 1 fi if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then @@ -7073,9 +7277,9 @@ install_photon_git() { fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 else - ${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 fi return 0 } @@ -7083,11 +7287,11 @@ install_photon_git() { install_photon_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -7103,31 +7307,31 @@ install_photon_git_post() { #fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload done } install_photon_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue + systemctl stop "salt-$fname" > /dev/null 2>&1 + systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi done @@ -7136,14 +7340,14 @@ install_photon_restart_daemons() { install_photon_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 done return 0 @@ -7151,7 +7355,7 @@ install_photon_check_services() { install_photon_onedir_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then tdnf -y update || return 1 fi @@ -7175,12 +7379,12 @@ install_photon_onedir_deps() { __PACKAGES="procps-ng" # shellcheck disable=SC2086 - __tdnf_install_noinput ${__PACKAGES} || return 1 + __tdnf_install_noinput "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __tdnf_install_noinput ${_EXTRA_PACKAGES} || return 1 + __tdnf_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -7189,31 +7393,31 @@ install_photon_onedir_deps() { install_photon_onedir() { - STABLE_REV=$ONEDIR_REV + STABLE_REV="$ONEDIR_REV" __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __tdnf_install_noinput ${__PACKAGES} || return 1 + __tdnf_install_noinput "${__PACKAGES}" || return 1 return 0 } install_photon_onedir_post() { - STABLE_REV=$ONEDIR_REV + STABLE_REV="$ONEDIR_REV" install_photon_stable_post || return 1 return 0 @@ -7231,7 +7435,7 @@ install_photon_onedir_post() { # Using a separate conf step to head for idempotent install... __configure_freebsd_pkg_details() { _SALT_ETC_DIR="/usr/local/etc/salt" - _PKI_DIR=${_SALT_ETC_DIR}/pki + _PKI_DIR="${_SALT_ETC_DIR}/pki" _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr/local" } @@ -7248,11 +7452,11 @@ install_freebsd_git_deps() { fi __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then SALT_DEPENDENCIES=$(/usr/local/sbin/pkg rquery %dn py39-salt) # shellcheck disable=SC2086 - /usr/local/sbin/pkg install -y ${SALT_DEPENDENCIES} python || return 1 + /usr/local/sbin/pkg install -y "${SALT_DEPENDENCIES}" python || return 1 /usr/local/sbin/pkg install -y py39-requests || return 1 /usr/local/sbin/pkg install -y py39-tornado4 || return 1 @@ -7266,11 +7470,11 @@ install_freebsd_git_deps() { for file in doc/man/salt-key.1 doc/man/salt-cp.1 doc/man/salt-minion.1 \ doc/man/salt-syndic.1 doc/man/salt-master.1 doc/man/salt-run.1 \ doc/man/salt.7 doc/man/salt.1 doc/man/salt-call.1; do - [ ! -f $file ] && continue + [ ! -f "$file" ] && continue echodebug "Patching ${file}" sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ - -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" ${file} + -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" "${file}" done if [ ! -f salt/syspaths.py ]; then # We still can't provide the system paths, salt 0.16.x @@ -7280,11 +7484,11 @@ install_freebsd_git_deps() { for file in conf/minion conf/master salt/config.py salt/client.py \ salt/modules/mysql.py salt/utils/parsers.py salt/modules/tls.py \ salt/modules/postgres.py salt/utils/migrations.py; do - [ ! -f $file ] && continue + [ ! -f "$file" ] && continue echodebug "Patching ${file}" sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ - -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" ${file} + -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" "${file}" done fi echodebug "Finished patching" @@ -7315,13 +7519,13 @@ install_freebsd_git() { __PYTHON_PATH=$(readlink -f "$(command -v python3)") __ESCAPED_PYTHON_PATH=$(echo "${__PYTHON_PATH}" | sed 's/\//\\\//g') - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 - sed -i '' 's/%%PREFIX%%/\/usr\/local/g' /usr/local/etc/rc.d/${script} - sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" /usr/local/etc/rc.d/${script} - chmod +x /usr/local/etc/rc.d/${script} || return 1 + sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" + sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" + chmod +x "/usr/local/etc/rc.d/${script}" || return 1 done return 0 @@ -7330,7 +7534,7 @@ install_freebsd_git() { # Install from git if [ ! -f salt/syspaths.py ]; then # We still can't provide the system paths, salt 0.16.x - ${__PYTHON_PATH} setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1 + ${__PYTHON_PATH} setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 else ${__PYTHON_PATH} setup.py \ --salt-root-dir=/ \ @@ -7343,15 +7547,15 @@ install_freebsd_git() { --salt-base-master-roots-dir="${_SALT_ETC_DIR}/salt-master" \ --salt-logs-dir=/var/log/salt \ --salt-pidfile-dir=/var/run \ - ${SETUP_PY_INSTALL_ARGS} install \ + "${SETUP_PY_INSTALL_ARGS}" install \ || return 1 fi for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 - sed -i '' 's/%%PREFIX%%/\/usr\/local/g' /usr/local/etc/rc.d/${script} - sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" /usr/local/etc/rc.d/${script} - chmod +x /usr/local/etc/rc.d/${script} || return 1 + sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" + sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" + chmod +x "/usr/local/etc/rc.d/${script}" || return 1 done # And we're good to go @@ -7361,16 +7565,16 @@ install_freebsd_git() { install_freebsd_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue enable_string="salt_${fname}_enable=YES" grep "$enable_string" /etc/rc.conf >/dev/null 2>&1 - [ $? -eq 1 ] && sysrc $enable_string + [ $? -eq 1 ] && sysrc "$enable_string" done } @@ -7381,19 +7585,19 @@ install_freebsd_git_post() { } install_freebsd_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - service salt_$fname stop > /dev/null 2>&1 - service salt_$fname start + service "salt_$fname" stop > /dev/null 2>&1 + service "salt_$fname" start done } @@ -7416,7 +7620,7 @@ install_freebsd_onedir() { # install_openbsd_deps() { - if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then OPENBSD_REPO='https://cdn.openbsd.org/pub/OpenBSD' echoinfo "setting package repository to $OPENBSD_REPO" echo "${OPENBSD_REPO}" >/etc/installurl || return 1 @@ -7425,7 +7629,7 @@ install_openbsd_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - pkg_add -I -v ${_EXTRA_PACKAGES} || return 1 + pkg_add -I -v "${_EXTRA_PACKAGES}" || return 1 fi return 0 } @@ -7438,7 +7642,7 @@ install_openbsd_git_deps() { fi __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then pkg_add -I -v py3-pip py3-setuptools fi @@ -7457,14 +7661,14 @@ install_openbsd_git() { # # Install from git # - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ ! -f salt/syspaths.py ]; then # We still can't provide the system paths, salt 0.16.x - /usr/local/bin/python2.7 setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1 + /usr/local/bin/python2.7 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 fi return 0 } @@ -7476,12 +7680,12 @@ install_openbsd_stable() { install_openbsd_post() { for fname in api master minion syndic; do - [ $fname = "api" ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - rcctl enable salt_$fname + rcctl enable "salt_$fname" done return 0 @@ -7490,15 +7694,15 @@ install_openbsd_post() { install_openbsd_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && continue - if [ -f /etc/rc.d/salt_${fname} ]; then - __check_services_openbsd salt_${fname} || return 1 + if [ -f "/etc/rc.d/salt_${fname}" ]; then + __check_services_openbsd "salt_${fname}" || return 1 fi done @@ -7506,18 +7710,18 @@ install_openbsd_check_services() { } install_openbsd_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - rcctl restart salt_${fname} + rcctl restart "salt_${fname}" done return 0 @@ -7545,9 +7749,9 @@ install_smartos_deps() { pkgin -y install "${smartos_deps}" || 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} + _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 + _PKI_DIR="${_SALT_ETC_DIR}/pki" # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -7561,21 +7765,21 @@ install_smartos_deps() { curl $_CURL_ARGS -s -o "$_TEMP_CONFIG_DIR/minion" -L \ https://raw.githubusercontent.com/saltstack/salt/master/conf/minion || return 1 fi - if [ ! -f "$_SALT_ETC_DIR/master" ] && [ ! -f $_TEMP_CONFIG_DIR/master ]; then + if [ ! -f "$_SALT_ETC_DIR/master" ] && [ ! -f "$_TEMP_CONFIG_DIR/master" ]; then # shellcheck disable=SC2086 curl $_CURL_ARGS -s -o "$_TEMP_CONFIG_DIR/master" -L \ https://raw.githubusercontent.com/saltstack/salt/master/conf/master || return 1 fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + 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 - pkgin -y install ${_EXTRA_PACKAGES} || return 1 + pkgin -y install "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -7590,7 +7794,7 @@ install_smartos_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then # Install whichever tornado is in the requirements file @@ -7638,14 +7842,14 @@ install_smartos_stable() { install_smartos_git() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi # Use setuptools in order to also install dependencies # 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 --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install || return 1 + USE_SETUPTOOLS=1 /opt/local/bin/python setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 return 0 } @@ -7655,17 +7859,17 @@ install_smartos_post() { # Install manifest files if needed. for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - svcs network/salt-$fname > /dev/null 2>&1 + svcs "network/salt-$fname" > /dev/null 2>&1 if [ $? -eq 1 ]; then if [ ! -f "$_TEMP_CONFIG_DIR/salt-$fname.xml" ]; then # shellcheck disable=SC2086 - curl $_CURL_ARGS -s -o "$_TEMP_CONFIG_DIR/salt-$fname.xml" -L \ + curl "$_CURL_ARGS" -s -o "$_TEMP_CONFIG_DIR/salt-$fname.xml" -L \ "https://raw.githubusercontent.com/saltstack/salt/master/pkg/smartos/salt-$fname.xml" fi svccfg import "$_TEMP_CONFIG_DIR/salt-$fname.xml" @@ -7689,17 +7893,17 @@ install_smartos_git_post() { # Install manifest files if needed. for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue svcs "network/salt-$fname" > /dev/null 2>&1 if [ $? -eq 1 ]; then svccfg import "${_SALT_GIT_CHECKOUT_DIR}/pkg/smartos/salt-$fname.xml" if [ "${VIRTUAL_TYPE}" = "global" ]; then - if [ ! -d $smf_dir ]; then + if [ ! -d "$smf_dir" ]; then mkdir -p "$smf_dir" fi if [ ! -f "$smf_dir/salt-$fname.xml" ]; then @@ -7713,20 +7917,20 @@ install_smartos_git_post() { } install_smartos_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Stop if running && Start service - svcadm disable salt-$fname > /dev/null 2>&1 - svcadm enable salt-$fname + svcadm disable "salt-$fname" > /dev/null 2>&1 + svcadm enable "salt-$fname" done return 0 @@ -7785,9 +7989,9 @@ __version_lte() { fi 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 - __ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE} + __ZYPPER_REQUIRES_REPLACE_FILES="${BS_TRUE}" else - __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} + __ZYPPER_REQUIRES_REPLACE_FILES="${BS_FALSE}" fi } @@ -7824,7 +8028,7 @@ __zypper_install() { __opensuse_prep_install() { # DRY function for common installation preparatory steps for SUSE - if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then # Is the repository already known __set_suse_pkg_repo # Check zypper repos and refresh if necessary @@ -7840,7 +8044,7 @@ __opensuse_prep_install() { return 1 fi - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then __zypper --gpg-auto-import-keys update || return 1 fi } @@ -7859,19 +8063,19 @@ install_opensuse_stable_deps() { __PACKAGES="python-PyYAML python-requests python-zypp" # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install ${_EXTRA_PACKAGES} || return 1 + __zypper_install "${_EXTRA_PACKAGES}" || return 1 fi return 0 } install_opensuse_git_deps() { - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ] && ! __check_command_exists update-ca-certificates; then + if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ] && ! __check_command_exists update-ca-certificates; then __zypper_install ca-certificates || return 1 fi @@ -7883,7 +8087,7 @@ install_opensuse_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then __zypper_install patch || return 1 __PACKAGES="libzmq5 python-Jinja2 python-m2crypto python-msgpack-python python-pycrypto python-pyzmq python-xml python-futures" @@ -7896,7 +8100,7 @@ install_opensuse_git_deps() { fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python-apache-libcloud" fi # Check for Tumbleweed @@ -7907,7 +8111,7 @@ install_opensuse_git_deps() { fi # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -7925,32 +8129,32 @@ install_opensuse_onedir_deps() { install_opensuse_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __zypper_install $__PACKAGES || return 1 + __zypper_install "$__PACKAGES" || return 1 return 0 } install_opensuse_git() { - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi - python setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + python setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 return 0 } @@ -7961,22 +8165,22 @@ install_opensuse_onedir() { install_opensuse_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ] || [ -f /usr/bin/systemctl ]; then - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") sleep 1 systemctl daemon-reload continue fi - /sbin/chkconfig --add salt-$fname - /sbin/chkconfig salt-$fname on + /sbin/chkconfig --add "salt-$fname" + /sbin/chkconfig "salt-$fname" on done return 0 @@ -7985,21 +8189,21 @@ install_opensuse_stable_post() { install_opensuse_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if command -v systemctl; then - use_usr_lib=$BS_FALSE + use_usr_lib="$BS_FALSE" if [ "${DISTRO_MAJOR_VERSION}" -ge 15 ]; then - use_usr_lib=$BS_TRUE + use_usr_lib="$BS_TRUE" fi if [ "${DISTRO_MAJOR_VERSION}" -eq 12 ] && [ -d "/usr/lib/systemd/" ]; then - use_usr_lib=$BS_TRUE + use_usr_lib="$BS_TRUE" fi # Account for new path for services files in later releases @@ -8009,7 +8213,7 @@ install_opensuse_git_post() { _SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/" fi - if [ "${use_usr_lib}" -eq $BS_TRUE ]; then + if [ "${use_usr_lib}" -eq "$BS_TRUE" ]; then __copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service" else __copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" @@ -8019,7 +8223,7 @@ install_opensuse_git_post() { fi __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-$fname" "/etc/init.d/salt-$fname" - chmod +x /etc/init.d/salt-$fname + chmod +x "/etc/init.d/salt-$fname" done install_opensuse_stable_post || return 1 @@ -8032,29 +8236,29 @@ install_opensuse_onedir_post() { } install_opensuse_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue + systemctl stop "salt-$fname" > /dev/null 2>&1 + systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi fi - service salt-$fname stop > /dev/null 2>&1 - service salt-$fname start + service "salt-$fname" stop > /dev/null 2>&1 + service "salt-$fname" start done } @@ -8066,14 +8270,14 @@ install_opensuse_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_systemd salt-$fname > /dev/null 2>&1 || __check_services_systemd salt-$fname.service > /dev/null 2>&1 || return 1 + __check_services_systemd "salt-$fname" > /dev/null 2>&1 || __check_services_systemd "salt-$fname.service" > /dev/null 2>&1 || return 1 done return 0 @@ -8105,12 +8309,12 @@ install_opensuse_15_stable_deps() { __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install ${_EXTRA_PACKAGES} || return 1 + __zypper_install "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -8133,7 +8337,7 @@ install_opensuse_15_git_deps() { __PACKAGES="python${PY_PKG_VER}-xml" - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then # Py3 is the default bootstrap install for Leap 15 # However, git installs might specify "-x python2" @@ -8153,7 +8357,7 @@ install_opensuse_15_git_deps() { fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apache-libcloud" fi else @@ -8161,7 +8365,7 @@ install_opensuse_15_git_deps() { fi # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -8176,17 +8380,17 @@ install_opensuse_15_git() { # Py3 is the default bootstrap install for Leap 15 if [ -n "$_PY_EXE" ]; then - _PYEXE=${_PY_EXE} + _PYEXE="${_PY_EXE}" else _PYEXE=python3 fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi - ${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 + ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 return 0 } @@ -8284,12 +8488,12 @@ install_suse_12_stable_deps() { # Salt needs python-zypp installed in order to use the zypper module __PACKAGES="python-PyYAML python-requests python-zypp" - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python-apache-libcloud" fi # shellcheck disable=SC2086,SC2090 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which # we want to install, even with --non-interactive. @@ -8299,7 +8503,7 @@ install_suse_12_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install ${_EXTRA_PACKAGES} || return 1 + __zypper_install "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -8327,12 +8531,12 @@ install_suse_12_git_deps() { fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python-apache-libcloud" fi # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -8400,7 +8604,7 @@ install_suse_11_stable_deps() { __PACKAGES="python-PyYAML" # shellcheck disable=SC2086,SC2090 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which # we want to install, even with --non-interactive. @@ -8410,7 +8614,7 @@ install_suse_11_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install ${_EXTRA_PACKAGES} || return 1 + __zypper_install "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -8438,12 +8642,12 @@ install_suse_11_git_deps() { fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then __PACKAGES="${__PACKAGES} python-apache-libcloud" fi # shellcheck disable=SC2086 - __zypper_install ${__PACKAGES} || return 1 + __zypper_install "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -8514,14 +8718,14 @@ install_suse_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 done return 0 @@ -8555,14 +8759,14 @@ __autounmask() { __emerge() { EMERGE_FLAGS='-q' - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then EMERGE_FLAGS='-v' fi # Do not re-emerge packages that are already installed EMERGE_FLAGS="${EMERGE_FLAGS} --noreplace" - if [ "$_GENTOO_USE_BINHOST" -eq $BS_TRUE ]; then + if [ "$_GENTOO_USE_BINHOST" -eq "$BS_TRUE" ]; then EMERGE_FLAGS="${EMERGE_FLAGS} --getbinpkg" fi @@ -8571,7 +8775,7 @@ __emerge() { } __gentoo_pre_dep() { - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then if __check_command_exists eix; then eix-sync else @@ -8605,9 +8809,9 @@ __gentoo_post_dep() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __autounmask ${_EXTRA_PACKAGES} || return 1 + __autounmask "${_EXTRA_PACKAGES}" || return 1 # shellcheck disable=SC2086 - __emerge ${_EXTRA_PACKAGES} || return 1 + __emerge "${_EXTRA_PACKAGES}" || return 1 fi return 0 @@ -8617,20 +8821,20 @@ install_gentoo_deps() { __gentoo_pre_dep || return 1 # Make sure that the 'libcloud' use flag is set when Salt Cloud support is requested - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then SALT_USE_FILE='/etc/portage/package.use' if [ -d '/etc/portage/package.use' ]; then SALT_USE_FILE='/etc/portage/package.use/salt' fi - SALT_USE_FLAGS="$(grep -E '^[<>=~]*app-admin/salt.*' ${SALT_USE_FILE} 2>/dev/null)" + SALT_USE_FLAGS="$(grep -E '^[<>=~]*app-admin/salt.*' "${SALT_USE_FILE}" 2>/dev/null)" SALT_USE_FLAG_LIBCLOUD="$(echo "${SALT_USE_FLAGS}" | grep ' libcloud' 2>/dev/null)" # Set the libcloud use flag, if it is not set yet if [ -z "${SALT_USE_FLAGS}" ]; then - echo "app-admin/salt libcloud" >> ${SALT_USE_FILE} + echo "app-admin/salt libcloud" >> "${SALT_USE_FILE}" elif [ -z "${SALT_USE_FLAG_LIBCLOUD}" ]; then - sed 's#^\([<>=~]*app-admin/salt[^ ]*\)\(.*\)#\1 libcloud\2#g' -i ${SALT_USE_FILE} + sed 's#^\([<>=~]*app-admin/salt[^ ]*\)\(.*\)#\1 libcloud\2#g' -i "${SALT_USE_FILE}" fi fi @@ -8651,7 +8855,7 @@ install_gentoo_git_deps() { fi # Salt <3000 does not automatically install dependencies. It has to be done manually. - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES:-} sys-apps/pciutils dev-python/pyyaml @@ -8672,7 +8876,7 @@ install_gentoo_git_deps() { fi # Install libcloud when Salt Cloud support was requested - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES:-} dev-python/libcloud" fi @@ -8699,19 +8903,19 @@ install_gentoo_stable() { fi # shellcheck disable=SC2086 - __autounmask ${GENTOO_SALT_PACKAGE} || return 1 + __autounmask "${GENTOO_SALT_PACKAGE}" || return 1 # shellcheck disable=SC2086 - __emerge ${GENTOO_SALT_PACKAGE} || return 1 + __emerge "${GENTOO_SALT_PACKAGE}" || return 1 } install_gentoo_git() { - _PYEXE=${_PY_EXE} + _PYEXE="${_PY_EXE}" if [ "$_PY_EXE" = "python3" ] || [ -z "$_PY_EXE" ]; then if [ "${GIT_REV}" = "v3000" ]; then # Salt Neon does not support Python 3.8 and greater _PYEXE=python3.7 - elif [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + elif [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then # Tornado 4.3 ebuild supports only Python 3.6, use Python 3.6 as the default Python 3 interpreter _PYEXE=python3.6 else @@ -8719,44 +8923,44 @@ install_gentoo_git() { fi fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PYEXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install || return 1 + "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 else - "${_PYEXE}" setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1 + "${_PYEXE}" setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 fi return 0 } install_gentoo_onedir() { - STABLE_REV=${ONEDIR_REV} + STABLE_REV="${ONEDIR_REV}" install_gentoo_stable || return 1 } install_gentoo_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if __check_command_exists systemctl ; then - systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( - systemctl preset salt-$fname.service > /dev/null 2>&1 && - systemctl enable salt-$fname.service > /dev/null 2>&1 + systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( + systemctl preset "salt-$fname.service" > /dev/null 2>&1 && + systemctl enable "salt-$fname.service" > /dev/null 2>&1 ) else # Salt minion cannot start in a docker container because the "net" service is not available - if [ $fname = "minion" ] && [ -f /.dockerenv ]; then - sed '/need net/d' -i /etc/init.d/salt-$fname + if [ "$fname" = "minion" ] && [ -f /.dockerenv ]; then + sed '/need net/d' -i "/etc/init.d/salt-$fname" fi rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 @@ -8767,11 +8971,11 @@ install_gentoo_post() { install_gentoo_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ $fname = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -8784,11 +8988,11 @@ install_gentoo_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue - systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( - systemctl preset salt-$fname.service > /dev/null 2>&1 && - systemctl enable salt-$fname.service > /dev/null 2>&1 + systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( + systemctl preset "salt-$fname.service" > /dev/null 2>&1 && + systemctl enable "salt-$fname.service" > /dev/null 2>&1 ) else cat <<_eof > "/etc/init.d/salt-${fname}" @@ -8807,7 +9011,7 @@ depend() { use net logger } _eof - chmod +x /etc/init.d/salt-$fname + chmod +x "/etc/init.d/salt-$fname" cat <<_eof > "/etc/conf.d/salt-${fname}" # /etc/conf.d/salt-${fname}: config file for /etc/init.d/salt-master @@ -8818,7 +9022,7 @@ SALT_OPTS="--log-level=warning" _eof # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 fi @@ -8832,7 +9036,7 @@ install_gentoo_onedir_post() { } install_gentoo_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return # Ensure upstart configs / systemd units are loaded if __check_command_exists systemctl ; then @@ -8841,25 +9045,25 @@ install_gentoo_restart_daemons() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if __check_command_exists systemctl ; then - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue + systemctl stop "salt-$fname" > /dev/null 2>&1 + systemctl start "salt-$fname.service" && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service + if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + systemctl status "salt-$fname.service" journalctl -xe fi else # Disable stdin to fix shell session hang on killing tee pipe - rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 - rc-service salt-$fname start < /dev/null || return 1 + rc-service "salt-$fname" stop < /dev/null > /dev/null 2>&1 + rc-service "salt-$fname" start < /dev/null || return 1 fi done @@ -8869,17 +9073,17 @@ install_gentoo_restart_daemons() { install_gentoo_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if __check_command_exists systemctl ; then - __check_services_systemd salt-$fname || return 1 + __check_services_systemd "salt-$fname" || return 1 else - __check_services_openrc salt-$fname || return 1 + __check_services_openrc "salt-$fname" || return 1 fi done @@ -8895,7 +9099,7 @@ install_gentoo_check_services() { # VoidLinux Install Functions # install_voidlinux_stable_deps() { - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then xbps-install -Suy || return 1 fi @@ -8914,54 +9118,54 @@ install_voidlinux_stable() { install_voidlinux_stable_post() { for fname in master minion syndic; do - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - ln -s /etc/sv/salt-$fname /var/service/. + ln -s "/etc/sv/salt-$fname" /var/service/. done } install_voidlinux_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return for fname in master minion syndic; do - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - sv restart salt-$fname + sv restart "salt-$fname" done } install_voidlinux_check_services() { for fname in master minion syndic; do - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - [ -e /var/service/salt-$fname ] || return 1 + [ -e "/var/service/salt-$fname" ] || return 1 done return 0 } daemons_running_voidlinux() { - [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 FAILED_DAEMONS=0 for fname in master minion syndic; do - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - if [ "$(sv status salt-$fname | grep run)" = "" ]; then + if [ "$(sv status "salt-$fname" | grep run)" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return $FAILED_DAEMONS + return "$FAILED_DAEMONS" } # # Ended VoidLinux Install Functions @@ -9050,13 +9254,13 @@ install_macosx_git_deps() { if ! echo "$PATH" | grep -q /usr/local/bin; then echowarn "/usr/local/bin was not found in \$PATH. Adding it for the duration of the script execution." - export PATH=/usr/local/bin:$PATH + export PATH="/usr/local/bin:$PATH" fi __fetch_url "/tmp/get-pip.py" "https://bootstrap.pypa.io/get-pip.py" || return 1 if [ -n "$_PY_EXE" ]; then - _PYEXE=${_PY_EXE} + _PYEXE="${_PY_EXE}" else _PYEXE=python2.7 fi @@ -9066,7 +9270,7 @@ install_macosx_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then return 0 fi @@ -9104,20 +9308,20 @@ install_macosx_onedir() { install_macosx_git() { if [ -n "$_PY_EXE" ]; then - _PYEXE=${_PY_EXE} + _PYEXE="${_PY_EXE}" else _PYEXE=python2.7 fi - if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then + if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/opt/salt || return 1 + $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/opt/salt || return 1 else - $_PYEXE setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/opt/salt || return 1 + $_PYEXE setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/opt/salt || return 1 fi return 0 @@ -9149,14 +9353,14 @@ install_macosx_git_post() { } install_macosx_restart_daemons() { - [ $_START_DAEMONS -eq $BS_FALSE ] && return + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then /bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1 /bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1 fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then /bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.master.plist || return 1 /bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist || return 1 fi @@ -9177,13 +9381,13 @@ config_salt() { # If the configuration directory is not passed, return [ "$_TEMP_CONFIG_DIR" = "null" ] && return - if [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then + if [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then echowarn "Passing -C (config only) option implies -F (forced overwrite)." - if [ "$_FORCE_OVERWRITE" -ne $BS_TRUE ]; then + if [ "$_FORCE_OVERWRITE" -ne "$BS_TRUE" ]; then echowarn "Overwriting configs in 11 seconds!" sleep 11 - _FORCE_OVERWRITE=$BS_TRUE + _FORCE_OVERWRITE="$BS_TRUE" fi fi @@ -9193,9 +9397,9 @@ config_salt() { # If -C or -F was passed, we don't need a .bak file for the config we're updating # This is used in the custom master/minion config file checks below - CREATE_BAK=$BS_TRUE - if [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then - CREATE_BAK=$BS_FALSE + CREATE_BAK="$BS_TRUE" + if [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then + CREATE_BAK="$BS_FALSE" fi CONFIGURED_ANYTHING=$BS_FALSE @@ -9204,11 +9408,11 @@ config_salt() { if [ -f "$_TEMP_CONFIG_DIR/grains" ]; then echodebug "Moving provided grains file from $_TEMP_CONFIG_DIR/grains to $_SALT_ETC_DIR/grains" __movefile "$_TEMP_CONFIG_DIR/grains" "$_SALT_ETC_DIR/grains" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ] || \ - [ "$_CONFIG_ONLY" -eq $BS_TRUE ] || [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then + if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ] || \ + [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ] || [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then # Create the PKI directory [ -d "$_PKI_DIR/minion" ] || (mkdir -p "$_PKI_DIR/minion" && chmod 700 "$_PKI_DIR/minion") || return 1 @@ -9217,51 +9421,51 @@ config_salt() { # Check if a minion config file already exists and move to .bak if needed if [ -f "$_SALT_ETC_DIR/minion" ] && [ "$CREATE_BAK" -eq "$BS_TRUE" ]; then - __movefile "$_SALT_ETC_DIR/minion" "$_SALT_ETC_DIR/minion.bak" $BS_TRUE || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + __movefile "$_SALT_ETC_DIR/minion" "$_SALT_ETC_DIR/minion.bak" "$BS_TRUE" || return 1 + CONFIGURED_ANYTHING="$BS_TRUE" fi # Overwrite/create the config file with the yaml string __overwriteconfig "$_SALT_ETC_DIR/minion" "$_CUSTOM_MINION_CONFIG" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" # Copy the minions configuration if found # Explicitly check for custom master config to avoid moving the minion config elif [ -f "$_TEMP_CONFIG_DIR/minion" ] && [ "$_CUSTOM_MASTER_CONFIG" = "null" ]; then __movefile "$_TEMP_CONFIG_DIR/minion" "$_SALT_ETC_DIR" "$_FORCE_OVERWRITE" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi # Copy the minion's keys if found if [ -f "$_TEMP_CONFIG_DIR/minion.pem" ]; then __movefile "$_TEMP_CONFIG_DIR/minion.pem" "$_PKI_DIR/minion/" "$_FORCE_OVERWRITE" || return 1 chmod 400 "$_PKI_DIR/minion/minion.pem" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi if [ -f "$_TEMP_CONFIG_DIR/minion.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/minion.pub" "$_PKI_DIR/minion/" "$_FORCE_OVERWRITE" || return 1 chmod 664 "$_PKI_DIR/minion/minion.pub" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi # For multi-master-pki, copy the master_sign public key if found if [ -f "$_TEMP_CONFIG_DIR/master_sign.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/master_sign.pub" "$_PKI_DIR/minion/" || return 1 chmod 664 "$_PKI_DIR/minion/master_sign.pub" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi fi # only (re)place master or syndic configs if -M (install master) or -S # (install syndic) specified - OVERWRITE_MASTER_CONFIGS=$BS_FALSE - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ] && [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then - OVERWRITE_MASTER_CONFIGS=$BS_TRUE + OVERWRITE_MASTER_CONFIGS="$BS_FALSE" + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then + OVERWRITE_MASTER_CONFIGS="$BS_TRUE" fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ] && [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then - OVERWRITE_MASTER_CONFIGS=$BS_TRUE + if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then + OVERWRITE_MASTER_CONFIGS="$BS_TRUE" fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ] || [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ] || [ "$OVERWRITE_MASTER_CONFIGS" -eq $BS_TRUE ] || [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then + if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ] || [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ] || [ "$OVERWRITE_MASTER_CONFIGS" -eq "$BS_TRUE" ] || [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then # Create the PKI directory [ -d "$_PKI_DIR/master" ] || (mkdir -p "$_PKI_DIR/master" && chmod 700 "$_PKI_DIR/master") || return 1 @@ -9270,34 +9474,34 @@ config_salt() { # Check if a master config file already exists and move to .bak if needed if [ -f "$_SALT_ETC_DIR/master" ] && [ "$CREATE_BAK" -eq "$BS_TRUE" ]; then - __movefile "$_SALT_ETC_DIR/master" "$_SALT_ETC_DIR/master.bak" $BS_TRUE || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + __movefile "$_SALT_ETC_DIR/master" "$_SALT_ETC_DIR/master.bak" "$BS_TRUE" || return 1 + CONFIGURED_ANYTHING="$BS_TRUE" fi # Overwrite/create the config file with the yaml string __overwriteconfig "$_SALT_ETC_DIR/master" "$_CUSTOM_MASTER_CONFIG" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" # Copy the masters configuration if found elif [ -f "$_TEMP_CONFIG_DIR/master" ]; then __movefile "$_TEMP_CONFIG_DIR/master" "$_SALT_ETC_DIR" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi - # Copy the master's keys if found + # Copy the masters keys if found if [ -f "$_TEMP_CONFIG_DIR/master.pem" ]; then __movefile "$_TEMP_CONFIG_DIR/master.pem" "$_PKI_DIR/master/" || return 1 chmod 400 "$_PKI_DIR/master/master.pem" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi if [ -f "$_TEMP_CONFIG_DIR/master.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/master.pub" "$_PKI_DIR/master/" || return 1 chmod 664 "$_PKI_DIR/master/master.pub" || return 1 - CONFIGURED_ANYTHING=$BS_TRUE + CONFIGURED_ANYTHING="$BS_TRUE" fi fi - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then # Recursively copy salt-cloud configs with overwriting if necessary for file in "$_TEMP_CONFIG_DIR"/cloud*; do if [ -f "$file" ]; then @@ -9314,7 +9518,7 @@ config_salt() { done fi - if [ "$_CONFIG_ONLY" -eq $BS_TRUE ] && [ $CONFIGURED_ANYTHING -eq $BS_FALSE ]; then + if [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ] && [ "$CONFIGURED_ANYTHING" -eq "$BS_FALSE" ]; then echowarn "No configuration or keys were copied over. No configuration was done!" exit 0 fi @@ -9366,17 +9570,17 @@ preseed_master() { # This function checks if all of the installed daemons are running or not. # daemons_running_onedir() { - [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f "/opt/saltstack/salt/run/run" ]; then salt_path="/opt/saltstack/salt/run/run ${fname}" @@ -9390,7 +9594,7 @@ daemons_running_onedir() { fi done - return $FAILED_DAEMONS + return "$FAILED_DAEMONS" } # @@ -9403,31 +9607,31 @@ daemons_running_onedir() { # This function checks if all of the installed daemons are running or not. # daemons_running() { - [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 + [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue # shellcheck disable=SC2009 if [ "${DISTRO_NAME}" = "SmartOS" ]; then - if [ "$(svcs -Ho STA salt-$fname)" != "ON" ]; then + if [ "$(svcs -Ho STA "salt-$fname")" != "ON" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi - elif [ "$(ps wwwaux | grep -v grep | grep salt-$fname)" = "" ]; then + elif [ "$(ps wwwaux | grep -v grep | grep "salt-$fname")" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return $FAILED_DAEMONS + return "${FAILED_DAEMONS}" } # # Ended daemons running check function @@ -9440,7 +9644,7 @@ daemons_running() { # Let's get the dependencies install function DEP_FUNC_NAMES="" -if [ ${_NO_DEPS} -eq $BS_FALSE ]; then +if [ ${_NO_DEPS} -eq "$BS_FALSE" ]; then DEP_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_deps" DEP_FUNC_NAMES="$DEP_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_deps" DEP_FUNC_NAMES="$DEP_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_deps" @@ -9450,9 +9654,9 @@ if [ ${_NO_DEPS} -eq $BS_FALSE ]; then fi DEPS_INSTALL_FUNC="null" -for FUNC_NAME in $(__strip_duplicates "$DEP_FUNC_NAMES"); do - if __function_defined "$FUNC_NAME"; then - DEPS_INSTALL_FUNC="$FUNC_NAME" +for FUNC_NAME in $(__strip_duplicates "${DEP_FUNC_NAMES}"); do + if __function_defined "${FUNC_NAME}"; then + DEPS_INSTALL_FUNC="${FUNC_NAME}" break fi done @@ -9460,17 +9664,17 @@ echodebug "DEPS_INSTALL_FUNC=${DEPS_INSTALL_FUNC}" # Let's get the Salt config function CONFIG_FUNC_NAMES="config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}_salt" -CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}_${ITYPE}_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}_salt" +CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_salt" CONFIG_SALT_FUNC="null" -for FUNC_NAME in $(__strip_duplicates "$CONFIG_FUNC_NAMES"); do - if __function_defined "$FUNC_NAME"; then - CONFIG_SALT_FUNC="$FUNC_NAME" +for FUNC_NAME in $(__strip_duplicates "${CONFIG_FUNC_NAMES}"); do + if __function_defined "${FUNC_NAME}"; then + CONFIG_SALT_FUNC="${FUNC_NAME}" break fi done @@ -9562,7 +9766,7 @@ for FUNC_NAME in $(__strip_duplicates "$DAEMONS_RUNNING_FUNC_NAMES"); do done echodebug "DAEMONS_RUNNING_FUNC=${DAEMONS_RUNNING_FUNC}" -# Let's get the check services function +# Lets get the check services function 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" @@ -9595,17 +9799,17 @@ fi # Install dependencies -if [ ${_NO_DEPS} -eq $BS_FALSE ] && [ $_CONFIG_ONLY -eq $BS_FALSE ]; then +if [ "${_NO_DEPS}" -eq "$BS_FALSE" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then # Only execute function is not in config mode only echoinfo "Running ${DEPS_INSTALL_FUNC}()" - if ! ${DEPS_INSTALL_FUNC}; then + if ! "${DEPS_INSTALL_FUNC}"; then echoerror "Failed to run ${DEPS_INSTALL_FUNC}()!!!" exit 1 fi fi -if [ "${ITYPE}" = "git" ] && [ ${_NO_DEPS} -eq ${BS_TRUE} ]; then +if [ "${ITYPE}" = "git" ] && [ "${_NO_DEPS}" -eq "${BS_TRUE}" ]; then if ! __git_clone_and_checkout; then echo "Failed to clone and checkout git repository." exit 1 @@ -9619,7 +9823,7 @@ if [ "$_CUSTOM_MASTER_CONFIG" != "null" ] || [ "$_CUSTOM_MINION_CONFIG" != "null _TEMP_CONFIG_DIR="$_SALT_ETC_DIR" fi - if [ ${_NO_DEPS} -eq $BS_FALSE ] && [ $_CONFIG_ONLY -eq $BS_TRUE ]; then + if [ "${_NO_DEPS}" -eq "$BS_FALSE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then # Execute function to satisfy dependencies for configuration step echoinfo "Running ${DEPS_INSTALL_FUNC}()" if ! ${DEPS_INSTALL_FUNC}; then @@ -9642,7 +9846,7 @@ fi if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then [ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d" cat <<_eof > "$_SALT_ETC_DIR/minion.d/99-master-address.conf" -master: $_SALT_MASTER_ADDRESS +master: "$_SALT_MASTER_ADDRESS" _eof fi @@ -9655,78 +9859,78 @@ fi # Pre-seed master keys if [ "$PRESEED_MASTER_FUNC" != "null" ] && [ "$_TEMP_KEYS_DIR" != "null" ]; then echoinfo "Running ${PRESEED_MASTER_FUNC}()" - if ! ${PRESEED_MASTER_FUNC}; then + if ! "${PRESEED_MASTER_FUNC}"; then echoerror "Failed to run ${PRESEED_MASTER_FUNC}()!!!" exit 1 fi fi # Install Salt -if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then +if [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then # Only execute function is not in config mode only echoinfo "Running ${INSTALL_FUNC}()" - if ! ${INSTALL_FUNC}; then + if ! "${INSTALL_FUNC}"; then echoerror "Failed to run ${INSTALL_FUNC}()!!!" exit 1 fi fi # Run any post install function. Only execute function if not in config mode only -if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then +if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then echoinfo "Running ${POST_INSTALL_FUNC}()" - if ! ${POST_INSTALL_FUNC}; then + if ! "${POST_INSTALL_FUNC}"; then echoerror "Failed to run ${POST_INSTALL_FUNC}()!!!" exit 1 fi fi # Run any check services function, Only execute function if not in config mode only -if [ "$CHECK_SERVICES_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then +if [ "$CHECK_SERVICES_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then echoinfo "Running ${CHECK_SERVICES_FUNC}()" - if ! ${CHECK_SERVICES_FUNC}; then + if ! "${CHECK_SERVICES_FUNC}"; then echoerror "Failed to run ${CHECK_SERVICES_FUNC}()!!!" exit 1 fi fi # Run any start daemons function -if [ "$STARTDAEMONS_INSTALL_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; then +if [ "$STARTDAEMONS_INSTALL_FUNC" != "null" ] && [ "${_START_DAEMONS}" -eq "$BS_TRUE" ]; then echoinfo "Running ${STARTDAEMONS_INSTALL_FUNC}()" echodebug "Waiting ${_SLEEP} seconds for processes to settle before checking for them" - sleep ${_SLEEP} - if ! ${STARTDAEMONS_INSTALL_FUNC}; then + sleep "${_SLEEP}" + if ! "${STARTDAEMONS_INSTALL_FUNC}"; then echoerror "Failed to run ${STARTDAEMONS_INSTALL_FUNC}()!!!" exit 1 fi fi # Check if the installed daemons are running or not -if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; then +if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ "${_START_DAEMONS}" -eq "$BS_TRUE" ]; then echoinfo "Running ${DAEMONS_RUNNING_FUNC}()" echodebug "Waiting ${_SLEEP} seconds for processes to settle before checking for them" - sleep ${_SLEEP} # Sleep a little bit to let daemons start - if ! ${DAEMONS_RUNNING_FUNC}; then + sleep "${_SLEEP}" # Sleep a little bit to let daemons start + if ! "${DAEMONS_RUNNING_FUNC}"; then echoerror "Failed to run ${DAEMONS_RUNNING_FUNC}()!!!" for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + [ "$fname" = "api" ] && continue # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - if [ "$_ECHO_DEBUG" -eq $BS_FALSE ]; then + if [ "$_ECHO_DEBUG" -eq "$BS_FALSE" ]; then echoerror "salt-$fname was not found running. Pass '-D' to ${__ScriptName} when bootstrapping for additional debugging information..." continue fi - [ ! -f "$_SALT_ETC_DIR/$fname" ] && [ $fname != "syndic" ] && echodebug "$_SALT_ETC_DIR/$fname does not exist" + [ ! -f "$_SALT_ETC_DIR/$fname" ] && [ "$fname" != "syndic" ] && echodebug "$_SALT_ETC_DIR/$fname does not exist" echodebug "Running salt-$fname by hand outputs: $(nohup salt-$fname -l debug)" - [ ! -f /var/log/salt/$fname ] && echodebug "/var/log/salt/$fname does not exist. Can't cat its contents!" && continue + [ ! -f "/var/log/salt/$fname" ] && echodebug "/var/log/salt/$fname does not exist. Can't cat its contents!" && continue echodebug "DAEMON LOGS for $fname:" echodebug "$(cat /var/log/salt/$fname)" @@ -9746,7 +9950,7 @@ if [ "$_AUTO_ACCEPT_MINION_KEYS" -eq "$BS_TRUE" ]; then fi # Done! -if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then +if [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then echoinfo "Salt installed!" else echoinfo "Salt configured!" From e77e9227d42a8b2cbccd9400f3c30f98d69058a1 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 2 Feb 2024 17:57:31 -0700 Subject: [PATCH 05/80] Initial removal of support for Python 2.7, and pre-Neon support (since assumption is they are Python 2 mostly) --- bootstrap-salt.sh | 1483 ++++++++++++++++++++++++--------------------- 1 file changed, 778 insertions(+), 705 deletions(-) mode change 100755 => 100644 bootstrap-salt.sh diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh old mode 100755 new mode 100644 index 1362dbb..16c4db8 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -15,7 +15,7 @@ # # BUGS: https://github.com/saltstack/salt-bootstrap/issues # -# COPYRIGHT: (c) 2012-2022 by the SaltStack Team, see AUTHORS.rst for more +# COPYRIGHT: (c) 2012-2024 by the SaltStack Team, see AUTHORS.rst for more # details. # # LICENSE: Apache 2.0 @@ -327,8 +327,8 @@ __usage() { - ${__ScriptName} stable 3006.1 - ${__ScriptName} testing - ${__ScriptName} git - - ${__ScriptName} git 2017.7 - - ${__ScriptName} git v2017.7.2 + - ${__ScriptName} git 3006.4 + - ${__ScriptName} git v3006.6 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 - ${__ScriptName} onedir - ${__ScriptName} onedir 3006 @@ -416,16 +416,16 @@ __usage() { -V Install Salt into virtualenv (only available for Ubuntu based distributions) -x Changes the Python version used to install Salt. - For CentOS 6 git installations python2.7 is supported. - Fedora git installation, CentOS 7, Ubuntu 18.04 support python3. + Python 2.7 is no longer supported. + Fedora git installation, CentOS 7, Ubuntu 1820.04 support python3. -X Do not start daemons after installation -y Installs a different python version on host. Currently this has only been - tested with CentOS 6 and is considered experimental. This will install the + tested with CentOS 7 and is considered experimental. This will install the ius repo on the box if disable repo is false. This must be used in conjunction with -x . For example: - sh bootstrap.sh -P -y -x python2.7 git v2017.7.2 - The above will install python27 and install the git version of salt using the - python2.7 executable. This only works for git and pip installations. + sh bootstrap.sh -P -y -x python3.8 git v3006.3 + The above will install python38 and install the git version of salt using the + python3.8 executable. This only works for git and pip installations. EOT } # ---------- end of function __usage ---------- @@ -810,9 +810,14 @@ if [ -n "$_PY_EXE" ]; then fi _PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7) - if [ "$_PY_MAJOR_VERSION" != 3 ] && [ "$_PY_MAJOR_VERSION" != 2 ]; then - echoerror "Detected -x option, but Python major version is not 2 or 3." - echoerror "The -x option must be passed as python2, python27, or python2.7 (or use the Python '3' versions of examples)." + if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + fi + + if [ "$_PY_MAJOR_VERSION" != 3 ]; then + echoerror "Detected -x option, but Python major version is not 3." + echoerror "The -x option must be passed as python3, python38, or python3.8 (use the Python '3' versions of examples)." exit 1 fi @@ -1960,7 +1965,7 @@ if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then fi if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then - echoinfo "Installing salt-cloud and required python-libcloud package" + echoinfo "Installing salt-cloud and required python3-libcloud package" fi if [ $_START_DAEMONS -eq $BS_FALSE ]; then @@ -2044,6 +2049,9 @@ if [ "$ITYPE" = "git" ]; then echo sleep 10 _PIP_ALLOWED=$BS_TRUE + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi fi @@ -2516,10 +2524,13 @@ __overwriteconfig() { if [ -n "$_PY_EXE" ]; then good_python="$_PY_EXE" # If python does not have yaml installed we're on Arch and should use python2 + # but no more support, hence error out elif python -c "import yaml" 2> /dev/null; then good_python=python else - good_python=python2 + ## good_python=python2 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Convert json string to a yaml string and write it to config file. Output is dumped into tempfile. @@ -2738,20 +2749,21 @@ __activate_virtualenv() { #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __install_pip_pkgs # DESCRIPTION: Return 0 or 1 if successfully able to install pip packages. Can provide a different python version to -# install pip packages with. If $py_ver is not specified it will use the default python version. +# install pip packages with. If $py_ver is not specified it will use the default python3 version. # PARAMETERS: pkgs, py_ver, upgrade #---------------------------------------------------------------------------------------------------------------------- __install_pip_pkgs() { _pip_pkgs="$1" _py_exe="$2" - _py_pkg=$(echo "$_py_exe" | sed -E "s/\\.//g") - _pip_cmd="${_py_exe} -m pip" if [ "${_py_exe}" = "" ]; then - _py_exe='python' + _py_exe='python3' fi + _py_pkg=$(echo "$_py_exe" | sed -E "s/\\.//g") + _pip_cmd="${_py_exe} -m pip" + __check_pip_allowed # Install pip and pip dependencies @@ -2834,7 +2846,7 @@ __install_salt_from_repo_post_neon() { _py_exe="$1" if [ "${_py_exe}" = "" ]; then - _py_exe='python' + _py_exe='python3' fi echodebug "__install_salt_from_repo_post_neon py_exe=$_py_exe" @@ -2875,7 +2887,7 @@ except ImportError: EOM ) if ! ${_py_exe} -c "$CHECK_PIP_VERSION_SCRIPT"; then - # Upgrade pip to at least 1.2 which is when we can start using "python -m pip" + # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip" if [ "${_py_version}" = "3.5" ]; then echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION},<21.0'" ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION},<21.0" @@ -2904,7 +2916,10 @@ EOM _setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}" if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then # We also lock setuptools to <45 which is the latest release to support both py2 and py3 - _setuptools_dep="${_setuptools_dep},<45" + ## DGM how did we get here, should have errored out before + ## _setuptools_dep="${_setuptools_dep},<45" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" @@ -2965,18 +2980,10 @@ EOM } # ---------- end of function __install_salt_from_repo_post_neon ---------- -if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # shellcheck disable=SC2268 - if [ "x${_PY_MAJOR_VERSION}" = "x" ]; then - # Default to python 2 for pre Neon installs - _PY_MAJOR_VERSION=2 - fi -else - # shellcheck disable=SC2268 - if [ "x${_PY_MAJOR_VERSION}" = "x" ]; then - # Default to python 3 for post Neon install - _PY_MAJOR_VERSION=3 - fi +# shellcheck disable=SC2268 +if [ "x${_PY_MAJOR_VERSION}" = "x" ]; then + # Default to python 3 for post Neon install + _PY_MAJOR_VERSION=3 fi ####################################################################################################################### @@ -3191,15 +3198,20 @@ install_ubuntu_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then PY_PKG_VER=3 else - PY_PKG_VER="" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "$DISTRO_MAJOR_VERSION" -ge 16 ] && [ -z "$_PY_EXE" ]; then - __PACKAGES="${__PACKAGES} python2.7" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "$_VIRTUALENV_DIR" != "null" ]; then __PACKAGES="${__PACKAGES} python-virtualenv" + # TBD DGM - implies Python 2, need check + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Need python-apt for managing packages via Salt __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt" @@ -3279,58 +3291,16 @@ install_ubuntu_git_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then PY_PKG_VER=3 else - PY_PKG_VER="" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - __PACKAGES="" - - # See how we are installing packages - if [ "${_PIP_ALL}" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python-dev swig libssl-dev libzmq3 libzmq3-dev" - - if ! __check_command_exists pip; then - __PACKAGES="${__PACKAGES} python-setuptools python-pip" - fi - - # Get just the apt packages that are required to build all the pythons - # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 - # Install the pythons from requirements (only zmq for now) - __install_pip_deps "${_SALT_GIT_CHECKOUT_DIR}/requirements/zeromq.txt" || return 1 - else - install_ubuntu_stable_deps || return 1 - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PACKAGES="${__PACKAGES} python3-setuptools" - else - # There is no m2crypto package for Py3 at this time - only install for Py2 - __PACKAGES="${__PACKAGES} python-m2crypto" - fi - - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-zmq" - __PACKAGES="${__PACKAGES} python-concurrent.futures" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - # Install python-libcloud if asked to - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" - fi - - # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 - fi - else - __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - if [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then - __PACKAGES="${__PACKAGES} g++" - fi - # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + if [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then + __PACKAGES="${__PACKAGES} g++" fi + # shellcheck disable=SC2086 + __apt_get_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -3410,16 +3380,17 @@ install_ubuntu_git() { if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} else - _PYEXE=python2.7 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then # We can use --prefix on debian based ditributions - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - else - _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" - fi + ### DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ### DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ### DGM else + ### DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" + ### DGM fi _POST_NEON_PIP_INSTALL_ARGS="" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -3433,6 +3404,9 @@ install_ubuntu_git() { sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then @@ -3850,24 +3824,10 @@ install_debian_git_deps() { PY_PKG_VER="" fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname" - __PACKAGES="${__PACKAGES} python-crypto python-jinja2 python-msgpack python-m2crypto" - __PACKAGES="${__PACKAGES} python-requests python-tornado python-yaml python-zmq" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - # Install python-libcloud if asked to - __PACKAGES="${__PACKAGES} python-libcloud" - fi - - # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 - else - __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - echodebug "install_debian_git_deps() Installing ${__PACKAGES}" - # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 - fi + __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + echodebug "install_debian_git_deps() Installing ${__PACKAGES}" + # shellcheck disable=SC2086 + __apt_get_install_noinput "${__PACKAGES}" || return 1 return 0 } @@ -3885,69 +3845,72 @@ install_debian_8_git_deps() { echodebug "CALLING install_debian_git_deps" install_debian_git_deps || return 1 return 0 - fi - - install_debian_deps || return 1 - - if ! __check_command_exists git; then - __apt_get_install_noinput git || return 1 - fi - - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - __apt_get_install_noinput ca-certificates - fi - - __git_clone_and_checkout || return 1 - - __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2" - __PACKAGES="${__PACKAGES} python-m2crypto python-msgpack python-requests python-systemd" - __PACKAGES="${__PACKAGES} python-yaml python-zmq python-concurrent.futures" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - # Install python-libcloud if asked to - __PACKAGES="${__PACKAGES} python-libcloud" - fi - - __PIP_PACKAGES='' - if (__check_pip_allowed >/dev/null 2>&1); then - __PIP_PACKAGES='tornado<5.0' - # Install development environment for building tornado Python module - __PACKAGES="${__PACKAGES} build-essential python-dev" - - if ! __check_command_exists pip; then - __PACKAGES="${__PACKAGES} python-pip" - fi - # Attempt to configure backports repo on non-x86_64 system - elif [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] && [ "$DPKG_ARCHITECTURE" != "amd64" ]; then - # Check if Debian Backports repo already configured - if ! apt-cache policy | grep -q 'Debian Backports'; then - echo 'deb http://httpredir.debian.org/debian jessie-backports main' > \ - /etc/apt/sources.list.d/backports.list - fi - - __wait_for_apt apt-get update || return 1 - - # python-tornado package should be installed from backports repo - __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado/jessie-backports" else - __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM install_debian_deps || return 1 - if [ "${__PIP_PACKAGES}" != "" ]; then - # shellcheck disable=SC2086,SC2090 - pip install -U "${__PIP_PACKAGES}" || return 1 - fi + ## DGM if ! __check_command_exists git; then + ## DGM __apt_get_install_noinput git || return 1 + ## DGM fi - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi + ## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + ## DGM __apt_get_install_noinput ca-certificates + ## DGM fi - return 0 + ## DGM __git_clone_and_checkout || return 1 + + ## DGM __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2" + ## DGM __PACKAGES="${__PACKAGES} python-m2crypto python-msgpack python-requests python-systemd" + ## DGM __PACKAGES="${__PACKAGES} python-yaml python-zmq python-concurrent.futures" + + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM # Install python-libcloud if asked to + ## DGM __PACKAGES="${__PACKAGES} python-libcloud" + ## DGM fi + + ## DGM __PIP_PACKAGES='' + ## DGM if (__check_pip_allowed >/dev/null 2>&1); then + ## DGM __PIP_PACKAGES='tornado<5.0' + ## DGM # Install development environment for building tornado Python module + ## DGM __PACKAGES="${__PACKAGES} build-essential python-dev" + + ## DGM if ! __check_command_exists pip; then + ## DGM __PACKAGES="${__PACKAGES} python-pip" + ## DGM fi + ## DGM # Attempt to configure backports repo on non-x86_64 system + ## DGM elif [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] && [ "$DPKG_ARCHITECTURE" != "amd64" ]; then + ## DGM # Check if Debian Backports repo already configured + ## DGM if ! apt-cache policy | grep -q 'Debian Backports'; then + ## DGM echo 'deb http://httpredir.debian.org/debian jessie-backports main' > \ + ## DGM /etc/apt/sources.list.d/backports.list + ## DGM fi + + ## DGM __wait_for_apt apt-get update || return 1 + + ## DGM # python-tornado package should be installed from backports repo + ## DGM __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado/jessie-backports" + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado" + ## DGM fi + + ## DGM # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + + ## DGM if [ "${__PIP_PACKAGES}" != "" ]; then + ## DGM # shellcheck disable=SC2086,SC2090 + ## DGM pip install -U "${__PIP_PACKAGES}" || return 1 + ## DGM fi + + ## DGM # Let's trigger config_salt() + ## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then + ## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + ## DGM CONFIG_SALT_FUNC="config_salt" + ## DGM fi + + ## DGM return 0 } install_debian_9_git_deps() { @@ -3955,35 +3918,38 @@ install_debian_9_git_deps() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then install_debian_git_deps || return 1 return 0 - fi - - install_debian_deps || return 1 - install_debian_git_pre || return 1 - - __PACKAGES="libzmq5 lsb-release" - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 else - PY_PKG_VER="" - - # These packages are PY2-ONLY - __PACKAGES="${__PACKAGES} python-backports-abc python-m2crypto python-concurrent.futures" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-systemd" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" + ## DGM install_debian_deps || return 1 + ## DGM install_debian_git_pre || return 1 - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - # Install python-libcloud if asked to - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" - fi + ## DGM __PACKAGES="libzmq5 lsb-release" - # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM PY_PKG_VER=3 + ## DGM else + ## DGM PY_PKG_VER="" - return 0 + ## DGM # These packages are PY2-ONLY + ## DGM __PACKAGES="${__PACKAGES} python-backports-abc python-m2crypto python-concurrent.futures" + ## DGM fi + + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-systemd" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" + + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM # Install python-libcloud if asked to + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" + ## DGM fi + + ## DGM # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 + + ## DGM return 0 } install_debian_10_git_deps() { @@ -3991,29 +3957,32 @@ install_debian_10_git_deps() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then install_debian_git_deps || return 1 return 0 - fi - - install_debian_deps || return 1 - install_debian_git_pre || return 1 - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - _py=${_PY_EXE} - PY_PKG_VER=3 - __PACKAGES="python${PY_PKG_VER}-distutils" else - _py="python" - PY_PKG_VER="" - __PACKAGES="" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - __install_tornado_pip "${_py}" || return 1 - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-jinja2" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" + ## DGM install_debian_deps || return 1 + ## DGM install_debian_git_pre || return 1 - # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM _py=${_PY_EXE} + ## DGM PY_PKG_VER=3 + ## DGM __PACKAGES="python${PY_PKG_VER}-distutils" + ## DGM else + ## DGM _py="python" + ## DGM PY_PKG_VER="" + ## DGM __PACKAGES="" + ## DGM fi - return 0 + ## DGM __install_tornado_pip "${_py}" || return 1 + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-jinja2" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" + + ## DGM # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + + ## DGM return 0 } install_debian_stable() { @@ -4057,16 +4026,18 @@ install_debian_git() { if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} else - _PYEXE=python + ## _PYEXE=python + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then # We can use --prefix on debian based ditributions - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - else - _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" - fi + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM else + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM fi _POST_NEON_PIP_INSTALL_ARGS="" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -4080,6 +4051,9 @@ install_debian_git() { sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then @@ -4389,7 +4363,9 @@ install_fedora_git_deps() { # Packages are named python3- PY_PKG_VER=3 else - PY_PKG_VER=2 + ## DGM PY_PKG_VER=2 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi __PACKAGES="" @@ -4424,15 +4400,19 @@ install_fedora_git_deps() { __python="python3" fi elif [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - if __check_command_exists python2; then - __python="python2" - fi + ## DGM how did that get set + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + ## DGM if __check_command_exists python2; then + ## DGM __python="python2" + ## DGM fi else if ! __check_command_exists python; then echoerror "Unable to find a python binary?!" return 1 fi # Let's hope it's the right one + ## TBD DGM check if Fedora has made python equiv. to python3 __python="python" fi @@ -4464,7 +4444,9 @@ install_fedora_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - _PYEXE='python2' + ## DGM _PYEXE='python2' + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then @@ -4706,6 +4688,9 @@ __install_saltstack_rhel_onedir_repository() { __PY_VERSION_REPO="yum" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PY_VERSION_REPO="py3" + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Avoid using '$releasever' variable for yum. @@ -4794,22 +4779,30 @@ install_centos_stable_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PACKAGES="${__PACKAGES} python3-pyyaml python3-setuptools" else - __PACKAGES="${__PACKAGES} python2-pyyaml" + ## DGM __PACKAGES="${__PACKAGES} python2-pyyaml" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi elif [ "$DISTRO_MAJOR_VERSION" -eq 7 ]; then # YAML module is used for generating custom master/minion configs if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PACKAGES="${__PACKAGES} python36-PyYAML python36-setuptools" else - __PACKAGES="${__PACKAGES} PyYAML" + ## DGM __PACKAGES="${__PACKAGES} PyYAML" + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi else - # YAML module is used for generating custom master/minion configs - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PACKAGES="${__PACKAGES} python34-PyYAML python34-setuptools" - else - __PACKAGES="${__PACKAGES} PyYAML" - fi + ## DGM what is going on here, Python 3.4 is long dead on RHEL 7 + ## was this for RHEL 6 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + ## DGM # YAML module is used for generating custom master/minion configs + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM __PACKAGES="${__PACKAGES} python34-PyYAML python34-setuptools" + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} PyYAML" + ## DGM fi fi fi @@ -4921,97 +4914,110 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python36" fi else - PY_PKG_VER="" - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="${__PACKAGES} python2" - elif [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then - PY_PKG_VER=27 - __PACKAGES="${__PACKAGES} python27" - else - __PACKAGES="${__PACKAGES} python" - fi + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + + ## DGM PY_PKG_VER="" + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="${__PACKAGES} python2" + ## DGM elif [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then + ## DGM PY_PKG_VER=27 + ## DGM __PACKAGES="${__PACKAGES} python27" + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} python" + ## DGM fi fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - _install_m2crypto_req=false - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - _py=${_PY_EXE} - if [ "$DISTRO_MAJOR_VERSION" -gt 6 ]; then - _install_m2crypto_req=true - fi - else - if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then - _install_m2crypto_req=true - fi - _py="python" + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## DGM _install_m2crypto_req=false + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM _py=${_PY_EXE} + ## DGM if [ "$DISTRO_MAJOR_VERSION" -gt 6 ]; then + ## DGM _install_m2crypto_req=true + ## DGM fi + ## DGM else + ## DGM if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then + ## DGM _install_m2crypto_req=true + ## DGM fi + ## DGM _py="python" - # Only Py2 needs python-futures - __PACKAGES="${__PACKAGES} python-futures" + ## DGM # Only Py2 needs python-futures + ## DGM __PACKAGES="${__PACKAGES} python-futures" - # There is no systemd-python3 package as of this writing - if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then - __PACKAGES="${__PACKAGES} systemd-python" - fi - fi + ## DGM # There is no systemd-python3 package as of this writing + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then + ## DGM __PACKAGES="${__PACKAGES} systemd-python" + ## DGM fi + ## DGM fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __install_tornado_pip "${_py}" || return 1 - __PACKAGES="${__PACKAGES} python3-m2crypto" - else - __PACKAGES="${__PACKAGES} m2crypto python${PY_PKG_VER}-crypto" - fi + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __install_tornado_pip "${_py}" || return 1 + ## DGM __PACKAGES="${__PACKAGES} python3-m2crypto" + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} m2crypto python${PY_PKG_VER}-crypto" + ## DGM fi - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-jinja2" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-zmq" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-jinja2" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-zmq" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" - fi + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" + ## DGM fi - if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ]; then - # Install Python if "-y" was passed in. - __install_python || return 1 - fi + ## DGM if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ]; then + ## DGM # Install Python if "-y" was passed in. + ## DGM __install_python || return 1 + ## DGM fi - if [ "${_PY_EXE}" != "" ] && [ "$_PIP_ALLOWED" -eq "$BS_TRUE" ]; then - # If "-x" is defined, install dependencies with pip based on the Python version given. - _PIP_PACKAGES="m2crypto!=0.33.0 jinja2 msgpack-python pycrypto PyYAML tornado<5.0 zmq futures>=2.0" + ## DGM if [ "${_PY_EXE}" != "" ] && [ "$_PIP_ALLOWED" -eq "$BS_TRUE" ]; then + ## DGM # If "-x" is defined, install dependencies with pip based on the Python version given. + ## DGM _PIP_PACKAGES="m2crypto!=0.33.0 jinja2 msgpack-python pycrypto PyYAML tornado<5.0 zmq futures>=2.0" - # install swig and openssl on cent6 - if "$_install_m2crypto_req"; then - __yum_install_noinput openssl-devel swig || return 1 - fi + ## DGM # install swig and openssl on cent6 + ## DGM if "$_install_m2crypto_req"; then + ## DGM __yum_install_noinput openssl-devel swig || return 1 + ## DGM fi - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # Filter out any commented lines from the requirements file - _REQ_LINES="$(grep '^[^#]' "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - for SINGLE_PACKAGE in ${_PIP_PACKAGES}; do - __REQUIRED_VERSION="$(grep "${SINGLE_PACKAGE}" "${_REQ_LINES}")" - if [ "${__REQUIRED_VERSION}" != "" ]; then - _PIP_PACKAGES=$(echo "$_PIP_PACKAGES" | sed "s/${SINGLE_PACKAGE}/${__REQUIRED_VERSION}/") - fi - done - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # Filter out any commented lines from the requirements file + ## DGM _REQ_LINES="$(grep '^[^#]' "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM for SINGLE_PACKAGE in ${_PIP_PACKAGES}; do + ## DGM __REQUIRED_VERSION="$(grep "${SINGLE_PACKAGE}" "${_REQ_LINES}")" + ## DGM if [ "${__REQUIRED_VERSION}" != "" ]; then + ## DGM _PIP_PACKAGES=$(echo "$_PIP_PACKAGES" | sed "s/${SINGLE_PACKAGE}/${__REQUIRED_VERSION}/") + ## DGM fi + ## DGM done + ## DGM fi - if [ "$_INSTALL_CLOUD" -eq "${BS_TRUE}" ]; then - _PIP_PACKAGES="${_PIP_PACKAGES} apache-libcloud" - fi + ## DGM if [ "$_INSTALL_CLOUD" -eq "${BS_TRUE}" ]; then + ## DGM _PIP_PACKAGES="${_PIP_PACKAGES} apache-libcloud" + ## DGM fi - __install_pip_pkgs "${_PIP_PACKAGES}" "${_PY_EXE}" || return 1 - else - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - else - if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then - # Install Python if "-y" was passed in. - __install_python || return 1 - fi - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __install_pip_pkgs "${_PIP_PACKAGES}" "${_PY_EXE}" || return 1 + ## DGM else + ## DGM # shellcheck disable=SC2086 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM fi + ## DGM else + ## DGM if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then + ## DGM # Install Python if "-y" was passed in. + ## DGM __install_python || return 1 + ## DGM fi + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + ## DGM # shellcheck disable=SC2086 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM fi + + ## DGM new code + if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then + # Install Python if "-y" was passed in. + __install_python || return 1 fi + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -5027,13 +5033,18 @@ install_centos_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - _PYEXE='python2' + ## DGM_PYEXE='python2' + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi echodebug "_PY_EXE: $_PY_EXE" if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then @@ -5046,7 +5057,7 @@ install_centos_git() { } install_centos_git_post() { - SYSTEMD_RELOAD=$BS_FALSE + SYSTEMD_RELOAD="$BS_FALSE" for fname in api master minion syndic; do # Skip if not meant to be installed @@ -5980,17 +5991,19 @@ install_alpine_linux_git_deps() { __git_clone_and_checkout || return 1 if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - apk -U add python2 py-virtualenv py2-crypto py2-m2crypto py2-setuptools \ - py2-jinja2 py2-yaml py2-markupsafe py2-msgpack py2-psutil \ - py2-zmq zeromq py2-requests || return 1 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + ## DGM apk -U add python2 py-virtualenv py2-crypto py2-m2crypto py2-setuptools \ + ## DGM py2-jinja2 py2-yaml py2-markupsafe py2-msgpack py2-psutil \ + ## DGM py2-zmq zeromq py2-requests || return 1 - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - apk -U add py2-tornado || return 1 - fi - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # We're on the master branch, install whichever tornado is on the requirements file + ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then + ## DGM apk -U add py2-tornado || return 1 + ## DGM fi + ## DGM fi else apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc || return 1 _PY_EXE=python3 @@ -6030,13 +6043,16 @@ install_alpine_linux_git() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 - else - python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then + ## DGM python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 + ## DGM else + ## DGM python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 + ## DGM fi } install_alpine_linux_post() { @@ -6136,188 +6152,188 @@ daemons_running_alpine_linux() { # Amazon Linux AMI Install Functions # -# Support for Amazon Linux (EOL) -install_amazon_linux_ami_deps() { - # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS="$BS_FALSE" - pkg_append="python" - - if [ "$ITYPE" = "stable" ]; then - repo_rev="$STABLE_REV" - else - repo_rev="latest" - fi - - if echo "$repo_rev" | grep -E -q '^archive'; then - year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) - else - year=$(echo "$repo_rev" | cut -c1-4) - fi - - if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ - [ "$year" -gt 2016 ]; then - _USEAWS="$BS_TRUE" - pkg_append="python27" - fi - - # We need to install yum-utils before doing anything else when installing on - # Amazon Linux ECS-optimized images. See issue #974. - __yum_install_noinput yum-utils - - # Do upgrade early - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then - yum -y update || return 1 - fi - - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then - __REPO_FILENAME="salt.repo" - - # Set a few vars to make life easier. - if [ "$_USEAWS" -eq "$BS_TRUE" ]; then - base_url="$HTTP_VAL://${_REPO_URL}/yum/amazon/latest/\$basearch/$repo_rev/" - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" - repo_name="SaltStack repo for Amazon Linux" - else - base_url="$HTTP_VAL://${_REPO_URL}/yum/redhat/6/\$basearch/$repo_rev/" - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" - repo_name="SaltStack repo for RHEL/CentOS 6" - fi - - # This should prob be refactored to use __install_saltstack_rhel_repository() - # With args passed in to do the right thing. Reformatted to be more like the - # amazon linux yum file. - if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then - cat <<_eof > "/etc/yum.repos.d/${__REPO_FILENAME}" -[saltstack-repo] -name=$repo_name -failovermethod=priority -priority=10 -gpgcheck=1 -gpgkey=$gpg_key -baseurl=$base_url -_eof - fi - - fi - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - # which is already installed - __PACKAGES="m2crypto ${pkg_append}-crypto ${pkg_append}-jinja2 ${pkg_append}-PyYAML" - __PACKAGES="${__PACKAGES} ${pkg_append}-msgpack ${pkg_append}-requests ${pkg_append}-zmq" - __PACKAGES="${__PACKAGES} ${pkg_append}-futures" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 - fi -} - -install_amazon_linux_ami_git_deps() { - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - yum -y install ca-certificates || return 1 - fi - - PIP_EXE='pip' - if __check_command_exists python2.7; then - if ! __check_command_exists pip2.7; then - if ! __check_command_exists easy_install-2.7; then - __yum_install_noinput python27-setuptools - fi - /usr/bin/easy_install-2.7 pip || return 1 - fi - PIP_EXE='/usr/local/bin/pip2.7' - _PY_EXE='python2.7' - fi - - install_amazon_linux_ami_deps || return 1 - - if ! __check_command_exists git; then - __yum_install_noinput git || return 1 - fi - - __git_clone_and_checkout || return 1 - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - __PACKAGES="" - __PIP_PACKAGES="" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" - __PACKAGES="${__PACKAGES} python27-pip" - __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PACKAGES="${__PACKAGES} ${pkg_append}-tornado" - fi - fi - - if [ "${__PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - - if [ "${__PIP_PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 - fi - else - __PACKAGES="python27-pip python27-setuptools python27-devel gcc" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi - - return 0 -} - -install_amazon_linux_ami_stable() { - install_centos_stable || return 1 - return 0 -} - -install_amazon_linux_ami_stable_post() { - install_centos_stable_post || return 1 - return 0 -} - -install_amazon_linux_ami_restart_daemons() { - install_centos_restart_daemons || return 1 - return 0 -} - -install_amazon_linux_ami_git() { - install_centos_git || return 1 - return 0 -} - -install_amazon_linux_ami_git_post() { - install_centos_git_post || return 1 - return 0 -} - -install_amazon_linux_ami_testing() { - install_centos_testing || return 1 - return 0 -} - -install_amazon_linux_ami_testing_post() { - install_centos_testing_post || return 1 - return 0 -} +## DGM # Support for Amazon Linux (EOL) +## DGM install_amazon_linux_ami_deps() { +## DGM # Shim to figure out if we're using old (rhel) or new (aws) rpms. +## DGM _USEAWS="$BS_FALSE" +## DGM pkg_append="python" +## DGM +## DGM if [ "$ITYPE" = "stable" ]; then +## DGM repo_rev="$STABLE_REV" +## DGM else +## DGM repo_rev="latest" +## DGM fi +## DGM +## DGM if echo "$repo_rev" | grep -E -q '^archive'; then +## DGM year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) +## DGM else +## DGM year=$(echo "$repo_rev" | cut -c1-4) +## DGM fi +## DGM +## DGM if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ +## DGM [ "$year" -gt 2016 ]; then +## DGM _USEAWS="$BS_TRUE" +## DGM pkg_append="python27" +## DGM fi +## DGM +## DGM # We need to install yum-utils before doing anything else when installing on +## DGM # Amazon Linux ECS-optimized images. See issue #974. +## DGM __yum_install_noinput yum-utils +## DGM +## DGM # Do upgrade early +## DGM if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then +## DGM yum -y update || return 1 +## DGM fi +## DGM +## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then +## DGM __REPO_FILENAME="salt.repo" +## DGM +## DGM # Set a few vars to make life easier. +## DGM if [ "$_USEAWS" -eq "$BS_TRUE" ]; then +## DGM base_url="$HTTP_VAL://${_REPO_URL}/yum/amazon/latest/\$basearch/$repo_rev/" +## DGM gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" +## DGM repo_name="SaltStack repo for Amazon Linux" +## DGM else +## DGM base_url="$HTTP_VAL://${_REPO_URL}/yum/redhat/6/\$basearch/$repo_rev/" +## DGM gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" +## DGM repo_name="SaltStack repo for RHEL/CentOS 6" +## DGM fi +## DGM +## DGM # This should prob be refactored to use __install_saltstack_rhel_repository() +## DGM # With args passed in to do the right thing. Reformatted to be more like the +## DGM # amazon linux yum file. +## DGM if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then +## DGM cat <<_eof > "/etc/yum.repos.d/${__REPO_FILENAME}" +## DGM [saltstack-repo] +## DGM name=$repo_name +## DGM failovermethod=priority +## DGM priority=10 +## DGM gpgcheck=1 +## DGM gpgkey=$gpg_key +## DGM baseurl=$base_url +## DGM _eof +## DGM fi +## DGM +## DGM fi +## DGM +## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then +## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 +## DGM # which is already installed +## DGM __PACKAGES="m2crypto ${pkg_append}-crypto ${pkg_append}-jinja2 ${pkg_append}-PyYAML" +## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-msgpack ${pkg_append}-requests ${pkg_append}-zmq" +## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-futures" +## DGM # shellcheck disable=SC2086 +## DGM __yum_install_noinput "${__PACKAGES}" || return 1 +## DGM fi +## DGM +## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then +## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" +## DGM # shellcheck disable=SC2086 +## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 +## DGM fi +## DGM } +## DGM +## DGM install_amazon_linux_ami_git_deps() { +## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then +## DGM yum -y install ca-certificates || return 1 +## DGM fi +## DGM +## DGM PIP_EXE='pip' +## DGM if __check_command_exists python2.7; then +## DGM if ! __check_command_exists pip2.7; then +## DGM if ! __check_command_exists easy_install-2.7; then +## DGM __yum_install_noinput python27-setuptools +## DGM fi +## DGM /usr/bin/easy_install-2.7 pip || return 1 +## DGM fi +## DGM PIP_EXE='/usr/local/bin/pip2.7' +## DGM _PY_EXE='python2.7' +## DGM fi +## DGM +## DGM install_amazon_linux_ami_deps || return 1 +## DGM +## DGM if ! __check_command_exists git; then +## DGM __yum_install_noinput git || return 1 +## DGM fi +## DGM +## DGM __git_clone_and_checkout || return 1 +## DGM +## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then +## DGM __PACKAGES="" +## DGM __PIP_PACKAGES="" +## DGM +## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then +## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" +## DGM __PACKAGES="${__PACKAGES} python27-pip" +## DGM __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" +## DGM fi +## DGM +## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then +## DGM # We're on the master branch, install whichever tornado is on the requirements file +## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" +## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then +## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-tornado" +## DGM fi +## DGM fi +## DGM +## DGM if [ "${__PACKAGES}" != "" ]; then +## DGM # shellcheck disable=SC2086 +## DGM __yum_install_noinput "${__PACKAGES}" || return 1 +## DGM fi +## DGM +## DGM if [ "${__PIP_PACKAGES}" != "" ]; then +## DGM # shellcheck disable=SC2086 +## DGM ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 +## DGM fi +## DGM else +## DGM __PACKAGES="python27-pip python27-setuptools python27-devel gcc" +## DGM # shellcheck disable=SC2086 +## DGM __yum_install_noinput "${__PACKAGES}" || return 1 +## DGM fi +## DGM +## DGM # Let's trigger config_salt() +## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then +## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" +## DGM CONFIG_SALT_FUNC="config_salt" +## DGM fi +## DGM +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_stable() { +## DGM install_centos_stable || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_stable_post() { +## DGM install_centos_stable_post || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_restart_daemons() { +## DGM install_centos_restart_daemons || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_git() { +## DGM install_centos_git || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_git_post() { +## DGM install_centos_git_post || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_testing() { +## DGM install_centos_testing || return 1 +## DGM return 0 +## DGM } +## DGM +## DGM install_amazon_linux_ami_testing_post() { +## DGM install_centos_testing_post || return 1 +## DGM return 0 +## DGM } # Support for Amazon Linux 2 install_amazon_linux_ami_2_git_deps() { @@ -6325,11 +6341,19 @@ install_amazon_linux_ami_2_git_deps() { yum -y install ca-certificates || return 1 fi + if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + fi + install_amazon_linux_ami_2_deps || return 1 if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - PY_PKG_VER=2 - PIP_EXE='/bin/pip' + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + + ## DGM PY_PKG_VER=2 + ## DGM PIP_EXE='/bin/pip' else PY_PKG_VER=3 PIP_EXE='/bin/pip3' @@ -6353,16 +6377,19 @@ install_amazon_linux_ami_2_git_deps() { __PIP_PACKAGES="" if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud"a + # TBD DGM Need to check what Amazon 2023 give here if [ "$PARSED_VERSION" -eq "2" ]; then if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq "3" ]; then __PACKAGES="${__PACKAGES} python3-pip" __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" - else - __PACKAGES="${__PACKAGES} python2-pip" + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} python2-pip" fi else - __PACKAGES="${__PACKAGES} python27-pip" + ## DGM __PACKAGES="${__PACKAGES} python27-pip" + echoerror "Amazon Linux is no longer supported" + return 1 fi __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" fi @@ -6411,6 +6438,8 @@ install_amazon_linux_ami_2_git_deps() { install_amazon_linux_ami_2_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. _USEAWS="$BS_FALSE" + + ## TBD DGM check what how pkg_append is used pkg_append="python" if [ "$ITYPE" = "stable" ]; then @@ -6452,6 +6481,9 @@ install_amazon_linux_ami_2_deps() { PY_PKG_VER=3 repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2" + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi base_url="$HTTP_VAL://${_REPO_URL}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" @@ -6478,19 +6510,21 @@ _eof fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - # which is already installed - if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then - __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" - else - __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" - fi + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + ## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 + ## DGM # which is already installed + ## DGM if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then + ## DGM __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" + ## DGM else + ## DGM __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" + ## DGM fi - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" + ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" + ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM # shellcheck disable=SC2086 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then @@ -6503,6 +6537,7 @@ _eof install_amazon_linux_ami_2_onedir_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. _USEAWS="$BS_FALSE" + ## TBD DGM check what how pkg_append is used pkg_append="python" if [ "$ITYPE" = "onedir" ]; then @@ -6572,19 +6607,21 @@ _eof fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - # which is already installed - if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then - __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" - else - __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" - fi + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 + ## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 + ## DGM # which is already installed + ## DGM if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then + ## DGM __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" + ## DGM else + ## DGM __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" + ## DGM fi - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" + ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" + ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM # shellcheck disable=SC2086 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then @@ -6668,45 +6705,9 @@ install_amazon_linux_ami_2023_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - __PACKAGES="" - __PIP_PACKAGES="" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" - __PACKAGES="${__PACKAGES} python3-pip" - __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" - __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" - fi - fi - - if [ "${__PIP_PACKAGES}" != "" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install ${__PIP_PACKAGES}" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip" - fi - - if [ "${__PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - - if [ "${__PIP_PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 - fi - else - __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi + __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6720,6 +6721,7 @@ install_amazon_linux_ami_2023_git_deps() { install_amazon_linux_ami_2023_onedir_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. _USEAWS="$BS_FALSE" + ## TBD DGM check what how pkg_append is used pkg_append="python" if [ "$ITYPE" = "onedir" ]; then @@ -6900,29 +6902,39 @@ install_arch_linux_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - pacman -R --noconfirm python2-distribute - pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ - python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \ - python2-pyzmq zeromq python2-requests python2-systemd || return 1 + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## DGM pacman -R --noconfirm python2-distribute + ## DGM pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ + ## DGM python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \ + ## DGM python2-pyzmq zeromq python2-requests python2-systemd || return 1 - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - pacman -Su --noconfirm --needed python2-tornado - fi - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # We're on the master branch, install whichever tornado is on the requirements file + ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then + ## DGM pacman -Su --noconfirm --needed python2-tornado + ## DGM fi + ## DGM fi + ## DGM else + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + ## DGM PY_PKG_VER=2 + ## DGM else + ## DGM PY_PKG_VER="" + ## DGM fi + ## DGM __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + ## DGM # shellcheck disable=SC2086 + ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" + ## DGM fi + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + ## DGM PY_PKG_VER=2 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 else - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - PY_PKG_VER=2 - else - PY_PKG_VER="" - fi - __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - # shellcheck disable=SC2086 - pacman -Su --noconfirm --needed "${__PACKAGES}" + PY_PKG_VER="" fi + __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + # shellcheck disable=SC2086 + pacman -Su --noconfirm --needed "${__PACKAGES}" # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6960,13 +6972,18 @@ install_arch_linux_git() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 - else - python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - fi + ## DGM what ws this doing ?? TBD + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then + ## DGM python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 + ## DGM else + ## DGM python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 + ## DGM fi + return 0 } @@ -7121,6 +7138,9 @@ __install_saltstack_photon_onedir_repository() { __PY_VERSION_REPO="yum" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PY_VERSION_REPO="py3" + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi REPO_FILE="/etc/yum.repos.d/salt.repo" @@ -7194,7 +7214,9 @@ install_photon_git_deps() { # Packages are named python3- PY_PKG_VER=3 else - PY_PKG_VER=2 + ## PY_PKG_VER=2 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi __PACKAGES="" @@ -7213,44 +7235,47 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - __PACKAGES="${__PACKAGES} ca-certificates" - fi - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" - fi + ## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + ## DGM __PACKAGES="${__PACKAGES} ca-certificates" + ## DGM fi + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" + ## DGM fi - install_photon_deps || return 1 + ## DGM install_photon_deps || return 1 - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - if __check_command_exists python3; then - __python="python3" - fi - elif [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - if __check_command_exists python2; then - __python="python2" - fi - else - if ! __check_command_exists python; then - echoerror "Unable to find a python binary?!" - return 1 - fi - # Let's hope it's the right one - __python="python" - fi + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM if __check_command_exists python3; then + ## DGM __python="python3" + ## DGM fi + ## DGM elif [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + ## DGM if __check_command_exists python2; then + ## DGM __python="python2" + ## DGM fi + ## DGM else + ## DGM if ! __check_command_exists python; then + ## DGM echoerror "Unable to find a python binary?!" + ## DGM return 1 + ## DGM fi + ## DGM # Let's hope it's the right one + ## DGM __python="python" + ## DGM fi - grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" | while IFS=' - ' read -r dep; do - echodebug "Running '${__python}' -m pip install '${dep}'" - "${__python}" -m pip install "${dep}" || return 1 - done - else - __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" - # shellcheck disable=SC2086 - __tdnf_install_noinput "${__PACKAGES}" || return 1 - fi + ## DGM grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" | while IFS=' + ## DGM ' read -r dep; do + ## DGM echodebug "Running '${__python}' -m pip install '${dep}'" + ## DGM "${__python}" -m pip install "${dep}" || return 1 + ## DGM done + ## DGM else + ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" + ## DGM # shellcheck disable=SC2086 + ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM fi + __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" + # shellcheck disable=SC2086 + __tdnf_install_noinput "${__PACKAGES}" || return 1 if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then # Need newer version of setuptools on Photon @@ -7273,7 +7298,9 @@ install_photon_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - _PYEXE='python2' + ## DGM _PYEXE='python2' + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then @@ -7521,14 +7548,17 @@ install_freebsd_git() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 - for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do - __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 - sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" - sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" - chmod +x "/usr/local/etc/rc.d/${script}" || return 1 - done + for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do + __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 + sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" + sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" + chmod +x "/usr/local/etc/rc.d/${script}" || return 1 + done return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Install from git @@ -7644,6 +7674,9 @@ install_openbsd_git_deps() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then pkg_add -I -v py3-pip py3-setuptools + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # @@ -7664,6 +7697,9 @@ install_openbsd_git() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ ! -f salt/syspaths.py ]; then @@ -7794,37 +7830,39 @@ install_smartos_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## TBD DGM Even post NEON using Python 2.7, do we care about smart os + ## + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # Install whichever tornado is in the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # Install whichever tornado is in the requirements file + ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" - # Install whichever futures is in the requirements file - __REQUIRED_FUTURES="$(grep futures "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_FUTURES}'" + ## DGM # Install whichever futures is in the requirements file + ## DGM __REQUIRED_FUTURES="$(grep futures "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_FUTURES}'" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - if ! __check_command_exists pip; then - pkgin -y install py27-pip - fi - pip install -U "${__REQUIRED_TORNADO}" - fi + ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then + ## DGM if ! __check_command_exists pip; then + ## DGM pkgin -y install py27-pip + ## DGM fi + ## DGM pip install -U "${__REQUIRED_TORNADO}" + ## DGM fi - if [ "${__REQUIRED_FUTURES}" != "" ]; then - if ! __check_command_exists pip; then - pkgin -y install py27-pip - fi - pip install -U "${__REQUIRED_FUTURES}" - fi - fi - else - if ! __check_command_exists pip; then - pkgin -y install py27-pip - fi - pkgin -y install py27-setuptools - fi + ## DGM if [ "${__REQUIRED_FUTURES}" != "" ]; then + ## DGM if ! __check_command_exists pip; then + ## DGM pkgin -y install py27-pip + ## DGM fi + ## DGM pip install -U "${__REQUIRED_FUTURES}" + ## DGM fi + ## DGM fi + ## DGM else + ## DGM if ! __check_command_exists pip; then + ## DGM pkgin -y install py27-pip + ## DGM fi + ## DGM pkgin -y install py27-setuptools + ## DGM fi # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -7845,6 +7883,9 @@ install_smartos_git() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Use setuptools in order to also install dependencies @@ -8087,27 +8128,32 @@ install_opensuse_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - __zypper_install patch || return 1 + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## DGM __zypper_install patch || return 1 - __PACKAGES="libzmq5 python-Jinja2 python-m2crypto python-msgpack-python python-pycrypto python-pyzmq python-xml python-futures" + ## DGM __PACKAGES="libzmq5 python-Jinja2 python-m2crypto python-msgpack-python python-pycrypto python-pyzmq python-xml python-futures" - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PACKAGES="${__PACKAGES} python-tornado" - fi - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # We're on the master branch, install whichever tornado is on the requirements file + ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then + ## DGM __PACKAGES="${__PACKAGES} python-tornado" + ## DGM fi + ## DGM fi - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python-apache-libcloud" - fi - # Check for Tumbleweed - elif [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM __PACKAGES="${__PACKAGES} python-apache-libcloud" + ## DGM fi + ## DGM # Check for Tumbleweed + ## DGM elif [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then + ## DGM __PACKAGES="python3-pip gcc-c++ python3-pyzmq-devel" + ## DGM else + ## DGM __PACKAGES="python-pip python-setuptools gcc" + ## DGM fi + if [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then __PACKAGES="python3-pip gcc-c++ python3-pyzmq-devel" else - __PACKAGES="python-pip python-setuptools gcc" + __PACKAGES="python3-pip python3-setuptools gcc" fi # shellcheck disable=SC2086 @@ -8330,39 +8376,42 @@ install_opensuse_15_git_deps() { __git_clone_and_checkout || return 1 if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - PY_PKG_VER=2 + ## DGM PY_PKG_VER=2 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 else PY_PKG_VER=3 fi __PACKAGES="python${PY_PKG_VER}-xml" - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then + ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # Py3 is the default bootstrap install for Leap 15 - # However, git installs might specify "-x python2" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - # This is required by some of the python2 packages below - __PACKAGES="${__PACKAGES} libpython2_7-1_0 python2-futures python-ipaddress" - fi + ## DGM # Py3 is the default bootstrap install for Leap 15 + ## DGM # However, git installs might specify "-x python2" + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + ## DGM # This is required by some of the python2 packages below + ## DGM __PACKAGES="${__PACKAGES} libpython2_7-1_0 python2-futures python-ipaddress" + ## DGM fi - __PACKAGES="${__PACKAGES} libzmq5 python${PY_PKG_VER}-Jinja2 python${PY_PKG_VER}-msgpack" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pycrypto python${PY_PKG_VER}-pyzmq" + ## DGM __PACKAGES="${__PACKAGES} libzmq5 python${PY_PKG_VER}-Jinja2 python${PY_PKG_VER}-msgpack" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pycrypto python${PY_PKG_VER}-pyzmq" - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - fi - fi + ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + ## DGM # We're on the master branch, install whichever tornado is on the requirements file + ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" + ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM fi + ## DGM fi - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apache-libcloud" - fi - else - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - fi + ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apache-libcloud" + ## DGM fi + ## DGM else + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + ## DGM fi + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 __zypper_install "${__PACKAGES}" || return 1 @@ -8483,6 +8532,9 @@ install_suse_15_restart_daemons() { install_suse_12_stable_deps() { __opensuse_prep_install || return 1 + + ## TBD DGM Suse 12 appears to be Python 2 - what to do here + # YAML module is used for generating custom master/minion configs # requests is still used by many salt modules # Salt needs python-zypp installed in order to use the zypper module @@ -8498,7 +8550,9 @@ install_suse_12_stable_deps() { # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which # we want to install, even with --non-interactive. # Let's try to install the higher version first and then the lower one in case of failure - __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 + + ## TBD DGM what to do about these + ## DGM __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" @@ -8600,6 +8654,8 @@ install_suse_12_restart_daemons() { install_suse_11_stable_deps() { __opensuse_prep_install || return 1 + ## TBD DGM Suse 11 appears to be Python 2 - what to do here + # YAML module is used for generating custom master/minion configs __PACKAGES="python-PyYAML" @@ -9183,6 +9239,9 @@ __macosx_get_packagesite() { __PY_VERSION_REPO="py2" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PY_VERSION_REPO="py3" + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg" @@ -9211,6 +9270,9 @@ __macosx_get_packagesite_onedir() { __PY_VERSION_REPO="py2" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then __PY_VERSION_REPO="py3" + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then @@ -9262,7 +9324,9 @@ install_macosx_git_deps() { if [ -n "$_PY_EXE" ]; then _PYEXE="${_PY_EXE}" else - _PYEXE=python2.7 + ## DGM _PYEXE=python2.7 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi # Install PIP @@ -9272,10 +9336,14 @@ install_macosx_git_deps() { if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi - __PIP_REQUIREMENTS="dev_python27.txt" + ## DGM __PIP_REQUIREMENTS="dev_python27.txt" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## TBD DGM Python 3.4 really ????? __PIP_REQUIREMENTS="dev_python34.txt" fi @@ -9310,12 +9378,17 @@ install_macosx_git() { if [ -n "$_PY_EXE" ]; then _PYEXE="${_PY_EXE}" else - _PYEXE=python2.7 + ## DGM _PYEXE=python2.7 + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + else + echoerror "Python 2 is no longer supported, only Py3 packages" + return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then From 93f001f94ae9d60332976665832f2a3ac392d0b1 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 5 Feb 2024 12:05:53 -0700 Subject: [PATCH 06/80] Pre-commit clean up --- bootstrap-salt.sh | 104 ++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 16c4db8..51ef5e9 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -417,7 +417,7 @@ __usage() { (only available for Ubuntu based distributions) -x Changes the Python version used to install Salt. Python 2.7 is no longer supported. - Fedora git installation, CentOS 7, Ubuntu 1820.04 support python3. + Fedora git installation, CentOS 7, Ubuntu 20.04 support python3. -X Do not start daemons after installation -y Installs a different python version on host. Currently this has only been tested with CentOS 7 and is considered experimental. This will install the @@ -6157,37 +6157,37 @@ daemons_running_alpine_linux() { ## DGM # Shim to figure out if we're using old (rhel) or new (aws) rpms. ## DGM _USEAWS="$BS_FALSE" ## DGM pkg_append="python" -## DGM +## DGM ## DGM if [ "$ITYPE" = "stable" ]; then ## DGM repo_rev="$STABLE_REV" ## DGM else ## DGM repo_rev="latest" ## DGM fi -## DGM +## DGM ## DGM if echo "$repo_rev" | grep -E -q '^archive'; then ## DGM year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) ## DGM else ## DGM year=$(echo "$repo_rev" | cut -c1-4) ## DGM fi -## DGM +## DGM ## DGM if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ ## DGM [ "$year" -gt 2016 ]; then ## DGM _USEAWS="$BS_TRUE" ## DGM pkg_append="python27" ## DGM fi -## DGM +## DGM ## DGM # We need to install yum-utils before doing anything else when installing on ## DGM # Amazon Linux ECS-optimized images. See issue #974. ## DGM __yum_install_noinput yum-utils -## DGM +## DGM ## DGM # Do upgrade early ## DGM if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then ## DGM yum -y update || return 1 ## DGM fi -## DGM +## DGM ## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then ## DGM __REPO_FILENAME="salt.repo" -## DGM +## DGM ## DGM # Set a few vars to make life easier. ## DGM if [ "$_USEAWS" -eq "$BS_TRUE" ]; then ## DGM base_url="$HTTP_VAL://${_REPO_URL}/yum/amazon/latest/\$basearch/$repo_rev/" @@ -6198,7 +6198,7 @@ daemons_running_alpine_linux() { ## DGM gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" ## DGM repo_name="SaltStack repo for RHEL/CentOS 6" ## DGM fi -## DGM +## DGM ## DGM # This should prob be refactored to use __install_saltstack_rhel_repository() ## DGM # With args passed in to do the right thing. Reformatted to be more like the ## DGM # amazon linux yum file. @@ -6213,9 +6213,9 @@ daemons_running_alpine_linux() { ## DGM baseurl=$base_url ## DGM _eof ## DGM fi -## DGM +## DGM ## DGM fi -## DGM +## DGM ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then ## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 ## DGM # which is already installed @@ -6225,19 +6225,19 @@ daemons_running_alpine_linux() { ## DGM # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 ## DGM fi -## DGM +## DGM ## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then ## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" ## DGM # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 ## DGM fi ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_git_deps() { ## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then ## DGM yum -y install ca-certificates || return 1 ## DGM fi -## DGM +## DGM ## DGM PIP_EXE='pip' ## DGM if __check_command_exists python2.7; then ## DGM if ! __check_command_exists pip2.7; then @@ -6249,25 +6249,25 @@ daemons_running_alpine_linux() { ## DGM PIP_EXE='/usr/local/bin/pip2.7' ## DGM _PY_EXE='python2.7' ## DGM fi -## DGM +## DGM ## DGM install_amazon_linux_ami_deps || return 1 -## DGM +## DGM ## DGM if ! __check_command_exists git; then ## DGM __yum_install_noinput git || return 1 ## DGM fi -## DGM +## DGM ## DGM __git_clone_and_checkout || return 1 -## DGM +## DGM ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then ## DGM __PACKAGES="" ## DGM __PIP_PACKAGES="" -## DGM +## DGM ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then ## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" ## DGM __PACKAGES="${__PACKAGES} python27-pip" ## DGM __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" ## DGM fi -## DGM +## DGM ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then ## DGM # We're on the master branch, install whichever tornado is on the requirements file ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" @@ -6275,12 +6275,12 @@ daemons_running_alpine_linux() { ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-tornado" ## DGM fi ## DGM fi -## DGM +## DGM ## DGM if [ "${__PACKAGES}" != "" ]; then ## DGM # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 ## DGM fi -## DGM +## DGM ## DGM if [ "${__PIP_PACKAGES}" != "" ]; then ## DGM # shellcheck disable=SC2086 ## DGM ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 @@ -6290,46 +6290,46 @@ daemons_running_alpine_linux() { ## DGM # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 ## DGM fi -## DGM +## DGM ## DGM # Let's trigger config_salt() ## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then ## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" ## DGM CONFIG_SALT_FUNC="config_salt" ## DGM fi -## DGM +## DGM ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_stable() { ## DGM install_centos_stable || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_stable_post() { ## DGM install_centos_stable_post || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_restart_daemons() { ## DGM install_centos_restart_daemons || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_git() { ## DGM install_centos_git || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_git_post() { ## DGM install_centos_git_post || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_testing() { ## DGM install_centos_testing || return 1 ## DGM return 0 ## DGM } -## DGM +## DGM ## DGM install_amazon_linux_ami_testing_post() { ## DGM install_centos_testing_post || return 1 ## DGM return 0 @@ -6437,10 +6437,10 @@ install_amazon_linux_ami_2_git_deps() { install_amazon_linux_ami_2_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS="$BS_FALSE" + ## DGM _USEAWS="$BS_FALSE" ## TBD DGM check what how pkg_append is used - pkg_append="python" + ## DGM pkg_append="python" if [ "$ITYPE" = "stable" ]; then repo_rev="$STABLE_REV" @@ -6448,17 +6448,17 @@ install_amazon_linux_ami_2_deps() { repo_rev="latest" fi - if echo "$repo_rev" | grep -E -q '^archive'; then - year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) - else - year=$(echo "$repo_rev" | cut -c1-4) - fi - - if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ - [ "$year" -gt 2016 ]; then - _USEAWS="$BS_TRUE" - pkg_append="python" - fi + ## DGM if echo "$repo_rev" | grep -E -q '^archive'; then + ## DGM year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) + ## DGM else + ## DGM year=$(echo "$repo_rev" | cut -c1-4) + ## DGM fi + ## DGM + ## DGM if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ + ## DGM [ "$year" -gt 2016 ]; then + ## DGM _USEAWS="$BS_TRUE" + ## DGM pkg_append="python" + ## DGM fi # We need to install yum-utils before doing anything else when installing on # Amazon Linux ECS-optimized images. See issue #974. @@ -6536,7 +6536,7 @@ _eof install_amazon_linux_ami_2_onedir_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS="$BS_FALSE" + ## DGM _USEAWS="$BS_FALSE" ## TBD DGM check what how pkg_append is used pkg_append="python" @@ -6546,12 +6546,6 @@ install_amazon_linux_ami_2_onedir_deps() { repo_rev="latest" fi - if echo "$repo_rev" | grep -E -q '^archive'; then - year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) - else - year=$(echo "$repo_rev" | cut -c1-4) - fi - # We need to install yum-utils before doing anything else when installing on # Amazon Linux ECS-optimized images. See issue #974. __yum_install_noinput yum-utils @@ -6720,7 +6714,7 @@ install_amazon_linux_ami_2023_git_deps() { install_amazon_linux_ami_2023_onedir_deps() { # Shim to figure out if we're using old (rhel) or new (aws) rpms. - _USEAWS="$BS_FALSE" + ## DGM _USEAWS="$BS_FALSE" ## TBD DGM check what how pkg_append is used pkg_append="python" @@ -6730,12 +6724,6 @@ install_amazon_linux_ami_2023_onedir_deps() { repo_rev="latest" fi - if echo "$repo_rev" | grep -E -q '^archive'; then - year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) - else - year=$(echo "$repo_rev" | cut -c1-4) - fi - # We need to install yum-utils before doing anything else when installing on # Amazon Linux ECS-optimized images. See issue #974. __yum_install_noinput yum-utils From 9fee6196f6eee3fa214f70dfb87989e9a93d43fd Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 5 Feb 2024 14:57:12 -0700 Subject: [PATCH 07/80] Updated workflows for Debian 12, Fedora 39, Amazon 2023 --- .github/workflows/ci.yml | 40 +++++++++++++-- .github/workflows/templates/generate.py | 59 +++++++++++++++++----- kitchen.yml | 67 ++++++++++++++++--------- 3 files changed, 125 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b9e22f..46552e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -265,6 +265,20 @@ jobs: instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + amazon-2023: + name: Amazon 2023 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: amazon-2023 + display-name: Amazon 2023 + timeout: 20 + instances: '["stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "git-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + + arch: name: Arch if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -349,16 +363,16 @@ jobs: instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' - fedora-36: - name: Fedora 36 + debian-12: + name: Debian 12 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' uses: ./.github/workflows/test-linux.yml needs: - lint - generate-actions-workflow with: - distro-slug: fedora-36 - display-name: Fedora 36 + distro-slug: debian-12 + display-name: Debian 12 timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' @@ -391,6 +405,20 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + fedora-39: + name: Fedora 39 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-39 + display-name: Fedora 39 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + + gentoo: name: Gentoo if: github.event_name == 'push' @@ -577,15 +605,17 @@ jobs: - almalinux-8 - almalinux-9 - amazon-2 + - amazon-2023 - arch - centos-7 - centos-stream8 - centos-stream9 - debian-10 - debian-11 - - fedora-36 + - debian-12 - fedora-37 - fedora-38 + - fedora-39 - gentoo - gentoo-systemd - opensuse-15 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 190c118..ec07f26 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import datetime import json import os @@ -10,15 +10,18 @@ LINUX_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-7", "centos-stream8", "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -69,15 +72,18 @@ STABLE_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-7", "centos-stream8", "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "opensuse-15", "opensuse-tumbleweed", "oraclelinux-7", @@ -94,14 +100,17 @@ ONEDIR_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", + "amazon-2023", "centos-7", "centos-stream8", "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "oraclelinux-7", "oraclelinux-8", "photon-3", @@ -133,12 +142,15 @@ ONEDIR_RC_DISTROS = [ BLACKLIST_3003 = [ "almalinux-9", + "amazon-2023", "arch", "centos-stream9", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -153,13 +165,16 @@ BLACKLIST_3003 = [ BLACKLIST_GIT_3003 = [ "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -177,9 +192,11 @@ BLACKLIST_3004 = [ "almalinux-9", "arch", "centos-stream9", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -187,15 +204,18 @@ BLACKLIST_3004 = [ "photon-3", "photon-4", "rockylinux-9", + "ubuntu-2204", ] BLACKLIST_3005 = [ "almalinux-9", "arch", "centos-stream9", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -208,13 +228,16 @@ BLACKLIST_3005 = [ BLACKLIST_GIT_3004 = [ "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -225,16 +248,20 @@ BLACKLIST_GIT_3004 = [ "rockylinux-9", "photon-3", "photon-4", + "ubuntu-2204", ] BLACKLIST_GIT_3005 = [ "amazon-2", + "amazon-2023", "arch", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -261,9 +288,11 @@ BLACKLIST_GIT_3006 = [ "centos-stream9", "debian-10", "debian-11", - "fedora-36", + "debian-12", + ## DGM "fedora-36", "fedora-37", "fedora-38", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -311,6 +340,7 @@ VERSION_DISPLAY_NAMES = { "3005-1": "v3005.1", "3006": "v3006", "3006-1": "v3006.1", + "3006-6": "v3006.6", "master": "Master", "latest": "Latest", "nightly": "Nightly", @@ -335,6 +365,7 @@ MAC_OLD_STABLE_VERSION_BLACKLIST = [ "3005-1", "3006", "3006-1", + "3006-6", "master", "nightly", ] @@ -369,6 +400,7 @@ GIT_DISTRO_BLACKLIST = [ "centos-stream8", "fedora-37", "fedora-38", + "fedora-39", "opensuse-15", "oraclelinux-7", "oraclelinux-8", @@ -384,15 +416,18 @@ DISTRO_DISPLAY_NAMES = { "almalinux-8": "AlmaLinux 8", "almalinux-9": "AlmaLinux 9", "amazon-2": "Amazon 2", + "amazon-2023": "Amazon 2023", "arch": "Arch", "centos-7": "CentOS 7", "centos-stream8": "CentOS Stream 8", "centos-stream9": "CentOS Stream 9", "debian-10": "Debian 10", "debian-11": "Debian 11", - "fedora-36": "Fedora 36", + "debian-12": "Debian 12", + ## DGM "fedora-36": "Fedora 36", "fedora-37": "Fedora 37", "fedora-38": "Fedora 38", + "fedora-39": "Fedora 39", "gentoo": "Gentoo", "gentoo-systemd": "Gentoo (systemd)", "opensuse-15": "Opensuse 15", diff --git a/kitchen.yml b/kitchen.yml index 4ed6e6d..46c635c 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -66,8 +66,8 @@ platforms: - name: centos-stream8 driver: image: quay.io/centos/centos:stream8 + ## DGM - name: debian-9 - name: centos-7 - - name: debian-9 driver: run_command: /lib/systemd/systemd - name: debian-10 @@ -77,20 +77,27 @@ platforms: driver: image: debian:bullseye run_command: /lib/systemd/systemd - - name: fedora-35 + - name: debian-12 driver: - provision_command: &fedora_provision_command - - dnf -y install procps-ng crypto-policies-scripts - - update-crypto-policies --set LEGACY - - name: fedora-36 - driver: - provision_command: *fedora_provision_command + image: debian:bullseye + run_command: /lib/systemd/systemd + ## DGM - name: fedora-35 + ## DGM driver: + ## DGM provision_command: &fedora_provision_command + ## DGM - dnf -y install procps-ng crypto-policies-scripts + ## DGM - update-crypto-policies --set LEGACY + ## DGM - name: fedora-36 + ## DGM driver: + ## DGM provision_command: *fedora_provision_command - name: fedora-37 driver: provision_command: *fedora_provision_command - name: fedora-38 driver: provision_command: *fedora_provision_command + - name: fedora-39 + driver: + provision_command: *fedora_provision_command - name: gentoo driver: image: gentoo/stage3:latest @@ -176,6 +183,7 @@ suites: - opensuse-15 - opensuse-tumbleweed - debian-11 + - debian-12 - arch - gentoo - gentoo-systemd @@ -190,6 +198,7 @@ suites: - opensuse-15 - opensuse-tumbleweed - debian-11 + - debian-12 - arch - gentoo - gentoo-systemd @@ -217,7 +226,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - debian-11 - arch - gentoo - gentoo-systemd @@ -334,6 +342,17 @@ suites: - freebsd-131 - freebsd-123 - openbsd-6 + - name: stable-3006-6 + provisioner: + salt_version: 3006.6 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - freebsd-131 + - freebsd-123 + - openbsd-6 - name: git-master provisioner: salt_version: master @@ -369,23 +388,23 @@ suites: salt_version: 3006 salt_bootstrap_options: -MP onedir %s - - name: onedir-rc-3006-0rc2 - provisioner: - salt_version: 3006.0rc2 - salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s - excludes: - - arch - - freebsd-131 - - freebsd-123 - - gentoo - - openbsd-6 - - opensuse-15 - - opensuse-tumbleweed - - ubuntu-1804 + ## DGM - name: onedir-rc-3006-0rc2 + ## DGM provisioner: + ## DGM salt_version: 3006.0rc2 + ## DGM salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s + ## DGM excludes: + ## DGM - arch + ## DGM - freebsd-131 + ## DGM - freebsd-123 + ## DGM - gentoo + ## DGM - openbsd-6 + ## DGM - opensuse-15 + ## DGM - opensuse-tumbleweed + ## DGM - ubuntu-1804 - - name: onedir-rc-3006-0rc1 + - name: onedir-rc-3007-0rc1 provisioner: - salt_version: 3006.0rc1 + salt_version: 3007.0rc1 salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s excludes: - arch From 15bea28fa97430de6293c5b85ad78378c8b984b9 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 5 Feb 2024 16:56:12 -0700 Subject: [PATCH 08/80] Update minimum versions and correct Redat 7 base key --- .github/workflows/ci.yml | 28 ++++++------- .github/workflows/templates/generate.py | 16 ++++---- bootstrap-salt.sh | 53 +++++++++++++++++-------- 3 files changed, 59 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46552e7..0e1814b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,7 +204,7 @@ jobs: display-name: Windows 2019 timeout: 20 runs-on: windows-2019 - instances: '["stable-3005", "stable-3005-1", "stable-3006", "stable-3006-1", "latest"]' + instances: '["stable-3005", "stable-3005-5", "stable-3006", "stable-3006-1", "latest"]' windows-2022: @@ -219,7 +219,7 @@ jobs: display-name: Windows 2022 timeout: 20 runs-on: windows-2022 - instances: '["stable-3005", "stable-3005-1", "stable-3006", "stable-3006-1", "latest"]' + instances: '["stable-3005", "stable-3005-5", "stable-3006", "stable-3006-1", "latest"]' @@ -234,7 +234,7 @@ jobs: distro-slug: almalinux-8 display-name: AlmaLinux 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' almalinux-9: @@ -262,7 +262,7 @@ jobs: distro-slug: amazon-2 display-name: Amazon 2 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' amazon-2023: @@ -276,7 +276,7 @@ jobs: distro-slug: amazon-2023 display-name: Amazon 2023 timeout: 20 - instances: '["stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "git-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "git-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' arch: @@ -304,7 +304,7 @@ jobs: distro-slug: centos-7 display-name: CentOS 7 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' centos-stream8: @@ -318,7 +318,7 @@ jobs: distro-slug: centos-stream8 display-name: CentOS Stream 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' centos-stream9: @@ -346,7 +346,7 @@ jobs: distro-slug: debian-10 display-name: Debian 10 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' debian-11: @@ -360,7 +360,7 @@ jobs: distro-slug: debian-11 display-name: Debian 11 timeout: 20 - instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' debian-12: @@ -486,7 +486,7 @@ jobs: distro-slug: oraclelinux-7 display-name: Oracle Linux 7 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' oraclelinux-8: @@ -500,7 +500,7 @@ jobs: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' photon-3: @@ -542,7 +542,7 @@ jobs: distro-slug: rockylinux-8 display-name: Rocky Linux 8 timeout: 20 - instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' rockylinux-9: @@ -570,7 +570,7 @@ jobs: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' ubuntu-2204: @@ -584,7 +584,7 @@ jobs: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 timeout: 20 - instances: '["stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' set-pipeline-exit-status: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index ec07f26..d38c093 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -317,7 +317,7 @@ SALT_VERSIONS = [ "3003", "3004", "3005", - "3005-1", + "3005-5", "3006", "3006-1", "master", @@ -337,7 +337,7 @@ VERSION_DISPLAY_NAMES = { "3003": "v3003", "3004": "v3004", "3005": "v3005", - "3005-1": "v3005.1", + "3005-5": "v3005.5", "3006": "v3006", "3006-1": "v3006.1", "3006-6": "v3006.6", @@ -347,7 +347,7 @@ VERSION_DISPLAY_NAMES = { } OLD_STABLE_VERSION_BLACKLIST = [ - "3005-1", + "3005-5", "3006", "3006-1", "master", @@ -362,7 +362,7 @@ STABLE_VERSION_BLACKLIST = [ ] MAC_OLD_STABLE_VERSION_BLACKLIST = [ - "3005-1", + "3005-5", "3006", "3006-1", "3006-6", @@ -374,13 +374,13 @@ MAC_STABLE_VERSION_BLACKLIST = [ "3003", "3004", "3005", - "3005-1", + "3005-5", "master", "nightly", ] GIT_VERSION_BLACKLIST = [ - "3005-1", + "3005-5", "3006-1", "nightly", ] @@ -712,7 +712,7 @@ def generate_test_jobs(): "3003": BLACKLIST_3003, "3004": BLACKLIST_3004, "3005": BLACKLIST_3005, - "3005-1": BLACKLIST_3005, + "3005-5": BLACKLIST_3005, "3006": BLACKLIST_3006, "3006-1": BLACKLIST_3006, } @@ -733,7 +733,7 @@ def generate_test_jobs(): if ( salt_version - in ("3003", "3004", "3005", "3005-1", "3006", "3006-1", "master") + in ("3003", "3004", "3005", "3005-5", "3006", "3006-1", "master") and distro in BLACKLIST[salt_version] ): continue diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 51ef5e9..ed0081e 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1456,17 +1456,24 @@ __gather_system_info() { __ubuntu_derivatives_translation() { UBUNTU_DERIVATIVES="(trisquel|linuxmint|linaro|elementary_os|neon|pop)" # Mappings - trisquel_6_ubuntu_base="12.04" - linuxmint_13_ubuntu_base="12.04" - linuxmint_17_ubuntu_base="14.04" - linuxmint_18_ubuntu_base="16.04" - linuxmint_19_ubuntu_base="18.04" + ## DGM trisquel_6_ubuntu_base="12.04" + ## DGM linuxmint_13_ubuntu_base="12.04" + ## DGM linuxmint_17_ubuntu_base="14.04" + ## DGM linuxmint_18_ubuntu_base="16.04" + ## DGM linuxmint_19_ubuntu_base="18.04" linuxmint_20_ubuntu_base="20.04" +<<<<<<< HEAD linuxmint_21_ubuntu_base="22.04" linaro_12_ubuntu_base="12.04" elementary_os_02_ubuntu_base="12.04" neon_16_ubuntu_base="16.04" neon_18_ubuntu_base="18.04" +======= + ## DGM linaro_12_ubuntu_base="12.04" + ## DGM elementary_os_02_ubuntu_base="12.04" + ## DGM neon_16_ubuntu_base="16.04" + ## DGM neon_18_ubuntu_base="18.04" +>>>>>>> ddbec60 (Update minimum versions and correct Redat 7 base key) neon_20_ubuntu_base="20.04" neon_22_ubuntu_base="22.04" pop_22_ubuntu_base="22.04" @@ -1740,7 +1747,8 @@ __check_end_of_life_versions() { case "${DISTRO_NAME_L}" in debian) # Debian versions below 9 are not supported - if [ "$DISTRO_MAJOR_VERSION" -lt 9 ]; then + ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 9 ]; then + if [ "$DISTRO_MAJOR_VERSION" -lt 10 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.debian.org/DebianReleases" @@ -1757,12 +1765,24 @@ __check_end_of_life_versions() { # = 18.10 # = 19.04, 19.10 # = 20.10 - if [ "$DISTRO_MAJOR_VERSION" -lt 16 ] || \ - [ "$DISTRO_MAJOR_VERSION" -eq 17 ] || \ - [ "$DISTRO_MAJOR_VERSION" -eq 19 ] || \ - { [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - { [ "$DISTRO_MAJOR_VERSION" -eq 18 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then + ## if [ "$DISTRO_MAJOR_VERSION" -lt 16 ] || \ + ## [ "$DISTRO_MAJOR_VERSION" -eq 17 ] || \ + ## [ "$DISTRO_MAJOR_VERSION" -eq 19 ] || \ + ## { [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + ## { [ "$DISTRO_MAJOR_VERSION" -eq 18 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + ## { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then + ## echoerror "End of life distributions are not supported." + ## echoerror "Please consider upgrading to the next stable. See:" + ## echoerror " https://wiki.ubuntu.com/Releases" + ## exit 1 + ## fi + if [ "$DISTRO_MAJOR_VERSION" -lt 20 ] || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 21 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 21 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 23 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 23 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.ubuntu.com/Releases" @@ -1807,7 +1827,8 @@ __check_end_of_life_versions() { fedora) # Fedora lower than 33 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 33 ]; then + ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 33 ]; then + if [ "$DISTRO_MAJOR_VERSION" -lt 37 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://fedoraproject.org/wiki/Releases" @@ -4638,7 +4659,7 @@ __install_saltstack_rhel_repository() { # Instead, this should work correctly on all RHEL variants. base_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/" if [ "${DISTRO_MAJOR_VERSION}" -eq 7 ]; then - gpg_key="SALTSTACK-GPG-KEY.pub base/RPM-GPG-KEY-CentOS-7" + gpg_key="SALTSTACK-GPG-KEY.pub base/RPM-GPG-KEY-CentOS-7.key" elif [ "${DISTRO_MAJOR_VERSION}" -ge 9 ]; then gpg_key="SALTSTACK-GPG-KEY2.pub" else @@ -6487,7 +6508,7 @@ install_amazon_linux_ami_2_deps() { fi base_url="$HTTP_VAL://${_REPO_URL}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7" + gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7.key" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" fi @@ -6575,7 +6596,7 @@ install_amazon_linux_ami_2_onedir_deps() { fi if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7" + gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7.key" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" fi From 78ecaec870c2bd1d440cab1c05e948c153cc2c6c Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 5 Feb 2024 17:21:55 -0700 Subject: [PATCH 09/80] Updated 3005.1 to 3005.5 --- bootstrap-salt.sh | 2 +- kitchen.macos.yml | 2 +- kitchen.windows.yml | 4 ++-- kitchen.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ed0081e..f10bf36 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -336,7 +336,7 @@ __usage() { - ${__ScriptName} onedir_rc 3006 - ${__ScriptName} old-stable - ${__ScriptName} old-stable 3005 - - ${__ScriptName} old-stable 3005.1 + - ${__ScriptName} old-stable 3005.5 Options: diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 78467f0..61fb805 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -31,7 +31,7 @@ suites: - name: old-stable-3005 provisioner: salt_bootstrap_options: -MP old-stable %s - salt_version: 3005.1 + salt_version: 3005.5 salt_call_command: /opt/salt/bin/salt-call - name: stable-3006 provisioner: diff --git a/kitchen.windows.yml b/kitchen.windows.yml index a3cb442..7374389 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -27,10 +27,10 @@ suites: salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.bat - name: stable-3005 provisioner: - salt_version: 3005.1-1 + salt_version: 3005.5-1 - name: stable-3005-1 provisioner: - salt_version: 3005.1-1 + salt_version: 3005.5-1 - name: stable-3006 provisioner: salt_version: 3006.0 diff --git a/kitchen.yml b/kitchen.yml index 46c635c..0924501 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -311,7 +311,7 @@ suites: - openbsd-6 - name: stable-3005-1 provisioner: - salt_version: 3005.1 + salt_version: 3005.5 salt_bootstrap_options: -x python3 -MP stable %s excludes: - opensuse-15 From 10d602791d582f2cec5e147f9cdd3fea382ded50 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 09:28:56 -0700 Subject: [PATCH 10/80] Added macos-12, removed Photon-3, and added further cleanup of old OSs and Salt versions --- .github/workflows/ci.yml | 121 +- .github/workflows/templates/generate.py | 279 +--- bootstrap-salt.sh | 1792 +++-------------------- kitchen.macos.yml | 21 +- kitchen.windows.yml | 20 +- kitchen.yml | 164 +-- 6 files changed, 319 insertions(+), 2078 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e1814b..f6a98e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,21 +161,6 @@ jobs: - macos-11: - name: macOS 11 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-macos.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: macos-11 - display-name: macOS 11 - timeout: 20 - runs-on: macos-11 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3006", "stable-3006-1", "latest"]' - - macos-12: name: macOS 12 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -188,7 +173,22 @@ jobs: display-name: macOS 12 timeout: 20 runs-on: macos-12 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3006", "stable-3006-1", "latest"]' + instances: '["stable-3006", "stable-3006-6", "latest"]' + + + macos-13: + name: macOS 13 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-macos.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: macos-13 + display-name: macOS 13 + timeout: 20 + runs-on: macos-13 + instances: '["stable-3006", "stable-3006-6", "latest"]' @@ -204,7 +204,7 @@ jobs: display-name: Windows 2019 timeout: 20 runs-on: windows-2019 - instances: '["stable-3005", "stable-3005-5", "stable-3006", "stable-3006-1", "latest"]' + instances: '["stable-3006", "stable-3006-6", "latest"]' windows-2022: @@ -219,7 +219,7 @@ jobs: display-name: Windows 2022 timeout: 20 runs-on: windows-2022 - instances: '["stable-3005", "stable-3005-5", "stable-3006", "stable-3006-1", "latest"]' + instances: '["stable-3006", "stable-3006-6", "latest"]' @@ -234,7 +234,7 @@ jobs: distro-slug: almalinux-8 display-name: AlmaLinux 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' almalinux-9: @@ -248,7 +248,7 @@ jobs: distro-slug: almalinux-9 display-name: AlmaLinux 9 timeout: 20 - instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' amazon-2: @@ -262,7 +262,7 @@ jobs: distro-slug: amazon-2 display-name: Amazon 2 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' amazon-2023: @@ -276,7 +276,7 @@ jobs: distro-slug: amazon-2023 display-name: Amazon 2023 timeout: 20 - instances: '["stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "git-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' arch: @@ -304,7 +304,7 @@ jobs: distro-slug: centos-7 display-name: CentOS 7 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' centos-stream8: @@ -318,7 +318,7 @@ jobs: distro-slug: centos-stream8 display-name: CentOS Stream 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' centos-stream9: @@ -332,7 +332,7 @@ jobs: distro-slug: centos-stream9 display-name: CentOS Stream 9 timeout: 20 - instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' debian-10: @@ -346,7 +346,7 @@ jobs: distro-slug: debian-10 display-name: Debian 10 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' debian-11: @@ -360,7 +360,7 @@ jobs: distro-slug: debian-11 display-name: Debian 11 timeout: 20 - instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' debian-12: @@ -374,21 +374,7 @@ jobs: distro-slug: debian-12 display-name: Debian 12 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' - - - fedora-37: - name: Fedora 37 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: fedora-37 - display-name: Fedora 37 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' fedora-38: @@ -402,7 +388,7 @@ jobs: distro-slug: fedora-38 display-name: Fedora 38 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' fedora-39: @@ -416,7 +402,7 @@ jobs: distro-slug: fedora-39 display-name: Fedora 39 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' gentoo: @@ -486,7 +472,7 @@ jobs: distro-slug: oraclelinux-7 display-name: Oracle Linux 7 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' oraclelinux-8: @@ -500,21 +486,7 @@ jobs: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' - - - photon-3: - name: Photon OS 3 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: photon-3 - display-name: Photon OS 3 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' photon-4: @@ -528,7 +500,21 @@ jobs: distro-slug: photon-4 display-name: Photon OS 4 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + + + photon-5: + name: Photon OS 5 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: photon-5 + display-name: Photon OS 5 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' rockylinux-8: @@ -542,7 +528,7 @@ jobs: distro-slug: rockylinux-8 display-name: Rocky Linux 8 timeout: 20 - instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' rockylinux-9: @@ -556,7 +542,7 @@ jobs: distro-slug: rockylinux-9 display-name: Rocky Linux 9 timeout: 20 - instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' ubuntu-2004: @@ -570,7 +556,7 @@ jobs: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 timeout: 20 - instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' ubuntu-2204: @@ -584,7 +570,7 @@ jobs: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 timeout: 20 - instances: '["stable-3005", "onedir-3005", "stable-3005-5", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' set-pipeline-exit-status: @@ -598,8 +584,8 @@ jobs: - freebsd-131 - freebsd-123 - openbsd-7 - - macos-11 - macos-12 + - macos-13 - windows-2019 - windows-2022 - almalinux-8 @@ -613,7 +599,6 @@ jobs: - debian-10 - debian-11 - debian-12 - - fedora-37 - fedora-38 - fedora-39 - gentoo @@ -622,8 +607,8 @@ jobs: - opensuse-tumbleweed - oraclelinux-7 - oraclelinux-8 - - photon-3 - photon-4 + - photon-5 - rockylinux-8 - rockylinux-9 - ubuntu-2004 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index d38c093..bd741e0 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -18,8 +18,6 @@ LINUX_DISTROS = [ "debian-10", "debian-11", "debian-12", - ## DGM "fedora-36", - "fedora-37", "fedora-38", "fedora-39", "gentoo", @@ -28,8 +26,8 @@ LINUX_DISTROS = [ "opensuse-tumbleweed", "oraclelinux-7", "oraclelinux-8", - "photon-3", "photon-4", + "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", @@ -41,33 +39,16 @@ WINDOWS = [ ] OSX = [ - "macos-11", "macos-12", + "macos-13", ] + BSD = [ "freebsd-131", "freebsd-123", "openbsd-7", ] -OLD_STABLE_DISTROS = [ - "almalinux-8", - "amazon-2", - "arch", - "centos-7", - "centos-stream8", - "debian-10", - "debian-11", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "oraclelinux-7", - "oraclelinux-8", - "rockylinux-8", - "ubuntu-2004", -] - STABLE_DISTROS = [ "almalinux-8", "almalinux-9", @@ -80,16 +61,14 @@ STABLE_DISTROS = [ "debian-10", "debian-11", "debian-12", - ## DGM "fedora-36", - "fedora-37", "fedora-38", "fedora-39", "opensuse-15", "opensuse-tumbleweed", "oraclelinux-7", "oraclelinux-8", - "photon-3", "photon-4", + "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", @@ -107,14 +86,12 @@ ONEDIR_DISTROS = [ "debian-10", "debian-11", "debian-12", - ## DGM "fedora-36", - "fedora-37", "fedora-38", "fedora-39", "oraclelinux-7", "oraclelinux-8", - "photon-3", "photon-4", + "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", @@ -125,154 +102,23 @@ ONEDIR_RC_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", + "amazon-2023", "centos-7", "centos-stream8", "centos-stream9", "debian-10", "debian-11", + "debian-12", "oraclelinux-7", "oraclelinux-8", - "photon-3", "photon-4", + "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", "ubuntu-2204", ] -BLACKLIST_3003 = [ - "almalinux-9", - "amazon-2023", - "arch", - "centos-stream9", - "debian-11", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "photon-3", - "photon-4", - "rockylinux-8", - "rockylinux-9", - "ubuntu-2204", -] - -BLACKLIST_GIT_3003 = [ - "almalinux-9", - "amazon-2", - "amazon-2023", - "arch", - "centos-stream9", - "debian-10", - "debian-11", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "photon-3", - "photon-4", - "rockylinux-8", - "rockylinux-9", - "ubuntu-2004", - "ubuntu-2110", - "ubuntu-2204", -] - -BLACKLIST_3004 = [ - "almalinux-9", - "arch", - "centos-stream9", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "photon-3", - "photon-4", - "rockylinux-9", - "ubuntu-2204", -] - -BLACKLIST_3005 = [ - "almalinux-9", - "arch", - "centos-stream9", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "photon-3", - "photon-4", - "rockylinux-9", -] - -BLACKLIST_GIT_3004 = [ - "almalinux-9", - "amazon-2", - "amazon-2023", - "arch", - "centos-stream9", - "debian-10", - "debian-11", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "ubuntu-2004", - "ubuntu-2110", - "ubuntu-2204", - "rockylinux-9", - "photon-3", - "photon-4", - "ubuntu-2204", -] - -BLACKLIST_GIT_3005 = [ - "amazon-2", - "amazon-2023", - "arch", - "debian-10", - "debian-11", - "debian-12", - ## DGM "fedora-36", - "fedora-37", - "fedora-38", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "opensuse-tumbleweed", - "photon-3", - "photon-4", - "ubuntu-2004", - "ubuntu-2110", - "ubuntu-2204", -] - BLACKLIST_3006 = [ "arch", "gentoo", @@ -289,20 +135,18 @@ BLACKLIST_GIT_3006 = [ "debian-10", "debian-11", "debian-12", - ## DGM "fedora-36", - "fedora-37", "fedora-38", "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", - "photon-3", "photon-4", + "photon-5", "rockylinux-9", "ubuntu-2004", - "ubuntu-2110", "ubuntu-2204", + "ubuntu-2310", ] BLACKLIST_GIT_MASTER = [ @@ -310,23 +154,17 @@ BLACKLIST_GIT_MASTER = [ "debian-10", "freebsd-131", "freebsd-123", - "photon-3", ] SALT_VERSIONS = [ - "3003", - "3004", - "3005", - "3005-5", "3006", - "3006-1", + "3006-6", "master", "latest", "nightly", ] ONEDIR_SALT_VERSIONS = [ - "3005", "3006", "latest", ] @@ -334,54 +172,25 @@ ONEDIR_SALT_VERSIONS = [ ONEDIR_RC_SALT_VERSIONS = [] VERSION_DISPLAY_NAMES = { - "3003": "v3003", - "3004": "v3004", - "3005": "v3005", - "3005-5": "v3005.5", "3006": "v3006", - "3006-1": "v3006.1", "3006-6": "v3006.6", "master": "Master", "latest": "Latest", "nightly": "Nightly", } -OLD_STABLE_VERSION_BLACKLIST = [ - "3005-5", - "3006", - "3006-1", - "master", - "nightly", -] - STABLE_VERSION_BLACKLIST = [ - "3003", - "3004", - "master", - "nightly", -] - -MAC_OLD_STABLE_VERSION_BLACKLIST = [ - "3005-5", - "3006", - "3006-1", - "3006-6", "master", "nightly", ] MAC_STABLE_VERSION_BLACKLIST = [ - "3003", - "3004", - "3005", - "3005-5", "master", "nightly", ] GIT_VERSION_BLACKLIST = [ - "3005-5", - "3006-1", + "3006-6", "nightly", ] @@ -398,7 +207,6 @@ GIT_DISTRO_BLACKLIST = [ "almalinux-8", "centos-7", "centos-stream8", - "fedora-37", "fedora-38", "fedora-39", "opensuse-15", @@ -424,8 +232,6 @@ DISTRO_DISPLAY_NAMES = { "debian-10": "Debian 10", "debian-11": "Debian 11", "debian-12": "Debian 12", - ## DGM "fedora-36": "Fedora 36", - "fedora-37": "Fedora 37", "fedora-38": "Fedora 38", "fedora-39": "Fedora 39", "gentoo": "Gentoo", @@ -434,15 +240,14 @@ DISTRO_DISPLAY_NAMES = { "opensuse-tumbleweed": "Opensuse Tumbleweed", "oraclelinux-7": "Oracle Linux 7", "oraclelinux-8": "Oracle Linux 8", - "photon-3": "Photon OS 3", "photon-4": "Photon OS 4", + "photon-5": "Photon OS 5", "rockylinux-8": "Rocky Linux 8", "rockylinux-9": "Rocky Linux 9", "ubuntu-2004": "Ubuntu 20.04", "ubuntu-2204": "Ubuntu 22.04", - "macos-1015": "macOS 10.15", - "macos-11": "macOS 11", "macos-12": "macOS 12", + "macos-13": "macOS 13", "freebsd-131": "FreeBSD 13.1", "freebsd-123": "FreeBSD 12.3", "openbsd-7": "OpenBSD 7", @@ -509,29 +314,21 @@ def generate_test_jobs(): continue # BSD's don't have a stable release, only use git - for bootstrap_type in ("git",): + for bootstrap_type in ["git"]: - BLACKLIST = { - "3003": BLACKLIST_3003, - "3004": BLACKLIST_3004, - } + BLACKLIST = {} if bootstrap_type == "git": BLACKLIST = { - "3003": BLACKLIST_GIT_3003, - "3004": BLACKLIST_GIT_3004, "master": BLACKLIST_GIT_MASTER, } # .0 versions are a virtual version for pinning to the first - # point release of a major release, such as 3003, + # point release of a major release, such as 3006, # there is no git version. if salt_version.endswith("-0"): continue - if ( - salt_version in ("3003", "3004", "master") - and distro in BLACKLIST[salt_version] - ): + if salt_version in ("master") and distro in BLACKLIST[salt_version]: continue kitchen_target = f"{bootstrap_type}-{salt_version}" @@ -552,10 +349,7 @@ def generate_test_jobs(): test_jobs += "\n" for distro in OSX: test_jobs += "\n" - if distro == "macos-1015": - runs_on = "macos-10.15" - else: - runs_on = distro + runs_on = distro runs_on = f"\n runs-on: {runs_on}" ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'" uses = "./.github/workflows/test-macos.yml" @@ -567,25 +361,19 @@ def generate_test_jobs(): ) for salt_version in SALT_VERSIONS: - if salt_version == "latest": - instances.append(salt_version) continue - for bootstrap_type in ("stable", "old-stable"): + for bootstrap_type in ["stable"]: if bootstrap_type == "stable": if salt_version in MAC_STABLE_VERSION_BLACKLIST: continue - if bootstrap_type == "old-stable": - if salt_version in MAC_OLD_STABLE_VERSION_BLACKLIST: - continue - kitchen_target = f"{bootstrap_type}-{salt_version}" instances.append(kitchen_target) - for bootstrap_type in ("default",): + for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: continue instances.append(bootstrap_type) @@ -622,7 +410,7 @@ def generate_test_jobs(): instances.append(salt_version) continue - for bootstrap_type in ("stable",): + for bootstrap_type in ["stable"]: if bootstrap_type == "stable": if salt_version in STABLE_VERSION_BLACKLIST: continue @@ -630,7 +418,7 @@ def generate_test_jobs(): kitchen_target = f"{bootstrap_type}-{salt_version}" instances.append(kitchen_target) - for bootstrap_type in ("default",): + for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: continue instances.append(bootstrap_type) @@ -672,7 +460,6 @@ def generate_test_jobs(): continue for bootstrap_type in ( - "old-stable", "stable", "git", "onedir", @@ -690,12 +477,6 @@ def generate_test_jobs(): if distro not in ONEDIR_RC_DISTROS: continue - if bootstrap_type == "old-stable": - if salt_version in OLD_STABLE_VERSION_BLACKLIST: - continue - if distro not in OLD_STABLE_DISTROS: - continue - if bootstrap_type == "stable": if salt_version in STABLE_VERSION_BLACKLIST: continue @@ -709,18 +490,11 @@ def generate_test_jobs(): continue BLACKLIST = { - "3003": BLACKLIST_3003, - "3004": BLACKLIST_3004, - "3005": BLACKLIST_3005, - "3005-5": BLACKLIST_3005, "3006": BLACKLIST_3006, - "3006-1": BLACKLIST_3006, + "3006-6": BLACKLIST_3006, } if bootstrap_type == "git": BLACKLIST = { - "3003": BLACKLIST_GIT_3003, - "3004": BLACKLIST_GIT_3004, - "3005": BLACKLIST_GIT_3005, "3006": BLACKLIST_GIT_3006, "master": BLACKLIST_GIT_MASTER, } @@ -732,8 +506,7 @@ def generate_test_jobs(): continue if ( - salt_version - in ("3003", "3004", "3005", "3005-5", "3006", "3006-1", "master") + salt_version in ("3006", "3006-6", "master") and distro in BLACKLIST[salt_version] ): continue @@ -741,7 +514,7 @@ def generate_test_jobs(): kitchen_target = f"{bootstrap_type}-{salt_version}" instances.append(kitchen_target) - for bootstrap_type in ("default",): + for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: continue instances.append(bootstrap_type) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f10bf36..e3ad2ad 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -272,7 +272,7 @@ _ONEDIR_DIR="salt" _ONEDIR_NIGHTLY_DIR="salt-dev/${_ONEDIR_DIR}" _PY_EXE="python3" _INSTALL_PY="$BS_FALSE" -_TORNADO_MAX_PY3_VERSION="5.0" +## DGM _TORNADO_MAX_PY3_VERSION="5.0" _POST_NEON_INSTALL=$BS_FALSE _MINIMUM_PIP_VERSION="9.0.1" _MINIMUM_SETUPTOOLS_VERSION="9.1" @@ -313,12 +313,6 @@ __usage() { - onedir_rc Install latest onedir RC release. - onedir_rc [version] Install a specific version. Only supported for onedir RC packages available at repo.saltproject.io - - old-stable Install latest old stable release. - - old-stable [branch] Install latest version on a branch. Only supported - for packages available at repo.saltproject.io - - old-stable [version] Install a specific version. Only supported for - packages available at repo.saltproject.io - To pin a 3xxx minor version, specify it as 3xxx.0 Examples: - ${__ScriptName} @@ -334,9 +328,6 @@ __usage() { - ${__ScriptName} onedir 3006 - ${__ScriptName} onedir_rc - ${__ScriptName} onedir_rc 3006 - - ${__ScriptName} old-stable - - ${__ScriptName} old-stable 3005 - - ${__ScriptName} old-stable 3005.5 Options: @@ -417,7 +408,7 @@ __usage() { (only available for Ubuntu based distributions) -x Changes the Python version used to install Salt. Python 2.7 is no longer supported. - Fedora git installation, CentOS 7, Ubuntu 20.04 support python3. + Fedora git installation, CentOS 8, Ubuntu 20.04 support python3. -X Do not start daemons after installation -y Installs a different python version on host. Currently this has only been tested with CentOS 7 and is considered experimental. This will install the @@ -607,7 +598,7 @@ if [ "$#" -gt 0 ];then fi # Check installation type -if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc|old-stable)')" = "" ]; then +if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi @@ -631,7 +622,7 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="latest" ITYPE="onedir" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3005|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then ONEDIR_REV="$1" _ONEDIR_REV="$1" ITYPE="onedir" @@ -642,30 +633,7 @@ elif [ "$ITYPE" = "stable" ]; then ITYPE="onedir" shift else - echo "Unknown stable version: $1 (valid: 3005, 3006, latest)" - exit 1 - fi - fi - -# If doing old-stable install, check if version specified -elif [ "$ITYPE" = "old-stable" ]; then - if [ "$#" -eq 0 ];then - ITYPE="stable" - else - if [ "$(echo "$1" | grep -E '^(3003|3004|3005)$')" != "" ]; then - STABLE_REV="$1" - ITYPE="stable" - shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{3}(\.[0-9]*)?)$')" != "" ]; then - # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix - ITYPE="stable" - STABLE_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') - if [ "$(uname)" != "Darwin" ]; then - STABLE_REV="archive/$STABLE_REV" - fi - shift - else - echo "Unknown old stable version: $1 (valid: 3003, 3004, 3005)" + echo "Unknown stable version: $1 (valid: 3006, latest)" exit 1 fi fi @@ -674,19 +642,14 @@ elif [ "$ITYPE" = "onedir" ]; then if [ "$#" -eq 0 ];then ONEDIR_REV="latest" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3005|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then ONEDIR_REV="$1" shift - elif [ "$(echo "$1" | grep -E '^(3005(\.[0-9]*)?)')" != "" ]; then - # Handle the 3005.0 version as 3005 archive (pin to minor) and strip the fake ".0" suffix - ONEDIR_REV=$(echo "$1" | sed -E 's/^(3005)\.0$/\1/') - ONEDIR_REV="minor/$ONEDIR_REV" - shift elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" shift else - echo "Unknown onedir version: $1 (valid: 3005, 3006, latest, nightly.)" + echo "Unknown onedir version: $1 (valid: 3006, latest, nightly.)" exit 1 fi fi @@ -715,7 +678,7 @@ elif [ "$ITYPE" = "onedir_rc" ]; then ONEDIR_REV="minor/$1" shift else - echo "Unknown onedir_rc version: $1 (valid: 3005-1, latest.)" + echo "Unknown onedir_rc version: $1 (valid: 3006-6, latest.)" exit 1 fi fi @@ -811,7 +774,7 @@ if [ -n "$_PY_EXE" ]; then _PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7) if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -1035,17 +998,14 @@ __derive_debian_numeric_version() { INPUT_VERSION="$(cat /etc/debian_version)" fi if [ -z "$NUMERIC_VERSION" ]; then - if [ "$INPUT_VERSION" = "wheezy/sid" ]; then - # I've found an EC2 wheezy image which did not tell its version - NUMERIC_VERSION=$(__parse_version_string "7.0") - elif [ "$INPUT_VERSION" = "jessie/sid" ]; then - NUMERIC_VERSION=$(__parse_version_string "8.0") - elif [ "$INPUT_VERSION" = "stretch/sid" ]; then - NUMERIC_VERSION=$(__parse_version_string "9.0") - elif [ "$INPUT_VERSION" = "buster/sid" ]; then + if [ "$INPUT_VERSION" = "buster/sid" ]; then NUMERIC_VERSION=$(__parse_version_string "10.0") elif [ "$INPUT_VERSION" = "bullseye/sid" ]; then NUMERIC_VERSION=$(__parse_version_string "11.0") + elif [ "$INPUT_VERSION" = "bookworm/sid" ]; then + NUMERIC_VERSION=$(__parse_version_string "12.0") + elif [ "$INPUT_VERSION" = "trixie/sid" ]; then + NUMERIC_VERSION=$(__parse_version_string "13.0") else echowarn "Unable to parse the Debian Version (codename: '$INPUT_VERSION')" fi @@ -1392,6 +1352,7 @@ __gather_sunos_system_info() { if [ "${DISTRO_NAME}" = "SmartOS" ]; then VIRTUAL_TYPE="smartmachine" + # shellcheck disable=SC2034 if [ "$(zonename)" = "global" ]; then VIRTUAL_TYPE="global" fi @@ -1454,28 +1415,21 @@ __gather_system_info() { #---------------------------------------------------------------------------------------------------------------------- # shellcheck disable=SC2034 __ubuntu_derivatives_translation() { - UBUNTU_DERIVATIVES="(trisquel|linuxmint|linaro|elementary_os|neon|pop)" + UBUNTU_DERIVATIVES="(trisquel|linuxmint|elementary_os|pop)" # Mappings - ## DGM trisquel_6_ubuntu_base="12.04" - ## DGM linuxmint_13_ubuntu_base="12.04" - ## DGM linuxmint_17_ubuntu_base="14.04" - ## DGM linuxmint_18_ubuntu_base="16.04" - ## DGM linuxmint_19_ubuntu_base="18.04" - linuxmint_20_ubuntu_base="20.04" -<<<<<<< HEAD - linuxmint_21_ubuntu_base="22.04" - linaro_12_ubuntu_base="12.04" - elementary_os_02_ubuntu_base="12.04" - neon_16_ubuntu_base="16.04" - neon_18_ubuntu_base="18.04" -======= + trisquel_10_ubuntu_base="20.04" + trisquel_11_ubuntu_base="22.04" ## DGM linaro_12_ubuntu_base="12.04" ## DGM elementary_os_02_ubuntu_base="12.04" ## DGM neon_16_ubuntu_base="16.04" ## DGM neon_18_ubuntu_base="18.04" ->>>>>>> ddbec60 (Update minimum versions and correct Redat 7 base key) neon_20_ubuntu_base="20.04" neon_22_ubuntu_base="22.04" + linuxmint_20_ubuntu_base="20.04" + linuxmint_21_ubuntu_base="20.04" + elementary_os_06_ubuntu_base="20.04" + elementary_os_07_ubuntu_base="20.04" + pop_20_ubuntu_base="22.04" pop_22_ubuntu_base="22.04" # Translate Ubuntu derivatives to their base Ubuntu version @@ -1520,32 +1474,19 @@ __check_dpkg_architecture() { fi __REPO_ARCH="$DPKG_ARCHITECTURE" - __REPO_ARCH_DEB='deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg]' + __REPO_ARCH_DEB='deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg]' __return_code=0 case $DPKG_ARCHITECTURE in "i386") - error_msg="$_REPO_URL likely doesn't have all required 32-bit packages for $DISTRO_NAME $DISTRO_MAJOR_VERSION." + error_msg="$_REPO_URL likely doesn't have required 32-bit packages for $DISTRO_NAME $DISTRO_MAJOR_VERSION." # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location - __REPO_ARCH="amd64" + __return_code=1 ;; "amd64") error_msg="" ;; "arm64") - if [ "$_CUSTOM_REPO_URL" != "null" ]; then - warn_msg="Support for arm64 is experimental, make sure the custom repository used has the expected structure and contents." - else - # Saltstack official repository has arm64 metadata beginning with Debian 10, - # use amd64 repositories on arm64 for anything older, since all pkgs are arch-independent - if [ "$DISTRO_NAME_L" = "debian" ] && [ "$DISTRO_MAJOR_VERSION" -lt 10 ]; then - __REPO_ARCH="amd64" - else - __REPO_ARCH="arm64" - fi - __REPO_ARCH_DEB="deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=$__REPO_ARCH]" - warn_msg="Support for arm64 packages is experimental and might rely on architecture-independent packages from the amd64 repository." - fi error_msg="" ;; "armhf") @@ -1570,10 +1511,10 @@ __check_dpkg_architecture() { if [ "${error_msg}" != "" ]; then echoerror "${error_msg}" if [ "$ITYPE" != "git" ]; then - echoerror "You can try git installation mode, i.e.: sh ${__ScriptName} git v2017.7.2." + echoerror "You can try git installation mode, i.e.: sh ${__ScriptName} git v3006.6." echoerror "It may be necessary to use git installation mode with pip and disable the SaltStack apt repository." echoerror "For example:" - echoerror " sh ${__ScriptName} -r -P git v2017.7.2" + echoerror " sh ${__ScriptName} -r -P git v3006.6" fi fi @@ -1625,8 +1566,14 @@ __ubuntu_codename_translation() { "22") DISTRO_CODENAME="jammy" ;; + "23") + DISTRO_CODENAME="lunar" + ;; + "24") + DISTRO_CODENAME="noble" + ;; *) - DISTRO_CODENAME="trusty" + DISTRO_CODENAME="jammy" ;; esac } @@ -1657,6 +1604,7 @@ __debian_derivatives_translation() { raspbian_9_debian_base="9.0" raspbian_10_debian_base="10.0" raspbian_11_debian_base="11.0" + raspbian_12_debian_base="12.0" bunsenlabs_9_debian_base="9.0" turnkey_9_debian_base="9.0" @@ -1726,14 +1674,9 @@ __debian_codename_translation() { ;; "12") DISTRO_CODENAME="bookworm" - # FIXME - TEMPORARY - # use bullseye packages until bookworm packages are available - DISTRO_CODENAME="bullseye" - DISTRO_MAJOR_VERSION=11 - rv=11 ;; *) - DISTRO_CODENAME="stretch" + DISTRO_CODENAME="bookworm" ;; esac } @@ -1759,23 +1702,11 @@ __check_end_of_life_versions() { ubuntu) # Ubuntu versions not supported # - # < 16.04 - # = 16.10 - # = 17.04, 17.10 - # = 18.10 - # = 19.04, 19.10 + # < 20.04 # = 20.10 - ## if [ "$DISTRO_MAJOR_VERSION" -lt 16 ] || \ - ## [ "$DISTRO_MAJOR_VERSION" -eq 17 ] || \ - ## [ "$DISTRO_MAJOR_VERSION" -eq 19 ] || \ - ## { [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - ## { [ "$DISTRO_MAJOR_VERSION" -eq 18 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - ## { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then - ## echoerror "End of life distributions are not supported." - ## echoerror "Please consider upgrading to the next stable. See:" - ## echoerror " https://wiki.ubuntu.com/Releases" - ## exit 1 - ## fi + # = 21.04, 21.10 + # = 22.10 + # = 23.04, 23.10 if [ "$DISTRO_MAJOR_VERSION" -lt 20 ] || \ { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ { [ "$DISTRO_MAJOR_VERSION" -eq 21 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]; } || \ @@ -1826,9 +1757,8 @@ __check_end_of_life_versions() { ;; fedora) - # Fedora lower than 33 are no longer supported - ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 33 ]; then - if [ "$DISTRO_MAJOR_VERSION" -lt 37 ]; then + # Fedora lower than 38 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 38 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://fedoraproject.org/wiki/Releases" @@ -2059,21 +1989,16 @@ if [ "$ITYPE" = "git" ]; then esac fi - if [ "$_POST_NEON_INSTALL" -eq $BS_TRUE ]; then - echo - echowarn "Post Neon git based installations will always install salt" - echowarn "and its dependencies using pip which will be upgraded to" - echowarn "at least v${_MINIMUM_PIP_VERSION}, and, in case the setuptools version is also" - echowarn "too old, it will be upgraded to at least v${_MINIMUM_SETUPTOOLS_VERSION}" - echo - echowarn "You have 10 seconds to cancel and stop the bootstrap process..." - echo - sleep 10 - _PIP_ALLOWED=$BS_TRUE - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi + echo + echowarn "Post Neon git based installations will always install salt" + echowarn "and its dependencies using pip which will be upgraded to" + echowarn "at least v${_MINIMUM_PIP_VERSION}, and, in case the setuptools version is also" + echowarn "too old, it will be upgraded to at least v${_MINIMUM_SETUPTOOLS_VERSION}" + echo + echowarn "You have 10 seconds to cancel and stop the bootstrap process..." + echo + sleep 10 + _PIP_ALLOWED=$BS_TRUE fi @@ -2178,7 +2103,8 @@ __apt_key_fetch() { tempfile="$(__temp_gpg_pub)" __fetch_url "$tempfile" "$url" || return 1 - cp -f "$tempfile" /usr/share/keyrings/salt-archive-keyring.gpg && chmod 644 /usr/share/keyrings/salt-archive-keyring.gpg || return 1 + mkdir -p /etc/apt/keyrings || return 1 + cp -f "$tempfile" /etc/apt/keyrings/salt-archive-keyring-2023.gpg && chmod 644 /etc/apt/keyrings/salt-archive-keyring-2023.gpg || return 1 rm -f "$tempfile" return 0 @@ -2547,10 +2473,10 @@ __overwriteconfig() { # If python does not have yaml installed we're on Arch and should use python2 # but no more support, hence error out elif python -c "import yaml" 2> /dev/null; then - good_python=python + good_python=python # assume python is python 3 on Arch else ## good_python=python2 - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -2867,7 +2793,7 @@ __install_salt_from_repo_post_neon() { _py_exe="$1" if [ "${_py_exe}" = "" ]; then - _py_exe='python3' + _py_exe="python3" fi echodebug "__install_salt_from_repo_post_neon py_exe=$_py_exe" @@ -2909,13 +2835,8 @@ EOM ) if ! ${_py_exe} -c "$CHECK_PIP_VERSION_SCRIPT"; then # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip" - if [ "${_py_version}" = "3.5" ]; then - echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION},<21.0'" - ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION},<21.0" - else - echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION}'" - ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" - fi + echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION}'" + ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" sleep 1 echodebug "PATH: ${PATH}" _pip_cmd="pip${_py_version}" @@ -2936,10 +2857,7 @@ EOM _setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}" if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - # We also lock setuptools to <45 which is the latest release to support both py2 and py3 - ## DGM how did we get here, should have errored out before - ## _setuptools_dep="${_setuptools_dep},<45" - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -3105,11 +3023,11 @@ __enable_universe_repository() { __install_saltstack_ubuntu_repository() { # Workaround for latest non-LTS Ubuntu if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - # remove 22 version when salt packages for 22.04 are available - [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 22 ]; then + { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." - UBUNTU_VERSION=20.04 - UBUNTU_CODENAME="focal" + UBUNTU_VERSION=22.04 + UBUNTU_CODENAME="jammy" else UBUNTU_VERSION=${DISTRO_VERSION} UBUNTU_CODENAME=${DISTRO_CODENAME} @@ -3131,16 +3049,18 @@ __install_saltstack_ubuntu_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 - __PY_VERSION_REPO="apt" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is not supported, only Python 3" + return 1 fi + __PY_VERSION_REPO="salt/py3" + # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - __apt_key_fetch "$SALTSTACK_UBUNTU_URL/salt-archive-keyring.gpg" || return 1 + __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -3148,10 +3068,11 @@ __install_saltstack_ubuntu_repository() { __install_saltstack_ubuntu_onedir_repository() { # Workaround for latest non-LTS Ubuntu if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - [ "$DISTRO_MAJOR_VERSION" -eq 21 ]; then + { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." - UBUNTU_VERSION=20.04 - UBUNTU_CODENAME="focal" + UBUNTU_VERSION=22.04 + UBUNTU_CODENAME="jammy" else UBUNTU_VERSION=${DISTRO_VERSION} UBUNTU_CODENAME=${DISTRO_CODENAME} @@ -3173,10 +3094,7 @@ __install_saltstack_ubuntu_onedir_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 - __PY_VERSION_REPO="apt" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" - fi + __PY_VERSION_REPO="salt/py3" # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${ONEDIR_REV}/" @@ -3185,14 +3103,7 @@ __install_saltstack_ubuntu_onedir_repository() { fi echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then - __apt_key_fetch "${SALTSTACK_UBUNTU_URL}salt-archive-keyring.gpg" || return 1 - elif [ "$(echo "${ONEDIR_REV}" | grep -E '(latest|nightly)')" != "" ]; then - __apt_key_fetch "${SALTSTACK_UBUNTU_URL}salt-archive-keyring.gpg" || \ - __apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - else - __apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - fi + __apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -3211,27 +3122,22 @@ install_ubuntu_deps() { __PACKAGES='' - if [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then - # Minimal systems might not have upstart installed, install it - __PACKAGES="upstart" - fi - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then PY_PKG_VER=3 else - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi - if [ "$DISTRO_MAJOR_VERSION" -ge 16 ] && [ -z "$_PY_EXE" ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" + if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] && [ -z "$_PY_EXE" ]; then + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi if [ "$_VIRTUALENV_DIR" != "null" ]; then __PACKAGES="${__PACKAGES} python-virtualenv" # TBD DGM - implies Python 2, need check - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi # Need python-apt for managing packages via Salt @@ -3259,13 +3165,6 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - if [ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then - # The user did not pass a custom sleep value as an argument, let's increase the default value - echodebug "On Ubuntu systems we increase the default sleep value to 10." - echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." - _SLEEP=10 - fi - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3277,6 +3176,8 @@ install_ubuntu_stable_deps() { if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc. + ## also apt-key is deprecated if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3312,7 +3213,7 @@ install_ubuntu_git_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then PY_PKG_VER=3 else - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -3333,13 +3234,6 @@ install_ubuntu_git_deps() { } install_ubuntu_onedir_deps() { - if [ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then - # The user did not pass a custom sleep value as an argument, let's increase the default value - echodebug "On Ubuntu systems we increase the default sleep value to 10." - echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." - _SLEEP=10 - fi - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3351,6 +3245,8 @@ install_ubuntu_onedir_deps() { if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc. + ## also apt-key is deprecated if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3401,44 +3297,24 @@ install_ubuntu_git() { if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} else - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - # We can use --prefix on debian based ditributions - ### DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ### DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - ### DGM else - ### DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" - ### DGM fi - _POST_NEON_PIP_INSTALL_ARGS="" - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 + _POST_NEON_PIP_INSTALL_ARGS="" + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 + cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 - # Account for new path for services files in later releases - if [ -d "pkg/common" ]; then - _SERVICE_DIR="pkg/common" - else - _SERVICE_DIR="pkg" - fi - - sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service - return 0 + # Account for new path for services files in later releases + if [ -d "pkg/common" ]; then + _SERVICE_DIR="pkg/common" else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - # shellcheck disable=SC2086 - "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 - else - # shellcheck disable=SC2086 - "${_PYEXE}" setup.py "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 + _SERVICE_DIR="pkg" fi + sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service return 0 + } install_ubuntu_onedir() { @@ -3637,11 +3513,13 @@ __install_saltstack_debian_repository() { DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" - __PY_VERSION_REPO="apt" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi + __PY_VERSION_REPO="salt/py3" + # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3671,11 +3549,13 @@ __install_saltstack_debian_onedir_repository() { DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" - __PY_VERSION_REPO="apt" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi + __PY_VERSION_REPO="salt/py3" + # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3699,14 +3579,7 @@ __install_saltstack_debian_onedir_repository() { fi echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then - __apt_key_fetch "${SALTSTACK_DEBIAN_URL}salt-archive-keyring.gpg" || return 1 - elif [ "$(echo "${ONEDIR_REV}" | grep -E '(latest|nightly)')" != "" ]; then - __apt_key_fetch "${SALTSTACK_DEBIAN_URL}salt-archive-keyring.gpg" || \ - __apt_key_fetch "${SALTSTACK_DEBIAN_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - else - __apt_key_fetch "${SALTSTACK_DEBIAN_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - fi + __apt_key_fetch "${SALTSTACK_DEBIAN_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -4250,11 +4123,13 @@ __install_saltstack_fedora_onedir_repository() { REPO_REV="latest" fi - __PY_VERSION_REPO="yum" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi + __PY_VERSION_REPO="salt/py3" + GPG_KEY="SALT-PROJECT-GPG-PUBKEY-2023.pub" REPO_FILE="/etc/yum.repos.d/salt.repo" @@ -4569,7 +4444,7 @@ install_fedora_onedir_deps() { fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_repository. This call has + # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has # its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then __install_saltstack_fedora_onedir_repository || return 1 @@ -4637,68 +4512,6 @@ install_fedora_onedir_post() { # # CentOS Install Functions # -__install_saltstack_rhel_repository() { - if [ "${DISTRO_MAJOR_VERSION}" -ge 9 ]; then - echoerror "Old stable repository unavailable on RH variants greater than or equal to 9" - echoerror "Use the stable install type." - exit 1 - fi - - if [ "$ITYPE" = "stable" ]; then - repo_rev="$STABLE_REV" - else - repo_rev="latest" - fi - - __PY_VERSION_REPO="yum" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" - fi - - # Avoid using '$releasever' variable for yum. - # Instead, this should work correctly on all RHEL variants. - base_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/" - if [ "${DISTRO_MAJOR_VERSION}" -eq 7 ]; then - gpg_key="SALTSTACK-GPG-KEY.pub base/RPM-GPG-KEY-CentOS-7.key" - elif [ "${DISTRO_MAJOR_VERSION}" -ge 9 ]; then - gpg_key="SALTSTACK-GPG-KEY2.pub" - else - gpg_key="SALTSTACK-GPG-KEY.pub" - fi - - gpg_key_urls="" - for key in $gpg_key; do - gpg_key_urls=$(printf "${base_url}${key},%s" "$gpg_key_urls") - done - - repo_file="/etc/yum.repos.d/salt.repo" - - if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then - cat <<_eof > "$repo_file" -[saltstack] -name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever -baseurl=${base_url} -skip_if_unavailable=True -gpgcheck=1 -gpgkey=${gpg_key_urls} -enabled=1 -enabled_metadata=1 -_eof - - fetch_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${repo_rev}/" - for key in $gpg_key; do - __rpm_import_gpg "${fetch_url}${key}" || return 1 - done - - yum clean metadata || return 1 - elif [ "$repo_rev" != "latest" ]; then - echowarn "salt.repo already exists, ignoring salt version argument." - echowarn "Use -F (forced overwrite) to install $repo_rev." - fi - - return 0 -} - __install_saltstack_rhel_onedir_repository() { if [ "$ITYPE" = "stable" ]; then repo_rev="$ONEDIR_REV" @@ -4706,29 +4519,21 @@ __install_saltstack_rhel_onedir_repository() { repo_rev="latest" fi - __PY_VERSION_REPO="yum" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" - else - echoerror "Python 2 is no longer supported, only Py3 packages" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi + __PY_VERSION_REPO="salt/py3" + # Avoid using '$releasever' variable for yum. # Instead, this should work correctly on all RHEL variants. base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${ONEDIR_REV}/" if [ "${ONEDIR_REV}" = "nightly" ] ; then base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then - if [ "${DISTRO_MAJOR_VERSION}" -eq 9 ]; then - gpg_key="SALTSTACK-GPG-KEY2.pub" - else - gpg_key="SALTSTACK-GPG-KEY.pub" - fi - else - gpg_key="SALT-PROJECT-GPG-PUBKEY-2023.pub" - fi + + gpg_key="SALT-PROJECT-GPG-PUBKEY-2023.pub" gpg_key_urls="" for key in $gpg_key; do @@ -4778,14 +4583,14 @@ install_centos_stable_deps() { fi if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then - __install_saltstack_rhel_repository || return 1 + __install_saltstack_rhel_onedir_repository || return 1 fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_repository. This call has + # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has # its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then - __install_saltstack_rhel_repository || return 1 + __install_saltstack_rhel_onedir_repository || return 1 fi if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then @@ -4794,39 +4599,6 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig" fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - # YAML module is used for generating custom master/minion configs - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PACKAGES="${__PACKAGES} python3-pyyaml python3-setuptools" - else - ## DGM __PACKAGES="${__PACKAGES} python2-pyyaml" - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - elif [ "$DISTRO_MAJOR_VERSION" -eq 7 ]; then - # YAML module is used for generating custom master/minion configs - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PACKAGES="${__PACKAGES} python36-PyYAML python36-setuptools" - else - ## DGM __PACKAGES="${__PACKAGES} PyYAML" - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - else - ## DGM what is going on here, Python 3.4 is long dead on RHEL 7 - ## was this for RHEL 6 - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - ## DGM # YAML module is used for generating custom master/minion configs - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM __PACKAGES="${__PACKAGES} python34-PyYAML python34-setuptools" - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} PyYAML" - ## DGM fi - fi - fi - __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 @@ -4935,106 +4707,15 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python36" fi else - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 - - ## DGM PY_PKG_VER="" - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="${__PACKAGES} python2" - ## DGM elif [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then - ## DGM PY_PKG_VER=27 - ## DGM __PACKAGES="${__PACKAGES} python27" - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} python" - ## DGM fi fi - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - ## DGM _install_m2crypto_req=false - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM _py=${_PY_EXE} - ## DGM if [ "$DISTRO_MAJOR_VERSION" -gt 6 ]; then - ## DGM _install_m2crypto_req=true - ## DGM fi - ## DGM else - ## DGM if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then - ## DGM _install_m2crypto_req=true - ## DGM fi - ## DGM _py="python" - - ## DGM # Only Py2 needs python-futures - ## DGM __PACKAGES="${__PACKAGES} python-futures" - - ## DGM # There is no systemd-python3 package as of this writing - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then - ## DGM __PACKAGES="${__PACKAGES} systemd-python" - ## DGM fi - ## DGM fi - - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __install_tornado_pip "${_py}" || return 1 - ## DGM __PACKAGES="${__PACKAGES} python3-m2crypto" - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} m2crypto python${PY_PKG_VER}-crypto" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-jinja2" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-zmq" - - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" - ## DGM fi - - ## DGM if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ]; then - ## DGM # Install Python if "-y" was passed in. - ## DGM __install_python || return 1 - ## DGM fi - - ## DGM if [ "${_PY_EXE}" != "" ] && [ "$_PIP_ALLOWED" -eq "$BS_TRUE" ]; then - ## DGM # If "-x" is defined, install dependencies with pip based on the Python version given. - ## DGM _PIP_PACKAGES="m2crypto!=0.33.0 jinja2 msgpack-python pycrypto PyYAML tornado<5.0 zmq futures>=2.0" - - ## DGM # install swig and openssl on cent6 - ## DGM if "$_install_m2crypto_req"; then - ## DGM __yum_install_noinput openssl-devel swig || return 1 - ## DGM fi - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # Filter out any commented lines from the requirements file - ## DGM _REQ_LINES="$(grep '^[^#]' "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM for SINGLE_PACKAGE in ${_PIP_PACKAGES}; do - ## DGM __REQUIRED_VERSION="$(grep "${SINGLE_PACKAGE}" "${_REQ_LINES}")" - ## DGM if [ "${__REQUIRED_VERSION}" != "" ]; then - ## DGM _PIP_PACKAGES=$(echo "$_PIP_PACKAGES" | sed "s/${SINGLE_PACKAGE}/${__REQUIRED_VERSION}/") - ## DGM fi - ## DGM done - ## DGM fi - - ## DGM if [ "$_INSTALL_CLOUD" -eq "${BS_TRUE}" ]; then - ## DGM _PIP_PACKAGES="${_PIP_PACKAGES} apache-libcloud" - ## DGM fi - - ## DGM __install_pip_pkgs "${_PIP_PACKAGES}" "${_PY_EXE}" || return 1 - ## DGM else - ## DGM # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 - ## DGM fi - ## DGM else - ## DGM if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then - ## DGM # Install Python if "-y" was passed in. - ## DGM __install_python || return 1 - ## DGM fi - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 - ## DGM fi - - ## DGM new code if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then # Install Python if "-y" was passed in. __install_python || return 1 fi + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -5054,25 +4735,12 @@ install_centos_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - ## DGM_PYEXE='python2' - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi echodebug "_PY_EXE: $_PY_EXE" - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 - else - $_PYEXE setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 - fi + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 } @@ -5133,7 +4801,7 @@ install_centos_onedir_deps() { fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_repository. This call has + # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has # its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then __install_saltstack_rhel_onedir_repository || return 1 @@ -5156,7 +4824,6 @@ install_centos_onedir_deps() { __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi - return 0 } @@ -6011,31 +5678,9 @@ install_alpine_linux_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - ## DGM apk -U add python2 py-virtualenv py2-crypto py2-m2crypto py2-setuptools \ - ## DGM py2-jinja2 py2-yaml py2-markupsafe py2-msgpack py2-psutil \ - ## DGM py2-zmq zeromq py2-requests || return 1 - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # We're on the master branch, install whichever tornado is on the requirements file - ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then - ## DGM apk -U add py2-tornado || return 1 - ## DGM fi - ## DGM fi - else - apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc || return 1 - _PY_EXE=python3 - return 0 - fi - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi + apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc || return 1 + _PY_EXE=python3 + return 0 } install_alpine_linux_stable() { @@ -6061,19 +5706,8 @@ install_alpine_linux_stable() { install_alpine_linux_git() { - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ## DGM python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 - ## DGM else - ## DGM python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - ## DGM fi + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 + return 0 } install_alpine_linux_post() { @@ -6173,189 +5807,6 @@ daemons_running_alpine_linux() { # Amazon Linux AMI Install Functions # -## DGM # Support for Amazon Linux (EOL) -## DGM install_amazon_linux_ami_deps() { -## DGM # Shim to figure out if we're using old (rhel) or new (aws) rpms. -## DGM _USEAWS="$BS_FALSE" -## DGM pkg_append="python" -## DGM -## DGM if [ "$ITYPE" = "stable" ]; then -## DGM repo_rev="$STABLE_REV" -## DGM else -## DGM repo_rev="latest" -## DGM fi -## DGM -## DGM if echo "$repo_rev" | grep -E -q '^archive'; then -## DGM year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) -## DGM else -## DGM year=$(echo "$repo_rev" | cut -c1-4) -## DGM fi -## DGM -## DGM if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ -## DGM [ "$year" -gt 2016 ]; then -## DGM _USEAWS="$BS_TRUE" -## DGM pkg_append="python27" -## DGM fi -## DGM -## DGM # We need to install yum-utils before doing anything else when installing on -## DGM # Amazon Linux ECS-optimized images. See issue #974. -## DGM __yum_install_noinput yum-utils -## DGM -## DGM # Do upgrade early -## DGM if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then -## DGM yum -y update || return 1 -## DGM fi -## DGM -## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then -## DGM __REPO_FILENAME="salt.repo" -## DGM -## DGM # Set a few vars to make life easier. -## DGM if [ "$_USEAWS" -eq "$BS_TRUE" ]; then -## DGM base_url="$HTTP_VAL://${_REPO_URL}/yum/amazon/latest/\$basearch/$repo_rev/" -## DGM gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" -## DGM repo_name="SaltStack repo for Amazon Linux" -## DGM else -## DGM base_url="$HTTP_VAL://${_REPO_URL}/yum/redhat/6/\$basearch/$repo_rev/" -## DGM gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" -## DGM repo_name="SaltStack repo for RHEL/CentOS 6" -## DGM fi -## DGM -## DGM # This should prob be refactored to use __install_saltstack_rhel_repository() -## DGM # With args passed in to do the right thing. Reformatted to be more like the -## DGM # amazon linux yum file. -## DGM if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then -## DGM cat <<_eof > "/etc/yum.repos.d/${__REPO_FILENAME}" -## DGM [saltstack-repo] -## DGM name=$repo_name -## DGM failovermethod=priority -## DGM priority=10 -## DGM gpgcheck=1 -## DGM gpgkey=$gpg_key -## DGM baseurl=$base_url -## DGM _eof -## DGM fi -## DGM -## DGM fi -## DGM -## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then -## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 -## DGM # which is already installed -## DGM __PACKAGES="m2crypto ${pkg_append}-crypto ${pkg_append}-jinja2 ${pkg_append}-PyYAML" -## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-msgpack ${pkg_append}-requests ${pkg_append}-zmq" -## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-futures" -## DGM # shellcheck disable=SC2086 -## DGM __yum_install_noinput "${__PACKAGES}" || return 1 -## DGM fi -## DGM -## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then -## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" -## DGM # shellcheck disable=SC2086 -## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 -## DGM fi -## DGM } -## DGM -## DGM install_amazon_linux_ami_git_deps() { -## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then -## DGM yum -y install ca-certificates || return 1 -## DGM fi -## DGM -## DGM PIP_EXE='pip' -## DGM if __check_command_exists python2.7; then -## DGM if ! __check_command_exists pip2.7; then -## DGM if ! __check_command_exists easy_install-2.7; then -## DGM __yum_install_noinput python27-setuptools -## DGM fi -## DGM /usr/bin/easy_install-2.7 pip || return 1 -## DGM fi -## DGM PIP_EXE='/usr/local/bin/pip2.7' -## DGM _PY_EXE='python2.7' -## DGM fi -## DGM -## DGM install_amazon_linux_ami_deps || return 1 -## DGM -## DGM if ! __check_command_exists git; then -## DGM __yum_install_noinput git || return 1 -## DGM fi -## DGM -## DGM __git_clone_and_checkout || return 1 -## DGM -## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then -## DGM __PACKAGES="" -## DGM __PIP_PACKAGES="" -## DGM -## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then -## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" -## DGM __PACKAGES="${__PACKAGES} python27-pip" -## DGM __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" -## DGM fi -## DGM -## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then -## DGM # We're on the master branch, install whichever tornado is on the requirements file -## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" -## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then -## DGM __PACKAGES="${__PACKAGES} ${pkg_append}-tornado" -## DGM fi -## DGM fi -## DGM -## DGM if [ "${__PACKAGES}" != "" ]; then -## DGM # shellcheck disable=SC2086 -## DGM __yum_install_noinput "${__PACKAGES}" || return 1 -## DGM fi -## DGM -## DGM if [ "${__PIP_PACKAGES}" != "" ]; then -## DGM # shellcheck disable=SC2086 -## DGM ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 -## DGM fi -## DGM else -## DGM __PACKAGES="python27-pip python27-setuptools python27-devel gcc" -## DGM # shellcheck disable=SC2086 -## DGM __yum_install_noinput "${__PACKAGES}" || return 1 -## DGM fi -## DGM -## DGM # Let's trigger config_salt() -## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then -## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" -## DGM CONFIG_SALT_FUNC="config_salt" -## DGM fi -## DGM -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_stable() { -## DGM install_centos_stable || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_stable_post() { -## DGM install_centos_stable_post || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_restart_daemons() { -## DGM install_centos_restart_daemons || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_git() { -## DGM install_centos_git || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_git_post() { -## DGM install_centos_git_post || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_testing() { -## DGM install_centos_testing || return 1 -## DGM return 0 -## DGM } -## DGM -## DGM install_amazon_linux_ami_testing_post() { -## DGM install_centos_testing_post || return 1 -## DGM return 0 -## DGM } - # Support for Amazon Linux 2 install_amazon_linux_ami_2_git_deps() { if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then @@ -6363,22 +5814,14 @@ install_amazon_linux_ami_2_git_deps() { fi if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi install_amazon_linux_ami_2_deps || return 1 - if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - - ## DGM PY_PKG_VER=2 - ## DGM PIP_EXE='/bin/pip' - else - PY_PKG_VER=3 - PIP_EXE='/bin/pip3' - fi + PY_PKG_VER=3 + PIP_EXE='/bin/pip3' __PACKAGES="python${PY_PKG_VER}-pip" if ! __check_command_exists "${PIP_EXE}"; then @@ -6392,60 +5835,9 @@ install_amazon_linux_ami_2_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - __PACKAGES="" - __PIP_PACKAGES="" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud"a - # TBD DGM Need to check what Amazon 2023 give here - if [ "$PARSED_VERSION" -eq "2" ]; then - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq "3" ]; then - __PACKAGES="${__PACKAGES} python3-pip" - __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} python2-pip" - fi - else - ## DGM __PACKAGES="${__PACKAGES} python27-pip" - echoerror "Amazon Linux is no longer supported" - return 1 - fi - __PIP_PACKAGES="${__PIP_PACKAGES} apache-libcloud>=$_LIBCLOUD_MIN_VERSION" - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq "3" ]; then - __PIP_PACKAGES="${__PIP_PACKAGES} tornado<$_TORNADO_MAX_PY3_VERSION" - else - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-tornado" - fi - fi - fi - - if [ "${__PIP_PACKAGES}" != "" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) in order to install ${__PIP_PACKAGES}" - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip" - fi - - if [ "${__PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - - if [ "${__PIP_PACKAGES}" != "" ]; then - # shellcheck disable=SC2086 - ${PIP_EXE} install "${__PIP_PACKAGES}" || return 1 - fi - else - __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi + __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" + # shellcheck disable=SC2086 + __yum_install_noinput "${__PACKAGES}" || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6457,11 +5849,10 @@ install_amazon_linux_ami_2_git_deps() { } install_amazon_linux_ami_2_deps() { - # Shim to figure out if we're using old (rhel) or new (aws) rpms. - ## DGM _USEAWS="$BS_FALSE" - - ## TBD DGM check what how pkg_append is used - ## DGM pkg_append="python" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi if [ "$ITYPE" = "stable" ]; then repo_rev="$STABLE_REV" @@ -6469,18 +5860,6 @@ install_amazon_linux_ami_2_deps() { repo_rev="latest" fi - ## DGM if echo "$repo_rev" | grep -E -q '^archive'; then - ## DGM year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) - ## DGM else - ## DGM year=$(echo "$repo_rev" | cut -c1-4) - ## DGM fi - ## DGM - ## DGM if echo "$repo_rev" | grep -E -q '^(latest|2016\.11)$' || \ - ## DGM [ "$year" -gt 2016 ]; then - ## DGM _USEAWS="$BS_TRUE" - ## DGM pkg_append="python" - ## DGM fi - # We need to install yum-utils before doing anything else when installing on # Amazon Linux ECS-optimized images. See issue #974. __yum_install_noinput yum-utils @@ -6492,28 +5871,15 @@ install_amazon_linux_ami_2_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="yum" - PY_PKG_VER="" - repo_label="saltstack-repo" - repo_name="SaltStack repo for Amazon Linux 2" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="py3" - PY_PKG_VER=3 - repo_label="saltstack-py3-repo" - repo_name="SaltStack Python 3 repo for Amazon Linux 2" - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi + PY_PKG_VER=3 + __PY_VERSION_REPO="salt/py3" + repo_label="saltstack-py3-repo" + repo_name="SaltStack Python 3 repo for Amazon Linux 2" base_url="$HTTP_VAL://${_REPO_URL}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7.key" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" - fi + gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.gpg" - # This should prob be refactored to use __install_saltstack_rhel_repository() + # This should prob be refactored to use __install_saltstack_rhel_onedir_repository() # With args passed in to do the right thing. Reformatted to be more like the # amazon linux yum file. if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then @@ -6530,24 +5896,6 @@ _eof fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - ## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - ## DGM # which is already installed - ## DGM if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then - ## DGM __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" - ## DGM else - ## DGM __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" - ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" - - ## DGM # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 - fi - if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -6556,10 +5904,10 @@ _eof } install_amazon_linux_ami_2_onedir_deps() { - # Shim to figure out if we're using old (rhel) or new (aws) rpms. - ## DGM _USEAWS="$BS_FALSE" - ## TBD DGM check what how pkg_append is used - pkg_append="python" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi if [ "$ITYPE" = "onedir" ]; then repo_rev="$ONEDIR_REV" @@ -6578,16 +5926,10 @@ install_amazon_linux_ami_2_onedir_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="yum" - PY_PKG_VER="" - repo_label="saltstack-repo" - repo_name="SaltStack repo for Amazon Linux 2" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="py3" - PY_PKG_VER=3 - repo_label="saltstack-py3-repo" - repo_name="SaltStack Python 3 repo for Amazon Linux 2" + __PY_VERSION_REPO="salt/py3" + PY_PKG_VER=3 + repo_label="saltstack-py3-repo" + repo_name="SaltStack Python 3 repo for Amazon Linux 2" fi base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" @@ -6595,16 +5937,9 @@ install_amazon_linux_ami_2_onedir_deps() { base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7.key" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" - fi - else - gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.pub" - fi + gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.pub" - # This should prob be refactored to use __install_saltstack_rhel_repository() + # This should prob be refactored to use __install_saltstack_rhel_onedir_repository() # With args passed in to do the right thing. Reformatted to be more like the # amazon linux yum file. if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then @@ -6619,26 +5954,6 @@ baseurl=$base_url _eof fi - fi - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - ## DGM # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - ## DGM # which is already installed - ## DGM if [ -n "${PY_PKG_VER}" ] && [ "${PY_PKG_VER}" -eq 3 ]; then - ## DGM __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" - ## DGM else - ## DGM __PACKAGES="m2crypto PyYAML ${pkg_append}-futures" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" - ## DGM __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" - - ## DGM # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 - fi - if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -6734,11 +6049,6 @@ install_amazon_linux_ami_2023_git_deps() { } install_amazon_linux_ami_2023_onedir_deps() { - # Shim to figure out if we're using old (rhel) or new (aws) rpms. - ## DGM _USEAWS="$BS_FALSE" - ## TBD DGM check what how pkg_append is used - pkg_append="python" - if [ "$ITYPE" = "onedir" ]; then repo_rev="$ONEDIR_REV" else @@ -6756,8 +6066,7 @@ install_amazon_linux_ami_2023_onedir_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="yum" - __PY_VERSION_REPO="py3" + __PY_VERSION_REPO="salt/py3" PY_PKG_VER=3 repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2023" @@ -6769,7 +6078,7 @@ install_amazon_linux_ami_2023_onedir_deps() { gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.pub" - # This should prob be refactored to use __install_saltstack_rhel_repository() + # This should prob be refactored to use __install_saltstack_rhel_onedir_repository() # With args passed in to do the right thing. Reformatted to be more like the # amazon linux yum file. if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then @@ -6785,17 +6094,6 @@ _eof fi fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 - # which is already installed - __PACKAGES="${pkg_append}${PY_PKG_VER}-m2crypto ${pkg_append}${PY_PKG_VER}-pyyaml" - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-crypto ${pkg_append}${PY_PKG_VER}-jinja2 procps-ng" - __PACKAGES="${__PACKAGES} ${pkg_append}${PY_PKG_VER}-msgpack ${pkg_append}${PY_PKG_VER}-requests ${pkg_append}${PY_PKG_VER}-zmq" - - # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 - fi - if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -6880,7 +6178,8 @@ install_arch_linux_stable_deps() { fi if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - PY_PKG_VER=2 + echoerror "Python 2 is no longer supported, only Python 3" + return 1 else PY_PKG_VER="" fi @@ -6902,6 +6201,13 @@ install_arch_linux_stable_deps() { } install_arch_linux_git_deps() { + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + echoerror "Python 2 is no longer supported, only Python 3" + return 1 + else + PY_PKG_VER="" + fi + install_arch_linux_stable_deps # Don't fail if un-installing python2-distribute threw an error @@ -6910,37 +6216,6 @@ install_arch_linux_git_deps() { fi __git_clone_and_checkout || return 1 - - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - ## DGM pacman -R --noconfirm python2-distribute - ## DGM pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ - ## DGM python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \ - ## DGM python2-pyzmq zeromq python2-requests python2-systemd || return 1 - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # We're on the master branch, install whichever tornado is on the requirements file - ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then - ## DGM pacman -Su --noconfirm --needed python2-tornado - ## DGM fi - ## DGM fi - ## DGM else - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM PY_PKG_VER=2 - ## DGM else - ## DGM PY_PKG_VER="" - ## DGM fi - ## DGM __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM # shellcheck disable=SC2086 - ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" - ## DGM fi - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM PY_PKG_VER=2 - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - else - PY_PKG_VER="" - fi __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 pacman -Su --noconfirm --needed "${__PACKAGES}" @@ -6975,23 +6250,16 @@ install_arch_linux_stable() { } install_arch_linux_git() { - - _POST_NEON_PIP_INSTALL_ARGS="${_POST_NEON_PIP_INSTALL_ARGS} --use-pep517" - _PIP_DOWNLOAD_ARGS="${_PIP_DOWNLOAD_ARGS} --use-pep517" - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi - ## DGM what ws this doing ?? TBD - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ## DGM python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 - ## DGM else - ## DGM python2 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - ## DGM fi + _POST_NEON_PIP_INSTALL_ARGS="${_POST_NEON_PIP_INSTALL_ARGS} --use-pep517" + _PIP_DOWNLOAD_ARGS="${_PIP_DOWNLOAD_ARGS} --use-pep517" + + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 + return 0 return 0 } @@ -7138,20 +6406,18 @@ install_arch_linux_onedir_post() { # __install_saltstack_photon_onedir_repository() { + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python 2 is no longer supported, only Python 3" + return 1 + fi + if [ "$ITYPE" = "stable" ]; then REPO_REV="$ONEDIR_REV" else REPO_REV="latest" fi - __PY_VERSION_REPO="yum" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - __PY_VERSION_REPO="py3" - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - + __PY_VERSION_REPO="salt/py3" REPO_FILE="/etc/yum.repos.d/salt.repo" if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then @@ -7176,22 +6442,23 @@ __install_saltstack_photon_onedir_repository() { } install_photon_deps() { + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python 2 is no longer supported, only Python 3" + return 1 + fi + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then tdnf -y update || return 1 fi __PACKAGES="${__PACKAGES:=}" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -lt 3 ]; then - echoerror "There are no Python 2 stable packages for Fedora, only Py3 packages" - return 1 - fi - PY_PKG_VER=3 __PACKAGES="${__PACKAGES} libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip python${PY_PKG_VER}-m2crypto python${PY_PKG_VER}-pyyaml" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-systemd" + if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" fi @@ -7219,15 +6486,14 @@ install_photon_stable_post() { } install_photon_git_deps() { - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - # Packages are named python3- - PY_PKG_VER=3 - else - ## PY_PKG_VER=2 - echoerror "Python 2 is no longer supported, only Py3 packages" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi + # Packages are named python3- + PY_PKG_VER=3 + __PACKAGES="" if ! __check_command_exists ps; then __PACKAGES="${__PACKAGES} procps-ng" @@ -7244,44 +6510,6 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - ## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - ## DGM __PACKAGES="${__PACKAGES} ca-certificates" - ## DGM fi - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" - ## DGM fi - - ## DGM install_photon_deps || return 1 - - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM if __check_command_exists python3; then - ## DGM __python="python3" - ## DGM fi - ## DGM elif [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM if __check_command_exists python2; then - ## DGM __python="python2" - ## DGM fi - ## DGM else - ## DGM if ! __check_command_exists python; then - ## DGM echoerror "Unable to find a python binary?!" - ## DGM return 1 - ## DGM fi - ## DGM # Let's hope it's the right one - ## DGM __python="python" - ## DGM fi - - ## DGM grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" | while IFS=' - ## DGM ' read -r dep; do - ## DGM echodebug "Running '${__python}' -m pip install '${dep}'" - ## DGM "${__python}" -m pip install "${dep}" || return 1 - ## DGM done - ## DGM else - ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" - ## DGM # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 - ## DGM fi __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" # shellcheck disable=SC2086 __tdnf_install_noinput "${__PACKAGES}" || return 1 @@ -7307,8 +6535,7 @@ install_photon_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - ## DGM _PYEXE='python2' - echoerror "Python 2 is no longer supported, only Py3 packages" + echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -7406,7 +6633,7 @@ install_photon_onedir_deps() { fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_repository. This call has + # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has # its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then __install_saltstack_photon_onedir_repository || return 1 @@ -7488,18 +6715,7 @@ install_freebsd_git_deps() { fi __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - SALT_DEPENDENCIES=$(/usr/local/sbin/pkg rquery %dn py39-salt) - # shellcheck disable=SC2086 - /usr/local/sbin/pkg install -y "${SALT_DEPENDENCIES}" python || return 1 - - /usr/local/sbin/pkg install -y py39-requests || return 1 - /usr/local/sbin/pkg install -y py39-tornado4 || return 1 - - else - /usr/local/sbin/pkg install -y python py39-pip py39-setuptools libzmq4 libunwind || return 1 - fi + /usr/local/sbin/pkg install -y python py39-pip py39-setuptools libzmq4 libunwind || return 1 echodebug "Adapting paths to FreeBSD" # The list of files was taken from Salt's BSD port Makefile @@ -7555,41 +6771,7 @@ install_freebsd_git() { __PYTHON_PATH=$(readlink -f "$(command -v python3)") __ESCAPED_PYTHON_PATH=$(echo "${__PYTHON_PATH}" | sed 's/\//\\\//g') - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 - for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do - __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 - sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" - sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" - chmod +x "/usr/local/etc/rc.d/${script}" || return 1 - done - - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - # Install from git - if [ ! -f salt/syspaths.py ]; then - # We still can't provide the system paths, salt 0.16.x - ${__PYTHON_PATH} setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - else - ${__PYTHON_PATH} setup.py \ - --salt-root-dir=/ \ - --salt-config-dir="${_SALT_ETC_DIR}" \ - --salt-cache-dir="${_SALT_CACHE_DIR}" \ - --salt-sock-dir=/var/run/salt \ - --salt-srv-root-dir="${_SALT_ETC_DIR}" \ - --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 \ - "${SETUP_PY_INSTALL_ARGS}" install \ - || return 1 - fi - + __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" @@ -7681,12 +6863,7 @@ install_openbsd_git_deps() { fi __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - pkg_add -I -v py3-pip py3-setuptools - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi + pkg_add -I -v py3-pip py3-setuptools # # Let's trigger config_salt() @@ -7703,18 +6880,7 @@ install_openbsd_git() { # # Install from git # - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - if [ ! -f salt/syspaths.py ]; then - # We still can't provide the system paths, salt 0.16.x - /usr/local/bin/python2.7 setup.py "${SETUP_PY_INSTALL_ARGS}" install || return 1 - fi + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 } @@ -7785,218 +6951,6 @@ install_openbsd_onedir() { # ####################################################################################################################### -####################################################################################################################### -# -# SmartOS Install Functions -# -install_smartos_deps() { - smartos_deps="$(pkgin show-deps salt | grep '^\s' | grep -v '\snot' | xargs) py27-m2crypto" - pkgin -y install "${smartos_deps}" || 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 - _TEMP_CONFIG_DIR="/tmp" - CONFIG_SALT_FUNC="config_salt" - - # Let's download, since they were not provided, the default configuration files - if [ ! -f "$_SALT_ETC_DIR/minion" ] && [ ! -f "$_TEMP_CONFIG_DIR/minion" ]; then - # shellcheck disable=SC2086 - curl $_CURL_ARGS -s -o "$_TEMP_CONFIG_DIR/minion" -L \ - https://raw.githubusercontent.com/saltstack/salt/master/conf/minion || return 1 - fi - if [ ! -f "$_SALT_ETC_DIR/master" ] && [ ! -f "$_TEMP_CONFIG_DIR/master" ]; then - # shellcheck disable=SC2086 - curl $_CURL_ARGS -s -o "$_TEMP_CONFIG_DIR/master" -L \ - https://raw.githubusercontent.com/saltstack/salt/master/conf/master || return 1 - 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 - pkgin -y install "${_EXTRA_PACKAGES}" || return 1 - fi - - return 0 -} - -install_smartos_git_deps() { - install_smartos_deps || return 1 - - if ! __check_command_exists git; then - pkgin -y install git || return 1 - fi - - __git_clone_and_checkout || return 1 - - ## TBD DGM Even post NEON using Python 2.7, do we care about smart os - ## - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # Install whichever tornado is in the requirements file - ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" - - ## DGM # Install whichever futures is in the requirements file - ## DGM __REQUIRED_FUTURES="$(grep futures "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM __check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_FUTURES}'" - - ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then - ## DGM if ! __check_command_exists pip; then - ## DGM pkgin -y install py27-pip - ## DGM fi - ## DGM pip install -U "${__REQUIRED_TORNADO}" - ## DGM fi - - ## DGM if [ "${__REQUIRED_FUTURES}" != "" ]; then - ## DGM if ! __check_command_exists pip; then - ## DGM pkgin -y install py27-pip - ## DGM fi - ## DGM pip install -U "${__REQUIRED_FUTURES}" - ## DGM fi - ## DGM fi - ## DGM else - ## DGM if ! __check_command_exists pip; then - ## DGM pkgin -y install py27-pip - ## DGM fi - ## DGM pkgin -y install py27-setuptools - ## DGM fi - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi - - return 0 -} - -install_smartos_stable() { - pkgin -y install salt || return 1 - return 0 -} - -install_smartos_git() { - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - # Use setuptools in order to also install dependencies - # 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 --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install || return 1 - return 0 -} - -install_smartos_post() { - smf_dir="/opt/custom/smf" - - # Install manifest files if needed. - for fname in api master minion syndic; do - # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - svcs "network/salt-$fname" > /dev/null 2>&1 - if [ $? -eq 1 ]; then - if [ ! -f "$_TEMP_CONFIG_DIR/salt-$fname.xml" ]; then - # shellcheck disable=SC2086 - curl "$_CURL_ARGS" -s -o "$_TEMP_CONFIG_DIR/salt-$fname.xml" -L \ - "https://raw.githubusercontent.com/saltstack/salt/master/pkg/smartos/salt-$fname.xml" - fi - svccfg import "$_TEMP_CONFIG_DIR/salt-$fname.xml" - if [ "${VIRTUAL_TYPE}" = "global" ]; then - if [ ! -d "$smf_dir" ]; then - mkdir -p "$smf_dir" || return 1 - fi - if [ ! -f "$smf_dir/salt-$fname.xml" ]; then - __copyfile "$_TEMP_CONFIG_DIR/salt-$fname.xml" "$smf_dir/" || return 1 - fi - fi - fi - done - - return 0 -} - -install_smartos_git_post() { - smf_dir="/opt/custom/smf" - - # Install manifest files if needed. - for fname in api master minion syndic; do - # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - svcs "network/salt-$fname" > /dev/null 2>&1 - if [ $? -eq 1 ]; then - svccfg import "${_SALT_GIT_CHECKOUT_DIR}/pkg/smartos/salt-$fname.xml" - if [ "${VIRTUAL_TYPE}" = "global" ]; then - if [ ! -d "$smf_dir" ]; then - mkdir -p "$smf_dir" - fi - if [ ! -f "$smf_dir/salt-$fname.xml" ]; then - __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/smartos/salt-$fname.xml" "$smf_dir/" - fi - fi - fi - done - - return 0 -} - -install_smartos_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return - - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - # Stop if running && Start service - svcadm disable "salt-$fname" > /dev/null 2>&1 - svcadm enable "salt-$fname" - done - - return 0 -} -install_smartos_onedir() { -# -# call install_smartos_stable -# - install_smartos_stable || return 1 - - return 0 -} -# -# Ended SmartOS Install Functions -# -####################################################################################################################### ####################################################################################################################### # @@ -8137,28 +7091,6 @@ install_opensuse_git_deps() { __git_clone_and_checkout || return 1 - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - ## DGM __zypper_install patch || return 1 - - ## DGM __PACKAGES="libzmq5 python-Jinja2 python-m2crypto python-msgpack-python python-pycrypto python-pyzmq python-xml python-futures" - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # We're on the master branch, install whichever tornado is on the requirements file - ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then - ## DGM __PACKAGES="${__PACKAGES} python-tornado" - ## DGM fi - ## DGM fi - - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM __PACKAGES="${__PACKAGES} python-apache-libcloud" - ## DGM fi - ## DGM # Check for Tumbleweed - ## DGM elif [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then - ## DGM __PACKAGES="python3-pip gcc-c++ python3-pyzmq-devel" - ## DGM else - ## DGM __PACKAGES="python-pip python-setuptools gcc" - ## DGM fi if [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then __PACKAGES="python3-pip gcc-c++ python3-pyzmq-devel" else @@ -8204,12 +7136,7 @@ install_opensuse_stable() { } install_opensuse_git() { - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - fi - - python setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 } @@ -8352,13 +7279,14 @@ install_opensuse_15_stable_deps() { # SUSE only packages Salt for Python 3 on Leap 15 # Py3 is the default bootstrap install for Leap 15 - # However, git installs might specify "-x python2" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - PY_PKG_VER=2 - else - PY_PKG_VER=3 + # However, git installs that specify "-x python2" are disallowed + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi + PY_PKG_VER=3 + # YAML module is used for generating custom master/minion configs # requests is still used by many salt modules __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" @@ -8376,6 +7304,11 @@ install_opensuse_15_stable_deps() { } install_opensuse_15_git_deps() { + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi + install_opensuse_15_stable_deps || return 1 if ! __check_command_exists git; then @@ -8384,43 +7317,8 @@ install_opensuse_15_git_deps() { __git_clone_and_checkout || return 1 - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM PY_PKG_VER=2 - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - else - PY_PKG_VER=3 - fi - - __PACKAGES="python${PY_PKG_VER}-xml" - - ## DGM if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - ## DGM # Py3 is the default bootstrap install for Leap 15 - ## DGM # However, git installs might specify "-x python2" - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM # This is required by some of the python2 packages below - ## DGM __PACKAGES="${__PACKAGES} libpython2_7-1_0 python2-futures python-ipaddress" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} libzmq5 python${PY_PKG_VER}-Jinja2 python${PY_PKG_VER}-msgpack" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pycrypto python${PY_PKG_VER}-pyzmq" - - ## DGM if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - ## DGM # We're on the master branch, install whichever tornado is on the requirements file - ## DGM __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - ## DGM if [ "${__REQUIRED_TORNADO}" != "" ]; then - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - ## DGM fi - ## DGM fi - - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apache-libcloud" - ## DGM fi - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM fi - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + PY_PKG_VER=3 + __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 __zypper_install "${__PACKAGES}" || return 1 @@ -8443,12 +7341,7 @@ install_opensuse_15_git() { _PYEXE=python3 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - fi - - ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 } @@ -8655,151 +7548,6 @@ install_suse_12_restart_daemons() { # ####################################################################################################################### -####################################################################################################################### -# -# SUSE Enterprise 11 -# - -install_suse_11_stable_deps() { - __opensuse_prep_install || return 1 - - ## TBD DGM Suse 11 appears to be Python 2 - what to do here - - # YAML module is used for generating custom master/minion configs - __PACKAGES="python-PyYAML" - - # shellcheck disable=SC2086,SC2090 - __zypper_install "${__PACKAGES}" || return 1 - - # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which - # we want to install, even with --non-interactive. - # Let's try to install the higher version first and then the lower one in case of failure - __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - __zypper_install "${_EXTRA_PACKAGES}" || return 1 - fi - - return 0 -} - -install_suse_11_git_deps() { - install_suse_11_stable_deps || return 1 - - if ! __check_command_exists git; then - __zypper_install git || return 1 - fi - - __git_clone_and_checkout || return 1 - - __PACKAGES="" - # shellcheck disable=SC2089 - __PACKAGES="${__PACKAGES} libzmq4 python-Jinja2 python-msgpack-python python-pycrypto" - __PACKAGES="${__PACKAGES} python-pyzmq python-xml python-zypp" - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PACKAGES="${__PACKAGES} python-tornado" - fi - fi - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python-apache-libcloud" - fi - - # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi - - return 0 -} - -install_suse_11_onedir_deps() { - install_suse_11_stable_deps || return 1 - return 0 -} - -install_suse_11_stable() { - install_opensuse_stable || return 1 - return 0 -} - -install_suse_11_git() { - install_opensuse_git || return 1 - return 0 -} - -install_suse_11_onedir() { - install_opensuse_stable || return 1 - return 0 -} - -install_suse_11_stable_post() { - install_opensuse_stable_post || return 1 - return 0 -} - -install_suse_11_git_post() { - install_opensuse_git_post || return 1 - return 0 -} - -install_suse_11_onedir_post() { - install_opensuse_stable_post || return 1 - return 0 -} - -install_suse_11_restart_daemons() { - install_opensuse_restart_daemons || return 1 - return 0 -} - - -# -# End of SUSE Enterprise 11 -# -####################################################################################################################### - -####################################################################################################################### -# -# SUSE Enterprise General Functions -# - -# Used for both SLE 11 and 12 -install_suse_check_services() { - if [ ! -f /bin/systemctl ]; then - # Not running systemd!? Don't check! - return 0 - fi - - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - __check_services_systemd "salt-$fname" || return 1 - done - - return 0 -} - -# -# End of SUSE Enterprise General Functions -# -####################################################################################################################### ####################################################################################################################### # @@ -8919,27 +7667,6 @@ install_gentoo_git_deps() { GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES:-} dev-vcs/git" fi - # Salt <3000 does not automatically install dependencies. It has to be done manually. - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES:-} - sys-apps/pciutils - dev-python/pyyaml - dev-python/pyzmq - dev-python/libnacl - dev-python/pycryptodome - dev-python/py - dev-python/requests - Date: Thu, 8 Feb 2024 11:16:02 -0700 Subject: [PATCH 11/80] Removed support for SLES 12 and updated pre-commit versions --- .pre-commit-config.yaml | 14 ++-- AUTHORS.rst | 1 + CONTRIBUTING.md | 173 +++++++++++++++++++-------------------- Dockerfile | 2 +- Vagrantfile | 2 +- bootstrap-salt.sh | 122 --------------------------- kitchen.macos.yml | 1 + kitchen.yml | 9 +- requirements/release.in | 2 +- requirements/release.txt | 10 +-- tests/conftest.py | 2 +- 11 files changed, 108 insertions(+), 230 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 655876b..f3d0b6a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ minimum_pre_commit_version: 1.15.2 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-merge-conflict # Check for files that contain merge conflict strings. - id: trailing-whitespace # Trims trailing whitespace. @@ -12,12 +12,12 @@ repos: - id: end-of-file-fixer # Makes sure files end in a newline and only a newline. - repo: https://github.com/executablebooks/mdformat - rev: 0.7.14 + rev: 0.7.17 hooks: - id: mdformat - repo: https://github.com/s0undt3ch/python-tools-scripts - rev: "0.12.0" + rev: "0.18.6" hooks: - id: tools alias: actionlint @@ -30,7 +30,7 @@ repos: - actionlint - repo: https://github.com/jazzband/pip-tools - rev: 6.13.0 + rev: 7.3.0 hooks: - id: pip-compile files: ^requirements/release\.(in|txt)$ @@ -38,20 +38,20 @@ repos: - requirements/release.in - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v3.15.0 hooks: - id: pyupgrade name: Rewrite Code to be Py3.9+ args: [--py39-plus] - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.2 + rev: v3.12.0 hooks: - id: reorder-python-imports args: [--py39-plus] - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 24.1.0 hooks: - id: black args: [] diff --git a/AUTHORS.rst b/AUTHORS.rst index fb75513..a3f8f01 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -54,6 +54,7 @@ Daniel Wallace gtmanfred danielwallace@gtmanfred.com Darko Cerdic darkocerdic Daryl Turner darylturner d.turner@arkadin.com David J. Felix DavidJFelix +David Murphy daithi david-dm.murphy@broadcom.com denmat denmat Denys Havrysh vutny denys.gavrysh@gmail.com deployboy deployboy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 259448d..2abaf90 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,20 +21,20 @@ Please read the following guidelines before you 1. **Use the GitHub issue search** -- check if the issue has already been reported. If it has been, please comment on the existing issue. -2. **Check if the issue has been fixed** -- If you found a possible problem, or bug, +1. **Check if the issue has been fixed** -- If you found a possible problem, or bug, please try to bootstrap using the bootstrap scirpt from the develop branch. The issue you are having might have already been fixed and it's just not yet included in the stable release. - ``` - curl -o bootstrap-salt.sh -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh - sudo sh bootstrap-salt.sh git master - ``` + ``` + curl -o bootstrap-salt.sh -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh + sudo sh bootstrap-salt.sh git master + ``` -3. **Isolate the demonstrable problem** -- make sure that the +1. **Isolate the demonstrable problem** -- make sure that the code in the project's repository is *definitely* responsible for the issue. -4. **Include a reproducible example** -- Provide the steps which +1. **Include a reproducible example** -- Provide the steps which led you to the problem. Please try to be as detailed as possible in your report. What is your @@ -163,8 +163,8 @@ The release process consists of the following steps: 1. Merge in any outstanding PRs that are ready. 1. Add new contributors to the [AUTHORS](https://github.com/saltstack/salt-bootstrap/blob/develop/AUTHORS.rst) file. 1. Update the [ChangeLog](https://github.com/saltstack/salt-bootstrap/blob/develop/ChangeLog). -1. Update the version number in the bootstrap script. The version number is date-based, ``. - For example, version `2018.08.15` was released on August 15, 2018. +1. Update the version number in the bootstrap script. The version number is number-based major version with minor version, `<300X.Y>`. + For example, version `3006.6` is major version `3006` and minior version `6`. 1. Merge the `develop` branch into the `stable` branch. 1. Update `bootstrap.saltproject.io` with the new stable release. The checksum on the [README page](https://github.com/saltstack/salt-bootstrap/blob/develop/README.rst) @@ -177,83 +177,82 @@ The following operating systems are detected, but Salt and its dependency installation functions are not developed yet: - BSD: - - NetBSD + - NetBSD - Linux: - - Slackware + - Slackware - SunOS: - - OpenIndiana - - Oracle Solaris - - OmniOS (Illumos) - + - OpenIndiana + - Oracle Solaris + - OmniOS (Illumos) In order to install Salt for a distribution, you need to define the following: 1. To Install Dependencies, which is required, one of: - ``` - install____deps - install_____deps - install___deps - install____deps - install___deps - install__deps - ``` + ``` + install____deps + install_____deps + install___deps + install____deps + install___deps + install__deps + ``` -2. Optionally, define a minion configuration function, which will be called if the - ``-c`` option is passed. One of: +1. Optionally, define a minion configuration function, which will be called if the + `-c` option is passed. One of: - ``` - config____salt - config_____salt - config___salt - config____salt - config___salt - config__salt - config_salt (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) - ``` + ``` + config____salt + config_____salt + config___salt + config____salt + config___salt + config__salt + config_salt (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) + ``` -3. Optionally, define a Salt master pre-seed function, which will be called if the - ``-k`` (pre-seed master keys) option is passed. One of: +1. Optionally, define a Salt master pre-seed function, which will be called if the + `-k` (pre-seed master keys) option is passed. One of: - ``` - preseed____master - preseed_____master - preseed___master - preseed____master - preseed___master - preseed__master - preseed_master (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) - ``` + ``` + preseed____master + preseed_____master + preseed___master + preseed____master + preseed___master + preseed__master + preseed_master (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) + ``` -4. To install salt, which, of course, is required, one of: +1. To install salt, which, of course, is required, one of: - ``` - install___ - install____ - install__ - ``` + ``` + install___ + install____ + install__ + ``` -5. Optionally, define a post install function, one of: +1. Optionally, define a post install function, one of: - ``` - install____post - install_____post - install___post - install____post - install___post - install__post - ``` + ``` + install____post + install_____post + install___post + install____post + install___post + install__post + ``` -6. Optionally, define a start daemons function, one of: +1. Optionally, define a start daemons function, one of: - ``` - install____restart_daemons - install_____restart_daemons - install___restart_daemons - install____restart_daemons - install___restart_daemons - install__restart_daemons - ``` + ``` + install____restart_daemons + install_____restart_daemons + install___restart_daemons + install____restart_daemons + install___restart_daemons + install__restart_daemons + ``` **NOTE** @@ -262,26 +261,26 @@ start if they're not running. 7. Optionally, define a daemons running function, one of: - ``` - daemons_running___ - daemons_running____ - daemons_running__ - daemons_running___ - daemons_running__ - daemons_running_ - daemons_running (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) - ``` + ``` + daemons_running___ + daemons_running____ + daemons_running__ + daemons_running___ + daemons_running__ + daemons_running_ + daemons_running (THIS ONE IS ALREADY DEFINED AS THE DEFAULT) + ``` -8. Optionally, check enabled Services: +1. Optionally, check enabled Services: - ``` - install____check_services - install_____check_services - install___check_services - install____check_services - install___check_services - install__check_services - ``` + ``` + install____check_services + install_____check_services + install___check_services + install____check_services + install___check_services + install__check_services + ``` **NOTE** diff --git a/Dockerfile b/Dockerfile index bfcafd6..4508764 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu-upstart:14.04 +FROM ubuntu:20.04 MAINTAINER "SaltStack Team" # Bootstrap script options: install Salt Master by default diff --git a/Vagrantfile b/Vagrantfile index cb4d64d..4a8a57f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/xenial64" + config.vm.box = "ubuntu/focal64" # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user's system. diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e3ad2ad..855905a 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -7426,128 +7426,6 @@ install_suse_15_restart_daemons() { # ####################################################################################################################### -####################################################################################################################### -# -# SUSE Enterprise 12 -# - -install_suse_12_stable_deps() { - __opensuse_prep_install || return 1 - - - ## TBD DGM Suse 12 appears to be Python 2 - what to do here - - # YAML module is used for generating custom master/minion configs - # requests is still used by many salt modules - # Salt needs python-zypp installed in order to use the zypper module - __PACKAGES="python-PyYAML python-requests python-zypp" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python-apache-libcloud" - fi - - # shellcheck disable=SC2086,SC2090 - __zypper_install "${__PACKAGES}" || return 1 - - # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which - # we want to install, even with --non-interactive. - # Let's try to install the higher version first and then the lower one in case of failure - - ## TBD DGM what to do about these - ## DGM __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - __zypper_install "${_EXTRA_PACKAGES}" || return 1 - fi - - return 0 -} - -install_suse_12_git_deps() { - install_suse_12_stable_deps || return 1 - - if ! __check_command_exists git; then - __zypper_install git-core || return 1 - fi - - __git_clone_and_checkout || return 1 - - __PACKAGES="" - # shellcheck disable=SC2089 - __PACKAGES="${__PACKAGES} libzmq4 python-Jinja2 python-msgpack-python python-pycrypto" - __PACKAGES="${__PACKAGES} python-pyzmq python-xml" - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then - # We're on the master branch, install whichever tornado is on the requirements file - __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" - if [ "${__REQUIRED_TORNADO}" != "" ]; then - __PACKAGES="${__PACKAGES} python-tornado" - fi - fi - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python-apache-libcloud" - fi - - # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi - - return 0 -} - -install_suse_12_onedir_deps() { - install_suse_12_stable_deps || return 1 - return 0 -} - -install_suse_12_stable() { - install_opensuse_stable || return 1 - return 0 -} - -install_suse_12_git() { - install_opensuse_git || return 1 - return 0 -} - -install_suse_12_onedir() { - install_opensuse_stable || return 1 - return 0 -} - -install_suse_12_stable_post() { - install_opensuse_stable_post || return 1 - return 0 -} - -install_suse_12_git_post() { - install_opensuse_git_post || return 1 - return 0 -} - -install_suse_12_onedir_post() { - install_opensuse_stable_post || return 1 - return 0 -} - -install_suse_12_restart_daemons() { - install_opensuse_restart_daemons || return 1 - return 0 -} - -# -# End of SUSE Enterprise 12 -# -####################################################################################################################### - ####################################################################################################################### # diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 2892cbd..308efdd 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -14,6 +14,7 @@ provisioner: platforms: - name: macos-12 + - name: macos-13 suites: - name: stable-3006 diff --git a/kitchen.yml b/kitchen.yml index 14e09f0..7e51aae 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -138,17 +138,17 @@ platforms: - name: ubuntu-20.04 driver: run_command: /lib/systemd/systemd - - name: photon-3 + - name: photon-4 driver: - image: photon:3.0 + image: photon:4.0 provision_command: - tdnf -y install rpm procps-ng coreutils gawk - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - systemctl enable sshd.service - - name: photon-4 + - name: photon-5 driver: - image: photon:4.0 + image: photon:5.0 provision_command: - tdnf -y install rpm procps-ng coreutils gawk - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config @@ -252,7 +252,6 @@ suites: - openbsd-6 - opensuse-15 - opensuse-tumbleweed - - ubuntu-1804 - name: quickstart provisioner: diff --git a/requirements/release.in b/requirements/release.in index d0d1a73..11fe4fb 100644 --- a/requirements/release.in +++ b/requirements/release.in @@ -1,3 +1,3 @@ pre-commit -python-tools-scripts >= 0.12.0 +python-tools-scripts >= 0.18.6 boto3 diff --git a/requirements/release.txt b/requirements/release.txt index 5fff107..b009f47 100644 --- a/requirements/release.txt +++ b/requirements/release.txt @@ -2,12 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile '.\requirements\release.in' +# pip-compile requirements/release.in # attrs==23.1.0 # via python-tools-scripts boto3==1.28.79 - # via -r .\requirements\release.in + # via -r requirements/release.in botocore==1.31.79 # via # boto3 @@ -39,13 +39,13 @@ nodeenv==1.8.0 platformdirs==3.11.0 # via virtualenv pre-commit==3.5.0 - # via -r .\requirements\release.in + # via -r requirements/release.in pygments==2.16.1 # via rich python-dateutil==2.8.2 # via botocore -python-tools-scripts==0.18.1 - # via -r .\requirements\release.in +python-tools-scripts==0.18.6 + # via -r requirements/release.in pyyaml==6.0.1 # via pre-commit requests==2.31.0 diff --git a/tests/conftest.py b/tests/conftest.py index 21ec674..864307c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -47,7 +47,7 @@ def target_python_version(): @pytest.fixture(scope="session") def target_salt_version(): - bootstrap_types = ("git", "stable", "old", "stable", "onedir", "onedir_rc") + bootstrap_types = ("git", "stable", "onedir", "onedir_rc") # filter out any bootstrap types and then join target_salt = ".".join( From 67c52529d987d616f7763b059ccc652f585cbfcc Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 11:40:01 -0700 Subject: [PATCH 12/80] Updated ruby to version 3.2.3, a supported version of ruby --- .github/workflows/test-bsd.yml | 2 +- .github/workflows/test-linux.yml | 2 +- .github/workflows/test-macos.yml | 2 +- .github/workflows/test-windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-bsd.yml b/.github/workflows/test-bsd.yml index 753956d..2246717 100644 --- a/.github/workflows/test-bsd.yml +++ b/.github/workflows/test-bsd.yml @@ -48,7 +48,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.10 + ruby-version: 3.2.3 bundler-cache: true - name: Update Vagrant diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index c1eb4ad..8b98ac6 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -40,7 +40,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.10 + ruby-version: 3.2.3 bundler-cache: true - name: Set up Python 3.9 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 0c6c0da..10b0f21 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -47,7 +47,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.10 + ruby-version: 3.2.3 bundler-cache: true - name: Set up Python 3.9 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a9ae83b..d4616e5 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -50,7 +50,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.10 + ruby-version: 3.2.3 bundler-cache: true - name: Install Chef From 8f36f1371b753a388b5df4b35e2ebf72b2acee38 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 14:36:08 -0700 Subject: [PATCH 13/80] Corrected for fedora_provision_command --- kitchen.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kitchen.yml b/kitchen.yml index 7e51aae..c505f29 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -82,7 +82,9 @@ platforms: run_command: /lib/systemd/systemd - name: fedora-38 driver: - provision_command: *fedora_provision_command + provision_command: &fedora_provision_command + - dnf -y install procps-ng crypto-policies-scripts + - update-crypto-policies --set LEGACY - name: fedora-39 driver: provision_command: *fedora_provision_command From 179b24d9f863df8160299559b43130b82b2e6cf6 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 15:00:59 -0700 Subject: [PATCH 14/80] Fix __PY_VERSION_REPO --- bootstrap-salt.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 bootstrap-salt.sh diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh old mode 100644 new mode 100755 index 855905a..f4305cc --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3054,7 +3054,7 @@ __install_saltstack_ubuntu_repository() { return 1 fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" @@ -3094,7 +3094,7 @@ __install_saltstack_ubuntu_onedir_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${ONEDIR_REV}/" @@ -3518,7 +3518,7 @@ __install_saltstack_debian_repository() { return 1 fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3554,7 +3554,7 @@ __install_saltstack_debian_onedir_repository() { return 1 fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -4128,7 +4128,7 @@ __install_saltstack_fedora_onedir_repository() { return 1 fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" GPG_KEY="SALT-PROJECT-GPG-PUBKEY-2023.pub" @@ -4524,7 +4524,7 @@ __install_saltstack_rhel_onedir_repository() { return 1 fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" # Avoid using '$releasever' variable for yum. # Instead, this should work correctly on all RHEL variants. @@ -5872,7 +5872,7 @@ install_amazon_linux_ami_2_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" PY_PKG_VER=3 - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2" @@ -5926,7 +5926,7 @@ install_amazon_linux_ami_2_onedir_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" PY_PKG_VER=3 repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2" @@ -6066,7 +6066,7 @@ install_amazon_linux_ami_2023_onedir_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" PY_PKG_VER=3 repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2023" @@ -6417,7 +6417,7 @@ __install_saltstack_photon_onedir_repository() { REPO_REV="latest" fi - __PY_VERSION_REPO="salt/py3" + __PY_VERSION_REPO="py3" REPO_FILE="/etc/yum.repos.d/salt.repo" if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then From 739784c6089252eddb8c91bff84a9cf6128b7c02 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 16:57:24 -0700 Subject: [PATCH 15/80] Fix up use of dnf-utils which no longer exists --- bootstrap-salt.sh | 44 ++++++++++++++++++++++++-------------------- kitchen.yml | 12 +++++------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f4305cc..bf037d3 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4167,7 +4167,10 @@ install_fedora_deps() { # Salt on Fedora is Py3 PY_PKG_VER=3 - __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" + ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM but find it on 8 and 9 Centos Stream + ## DGM __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" + __PACKAGES="${__PACKAGES} libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip python${PY_PKG_VER}-m2crypto python${PY_PKG_VER}-pyyaml" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-systemd" @@ -4450,13 +4453,18 @@ install_fedora_onedir_deps() { __install_saltstack_fedora_onedir_repository || return 1 fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM but find it on 8 and 9 Centos Stream + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi - __PACKAGES="${__PACKAGES} procps" + + ## DGM __PACKAGES="yum-utils chkconfig procps" + + __PACKAGES="chkconfig procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4593,13 +4601,7 @@ install_centos_stable_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi - - __PACKAGES="${__PACKAGES} procps" + __PACKAGES="yum-utils chkconfig procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4807,13 +4809,15 @@ install_centos_onedir_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi - __PACKAGES="${__PACKAGES} procps" + ## DGM __PACKAGES="${__PACKAGES} procps" + + __PACKAGES="yum-utils chkconfig procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 diff --git a/kitchen.yml b/kitchen.yml index c505f29..bea3256 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -33,7 +33,7 @@ platforms: driver: provision_command: - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: almalinux-8 - name: amazon-2 @@ -61,7 +61,7 @@ platforms: image: quay.io/centos/centos:stream9 provision_command: - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: centos-stream8 driver: @@ -84,7 +84,7 @@ platforms: driver: provision_command: &fedora_provision_command - dnf -y install procps-ng crypto-policies-scripts - - update-crypto-policies --set LEGACY + - update-crypto-policies - name: fedora-39 driver: provision_command: *fedora_provision_command @@ -123,20 +123,18 @@ platforms: run_command: /usr/lib/systemd/systemd provision_command: - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - name: oraclelinux-8 - name: oraclelinux-7 - name: rockylinux-8 - name: ubuntu-22.04 + - name: ubuntu-23.10 driver: run_command: /lib/systemd/systemd provision_command: - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: ubuntu-23.10 - driver: - run_command: /lib/systemd/systemd - name: ubuntu-20.04 driver: run_command: /lib/systemd/systemd From db9ce9ba03e0be5a20b52c5f0bca474ab015195c Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 8 Feb 2024 18:05:30 -0700 Subject: [PATCH 16/80] Removed use of yum-utils and dnf-utils (doesn't exist) --- bootstrap-salt.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index bf037d3..7b387c2 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4461,8 +4461,7 @@ install_fedora_onedir_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - - ## DGM __PACKAGES="yum-utils chkconfig procps" + ## DGM __PACKAGES="${__PACKAGES} chkconfig procps" __PACKAGES="chkconfig procps" @@ -4601,7 +4600,17 @@ install_centos_stable_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - __PACKAGES="yum-utils chkconfig procps" + ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM and probably don't need these packages since using onedir + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi + ## DGM __PACKAGES="${__PACKAGES} chkconfig procps" + + __PACKAGES="chkconfig procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 From 20c2d4cac8bdef21f7554f9131e77a50b5034428 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 9 Feb 2024 11:39:42 -0700 Subject: [PATCH 17/80] Updated test for yum-utils install --- bootstrap-salt.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7b387c2..ffcd595 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4461,9 +4461,13 @@ install_fedora_onedir_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - ## DGM __PACKAGES="${__PACKAGES} chkconfig procps" + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig" + else + __PACKAGES="yum-utils chkconfig" + fi - __PACKAGES="chkconfig procps" + __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4608,9 +4612,14 @@ install_centos_stable_deps() { ## DGM else ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - ## DGM __PACKAGES="${__PACKAGES} chkconfig procps" - __PACKAGES="chkconfig procps" + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig" + else + __PACKAGES="yum-utils chkconfig" + fi + + __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4818,15 +4827,22 @@ install_centos_onedir_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi + ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM and probably don't need these packages since using onedir ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then ## DGM __PACKAGES="dnf-utils chkconfig" ## DGM else ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - ## DGM __PACKAGES="${__PACKAGES} procps" + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig" + else + __PACKAGES="yum-utils chkconfig" + fi - __PACKAGES="yum-utils chkconfig procps" + __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 From 64866eb574e67e5d087a917e17a98cc2466ac7d3 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 9 Feb 2024 14:16:07 -0700 Subject: [PATCH 18/80] Removed use of procps for RedHat 9 and above, since only exists for 8 and below --- bootstrap-salt.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ffcd595..5c6c87c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4455,19 +4455,22 @@ install_fedora_onedir_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream + ## DGM also EL9 doesn't have propcs ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then ## DGM __PACKAGES="dnf-utils chkconfig" ## DGM else ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" + elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig procps" else - __PACKAGES="yum-utils chkconfig" + __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES} procps" + __PACKAGES="${__PACKAGES}" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4606,6 +4609,7 @@ install_centos_stable_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM also EL9 doesn't have propcs ## DGM and probably don't need these packages since using onedir ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then ## DGM __PACKAGES="dnf-utils chkconfig" @@ -4613,13 +4617,15 @@ install_centos_stable_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" + elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig procps" else - __PACKAGES="yum-utils chkconfig" + __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES} procps" + __PACKAGES="${__PACKAGES}" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4829,6 +4835,7 @@ install_centos_onedir_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM also EL9 doesn't have propcs ## DGM and probably don't need these packages since using onedir ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then ## DGM __PACKAGES="dnf-utils chkconfig" @@ -4836,13 +4843,15 @@ install_centos_onedir_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" + elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="chkconfig procps" else - __PACKAGES="yum-utils chkconfig" + __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES} procps" + __PACKAGES="${__PACKAGES}" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 From 6f543b7a66c5e912415440dc1d533265b8ccc565 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 9 May 2024 17:00:18 -0600 Subject: [PATCH 19/80] Updated for Fedora 40, Ubuntu 24.04, etc --- .github/workflows/ci.yml | 60 ++++++++++++++++++------- .github/workflows/templates/generate.py | 18 ++++++-- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a98e3..a0ec22a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -377,20 +377,6 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' - fedora-38: - name: Fedora 38 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: fedora-38 - display-name: Fedora 38 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' - - fedora-39: name: Fedora 39 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -405,6 +391,20 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + fedora-40: + name: Fedora 40 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-40 + display-name: Fedora 40 + timeout: 20 + instances: '["stable-3006", "git-3006", "stable-3006-6", "git-master", "latest", "default"]' + + gentoo: name: Gentoo if: github.event_name == 'push' @@ -489,6 +489,20 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + oraclelinux-9: + name: Oracle Linux 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: oraclelinux-9 + display-name: Oracle Linux 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + + photon-4: name: Photon OS 4 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -573,6 +587,20 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + ubuntu-2404: + name: Ubuntu 24.04 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: ubuntu-2404 + display-name: Ubuntu 24.04 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + + set-pipeline-exit-status: # This step is just so we can make github require this step, to pass checks # on a pull request instead of requiring all @@ -599,20 +627,22 @@ jobs: - debian-10 - debian-11 - debian-12 - - fedora-38 - fedora-39 + - fedora-40 - gentoo - gentoo-systemd - opensuse-15 - opensuse-tumbleweed - oraclelinux-7 - oraclelinux-8 + - oraclelinux-9 - photon-4 - photon-5 - rockylinux-8 - rockylinux-9 - ubuntu-2004 - ubuntu-2204 + - ubuntu-2404 if: always() steps: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index bd741e0..ced9d77 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -18,20 +18,22 @@ LINUX_DISTROS = [ "debian-10", "debian-11", "debian-12", - "fedora-38", "fedora-39", + "fedora-40", "gentoo", "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", "oraclelinux-7", "oraclelinux-8", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", "ubuntu-2204", + "ubuntu-2404", ] WINDOWS = [ "windows-2019", @@ -61,18 +63,20 @@ STABLE_DISTROS = [ "debian-10", "debian-11", "debian-12", - "fedora-38", "fedora-39", + "fedora-40", "opensuse-15", "opensuse-tumbleweed", "oraclelinux-7", "oraclelinux-8", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", "ubuntu-2204", + "ubuntu-2404", ] ONEDIR_DISTROS = [ @@ -90,12 +94,14 @@ ONEDIR_DISTROS = [ "fedora-39", "oraclelinux-7", "oraclelinux-8", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", "ubuntu-2204", + "ubuntu-2404", ] ONEDIR_RC_DISTROS = [ @@ -111,12 +117,14 @@ ONEDIR_RC_DISTROS = [ "debian-12", "oraclelinux-7", "oraclelinux-8", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-8", "rockylinux-9", "ubuntu-2004", "ubuntu-2204", + "ubuntu-2404", ] BLACKLIST_3006 = [ @@ -147,6 +155,7 @@ BLACKLIST_GIT_3006 = [ "ubuntu-2004", "ubuntu-2204", "ubuntu-2310", + "ubuntu-2404", ] BLACKLIST_GIT_MASTER = [ @@ -212,6 +221,7 @@ GIT_DISTRO_BLACKLIST = [ "opensuse-15", "oraclelinux-7", "oraclelinux-8", + "oraclelinux-9", "rockylinux-8", ] @@ -232,20 +242,22 @@ DISTRO_DISPLAY_NAMES = { "debian-10": "Debian 10", "debian-11": "Debian 11", "debian-12": "Debian 12", - "fedora-38": "Fedora 38", "fedora-39": "Fedora 39", + "fedora-40": "Fedora 40", "gentoo": "Gentoo", "gentoo-systemd": "Gentoo (systemd)", "opensuse-15": "Opensuse 15", "opensuse-tumbleweed": "Opensuse Tumbleweed", "oraclelinux-7": "Oracle Linux 7", "oraclelinux-8": "Oracle Linux 8", + "oraclelinux-9": "Oracle Linux 9", "photon-4": "Photon OS 4", "photon-5": "Photon OS 5", "rockylinux-8": "Rocky Linux 8", "rockylinux-9": "Rocky Linux 9", "ubuntu-2004": "Ubuntu 20.04", "ubuntu-2204": "Ubuntu 22.04", + "ubuntu-2404": "Ubuntu 24.04", "macos-12": "macOS 12", "macos-13": "macOS 13", "freebsd-131": "FreeBSD 13.1", From 69495e9ee0bf8f1127ebf506829a9a0d11d8f6ac Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 4 Jun 2024 17:06:07 -0600 Subject: [PATCH 20/80] Updating changes to bootstrap --- .github/workflows/ci.yml | 80 +------- .github/workflows/templates/generate.py | 91 +-------- .github/workflows/test-bsd.yml | 102 ---------- bootstrap-salt.sh | 249 ++++-------------------- 4 files changed, 38 insertions(+), 484 deletions(-) delete mode 100644 .github/workflows/test-bsd.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0ec22a..85015c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,51 +115,6 @@ jobs: path: exitstatus - freebsd-131: - name: FreeBSD 13.1 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-bsd.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: freebsd-131 - display-name: FreeBSD 13.1 - timeout: 20 - runs-on: macos-12 - instances: '["latest"]' - - - freebsd-123: - name: FreeBSD 12.3 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-bsd.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: freebsd-123 - display-name: FreeBSD 12.3 - timeout: 20 - runs-on: macos-12 - instances: '["latest"]' - - - openbsd-7: - name: OpenBSD 7 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-bsd.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: openbsd-7 - display-name: OpenBSD 7 - timeout: 20 - runs-on: macos-12 - instances: '["latest"]' - - macos-12: name: macOS 12 @@ -293,20 +248,6 @@ jobs: instances: '["git-master", "latest", "default"]' - centos-7: - name: CentOS 7 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: centos-7 - display-name: CentOS 7 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' - - centos-stream8: name: CentOS Stream 8 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -335,20 +276,6 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' - debian-10: - name: Debian 10 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: debian-10 - display-name: Debian 10 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' - - debian-11: name: Debian 11 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -402,7 +329,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 20 - instances: '["stable-3006", "git-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' gentoo: @@ -609,9 +536,6 @@ jobs: needs: - lint - generate-actions-workflow - - freebsd-131 - - freebsd-123 - - openbsd-7 - macos-12 - macos-13 - windows-2019 @@ -621,10 +545,8 @@ jobs: - amazon-2 - amazon-2023 - arch - - centos-7 - centos-stream8 - centos-stream9 - - debian-10 - debian-11 - debian-12 - fedora-39 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index ced9d77..0ddbf60 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -12,10 +12,8 @@ LINUX_DISTROS = [ "amazon-2", "amazon-2023", "arch", - "centos-7", "centos-stream8", "centos-stream9", - "debian-10", "debian-11", "debian-12", "fedora-39", @@ -45,11 +43,6 @@ OSX = [ "macos-13", ] -BSD = [ - "freebsd-131", - "freebsd-123", - "openbsd-7", -] STABLE_DISTROS = [ "almalinux-8", @@ -57,10 +50,8 @@ STABLE_DISTROS = [ "amazon-2", "amazon-2023", "arch", - "centos-7", "centos-stream8", "centos-stream9", - "debian-10", "debian-11", "debian-12", "fedora-39", @@ -84,14 +75,12 @@ ONEDIR_DISTROS = [ "almalinux-9", "amazon-2", "amazon-2023", - "centos-7", "centos-stream8", "centos-stream9", - "debian-10", "debian-11", "debian-12", - "fedora-38", "fedora-39", + "fedora-40", "oraclelinux-7", "oraclelinux-8", "oraclelinux-9", @@ -109,10 +98,8 @@ ONEDIR_RC_DISTROS = [ "almalinux-9", "amazon-2", "amazon-2023", - "centos-7", "centos-stream8", "centos-stream9", - "debian-10", "debian-11", "debian-12", "oraclelinux-7", @@ -140,11 +127,10 @@ BLACKLIST_GIT_3006 = [ "amazon-2", "arch", "centos-stream9", - "debian-10", "debian-11", "debian-12", - "fedora-38", "fedora-39", + "fedora-40", "gentoo", "gentoo-systemd", "opensuse-15", @@ -160,9 +146,6 @@ BLACKLIST_GIT_3006 = [ BLACKLIST_GIT_MASTER = [ "amazon-2", - "debian-10", - "freebsd-131", - "freebsd-123", ] SALT_VERSIONS = [ @@ -214,10 +197,9 @@ GIT_VERSION_BLACKLIST = [ # GIT_DISTRO_BLACKLIST = [ "almalinux-8", - "centos-7", "centos-stream8", - "fedora-38", "fedora-39", + "fedora-40", "opensuse-15", "oraclelinux-7", "oraclelinux-8", @@ -236,10 +218,8 @@ DISTRO_DISPLAY_NAMES = { "amazon-2": "Amazon 2", "amazon-2023": "Amazon 2023", "arch": "Arch", - "centos-7": "CentOS 7", "centos-stream8": "CentOS Stream 8", "centos-stream9": "CentOS Stream 9", - "debian-10": "Debian 10", "debian-11": "Debian 11", "debian-12": "Debian 12", "fedora-39": "Fedora 39", @@ -260,9 +240,6 @@ DISTRO_DISPLAY_NAMES = { "ubuntu-2404": "Ubuntu 24.04", "macos-12": "macOS 12", "macos-13": "macOS 13", - "freebsd-131": "FreeBSD 13.1", - "freebsd-123": "FreeBSD 12.3", - "openbsd-7": "OpenBSD 7", "windows-2019": "Windows 2019", "windows-2022": "Windows 2022", } @@ -296,68 +273,6 @@ def generate_test_jobs(): test_jobs = "" needs = ["lint", "generate-actions-workflow"] - for distro in BSD: - test_jobs += "\n" - runs_on = "macos-12" - runs_on = f"\n runs-on: {runs_on}" - ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'" - uses = "./.github/workflows/test-bsd.yml" - instances = [] - timeout_minutes = ( - TIMEOUT_OVERRIDES[distro] - if distro in TIMEOUT_OVERRIDES - else TIMEOUT_DEFAULT - ) - for salt_version in SALT_VERSIONS: - - if salt_version == "latest": - if distro in LATEST_PKG_BLACKLIST: - continue - - instances.append(salt_version) - continue - - if distro == "openbsd-7": - # Only test latest on OpenBSD 6 - continue - - if salt_version != "master": - # Only test the master branch on BSD's - continue - - # BSD's don't have a stable release, only use git - for bootstrap_type in ["git"]: - - BLACKLIST = {} - if bootstrap_type == "git": - BLACKLIST = { - "master": BLACKLIST_GIT_MASTER, - } - - # .0 versions are a virtual version for pinning to the first - # point release of a major release, such as 3006, - # there is no git version. - if salt_version.endswith("-0"): - continue - - if salt_version in ("master") and distro in BLACKLIST[salt_version]: - continue - - kitchen_target = f"{bootstrap_type}-{salt_version}" - instances.append(kitchen_target) - - if instances: - needs.append(distro) - test_jobs += TEMPLATE.format( - distro=distro, - runs_on=runs_on, - uses=uses, - ifcheck=ifcheck, - instances=json.dumps(instances), - display_name=DISTRO_DISPLAY_NAMES[distro], - timeout_minutes=timeout_minutes, - ) - test_jobs += "\n" for distro in OSX: test_jobs += "\n" diff --git a/.github/workflows/test-bsd.yml b/.github/workflows/test-bsd.yml deleted file mode 100644 index 2246717..0000000 --- a/.github/workflows/test-bsd.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Test FreeBSD & OpenBSD -on: - workflow_call: - inputs: - distro-slug: - type: string - required: true - description: The Distribution Slug - - display-name: - type: string - required: true - description: The Display Name For The Job - - runs-on: - type: string - required: true - description: The GitHub MacOS Worker To Run Workflow On - - instances: - type: string - required: true - description: The Instances To Test - - timeout: - type: number - required: false - default: 20 - description: The timeout(in minutes) for the workflow - -env: - VAGRANT_HOME: '${{ github.workspace }}/.vagrant.d' - KITCHEN_LOCAL_YAML: 'kitchen.bsd.yml' - -jobs: - Test: - name: ${{ matrix.instance }} - runs-on: ${{ inputs.runs-on }} - timeout-minutes: ${{ inputs.timeout }} - strategy: - fail-fast: false - matrix: - instance: ${{ fromJSON(inputs.instances) }} - - steps: - - uses: actions/checkout@v3 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2.3 - bundler-cache: true - - - name: Update Vagrant - run: | - brew update - brew upgrade vagrant || brew install vagrant - - - name: Setup Vagrant Cache - uses: actions/cache@v3 - with: - path: | - ${{ github.workspace }}/.kitchen - ${{ github.workspace }}/.vagrant.d/ - key: "${{ runner.os }}|vagrant|${{ inputs.distro-slug }}|${{ hashFiles('Gemfile', '.github/workflows/test-bsd.yml', 'kitchen.bsd.yml') }}" - - - name: Set up Python 3.9 - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - - name: Install Python Dependencies - run: | - pip install -U pip - pip install -r tests/requirements.txt - - - name: Create Test Instance - run: | - bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ - (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) - - - name: Test Bootstrap - run: | - bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} - - - name: Destroy Test Instance - if: always() - run: | - bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} - - - name: Set Exit Status - if: always() - run: | - mkdir exitstatus - echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }} - - - name: Upload Exit Status - if: always() - uses: actions/upload-artifact@v3 - with: - name: exitstatus - path: exitstatus diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5c6c87c..efb7ef8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -24,7 +24,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.04.03" +__ScriptVersion="2024.06.04" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -1419,18 +1419,19 @@ __ubuntu_derivatives_translation() { # Mappings trisquel_10_ubuntu_base="20.04" trisquel_11_ubuntu_base="22.04" - ## DGM linaro_12_ubuntu_base="12.04" - ## DGM elementary_os_02_ubuntu_base="12.04" - ## DGM neon_16_ubuntu_base="16.04" - ## DGM neon_18_ubuntu_base="18.04" + trisquel_12_ubuntu_base="24.04" neon_20_ubuntu_base="20.04" neon_22_ubuntu_base="22.04" + neon_24_ubuntu_base="24.04" linuxmint_20_ubuntu_base="20.04" - linuxmint_21_ubuntu_base="20.04" + linuxmint_21_ubuntu_base="22.04" + linuxmint_22_ubuntu_base="24.04" elementary_os_06_ubuntu_base="20.04" - elementary_os_07_ubuntu_base="20.04" + elementary_os_07_ubuntu_base="22.04" + elementary_os_08_ubuntu_base="24.04" pop_20_ubuntu_base="22.04" pop_22_ubuntu_base="22.04" + pop_24_ubuntu_base="24.04" # Translate Ubuntu derivatives to their base Ubuntu version match=$(echo "$DISTRO_NAME_L" | grep -E ${UBUNTU_DERIVATIVES}) @@ -1592,21 +1593,21 @@ __debian_derivatives_translation() { DEBIAN_DERIVATIVES="(cumulus|devuan|kali|linuxmint|raspbian|bunsenlabs|turnkey)" # Mappings - cumulus_2_debian_base="7.0" - cumulus_3_debian_base="8.0" - cumulus_4_debian_base="10.0" - devuan_1_debian_base="8.0" - devuan_2_debian_base="9.0" + cumulus_5_debian_base="11.0" + cumulus_6_debian_base="12.0" + devuan_4_debian_base="11.0" + devuan_5_debian_base="12.0" kali_1_debian_base="7.0" kali_2021_debian_base="10.0" - linuxmint_1_debian_base="8.0" - raspbian_8_debian_base="8.0" - raspbian_9_debian_base="9.0" - raspbian_10_debian_base="10.0" + linuxmint_4_debian_base="11.0" + linuxmint_5_debian_base="12.0" raspbian_11_debian_base="11.0" raspbian_12_debian_base="12.0" bunsenlabs_9_debian_base="9.0" - turnkey_9_debian_base="9.0" + bunsenlabs_11_debian_base="11.0" + bunsenlabs_12_debian_base="12.0" + turnkey_11_debian_base="11.0" + turnkey_12_debian_base="12.0" # Translate Debian derivatives to their base Debian version match=$(echo "$DISTRO_NAME_L" | grep -E ${DEBIAN_DERIVATIVES}) @@ -3026,8 +3027,8 @@ __install_saltstack_ubuntu_repository() { { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." - UBUNTU_VERSION=22.04 - UBUNTU_CODENAME="jammy" + UBUNTU_VERSION=24.04 + UBUNTU_CODENAME="noble" else UBUNTU_VERSION=${DISTRO_VERSION} UBUNTU_CODENAME=${DISTRO_CODENAME} @@ -3071,8 +3072,8 @@ __install_saltstack_ubuntu_onedir_repository() { { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." - UBUNTU_VERSION=22.04 - UBUNTU_CODENAME="jammy" + UBUNTU_VERSION=24.04 + UBUNTU_CODENAME="noble" else UBUNTU_VERSION=${DISTRO_VERSION} UBUNTU_CODENAME=${DISTRO_CODENAME} @@ -3176,9 +3177,9 @@ install_ubuntu_stable_deps() { if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then - ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc. + ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style ## also apt-key is deprecated - if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && @@ -3490,12 +3491,11 @@ install_ubuntu_check_services() { [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; 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 - elif [ -f "/etc/init.d/salt-$fname" ]; then - __check_services_debian "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 + elif [ -f /etc/init.d/salt-$fname ]; then + __check_services_debian salt-$fname || return 1 fi + done return 0 @@ -3726,158 +3726,7 @@ install_debian_git_deps() { return 0 } -install_debian_7_git_deps() { - install_debian_deps || return 1 - install_debian_git_deps || return 1 - return 0 -} - -install_debian_8_git_deps() { - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - echodebug "CALLING install_debian_git_deps" - install_debian_git_deps || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - ## DGM install_debian_deps || return 1 - - ## DGM if ! __check_command_exists git; then - ## DGM __apt_get_install_noinput git || return 1 - ## DGM fi - - ## DGM if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - ## DGM __apt_get_install_noinput ca-certificates - ## DGM fi - - ## DGM __git_clone_and_checkout || return 1 - - ## DGM __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2" - ## DGM __PACKAGES="${__PACKAGES} python-m2crypto python-msgpack python-requests python-systemd" - ## DGM __PACKAGES="${__PACKAGES} python-yaml python-zmq python-concurrent.futures" - - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM # Install python-libcloud if asked to - ## DGM __PACKAGES="${__PACKAGES} python-libcloud" - ## DGM fi - - ## DGM __PIP_PACKAGES='' - ## DGM if (__check_pip_allowed >/dev/null 2>&1); then - ## DGM __PIP_PACKAGES='tornado<5.0' - ## DGM # Install development environment for building tornado Python module - ## DGM __PACKAGES="${__PACKAGES} build-essential python-dev" - - ## DGM if ! __check_command_exists pip; then - ## DGM __PACKAGES="${__PACKAGES} python-pip" - ## DGM fi - ## DGM # Attempt to configure backports repo on non-x86_64 system - ## DGM elif [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] && [ "$DPKG_ARCHITECTURE" != "amd64" ]; then - ## DGM # Check if Debian Backports repo already configured - ## DGM if ! apt-cache policy | grep -q 'Debian Backports'; then - ## DGM echo 'deb http://httpredir.debian.org/debian jessie-backports main' > \ - ## DGM /etc/apt/sources.list.d/backports.list - ## DGM fi - - ## DGM __wait_for_apt apt-get update || return 1 - - ## DGM # python-tornado package should be installed from backports repo - ## DGM __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado/jessie-backports" - ## DGM else - ## DGM __PACKAGES="${__PACKAGES} python-backports.ssl-match-hostname python-tornado" - ## DGM fi - - ## DGM # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - - ## DGM if [ "${__PIP_PACKAGES}" != "" ]; then - ## DGM # shellcheck disable=SC2086,SC2090 - ## DGM pip install -U "${__PIP_PACKAGES}" || return 1 - ## DGM fi - - ## DGM # Let's trigger config_salt() - ## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - ## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - ## DGM CONFIG_SALT_FUNC="config_salt" - ## DGM fi - - ## DGM return 0 -} - -install_debian_9_git_deps() { - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - install_debian_git_deps || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - ## DGM install_debian_deps || return 1 - ## DGM install_debian_git_pre || return 1 - - ## DGM __PACKAGES="libzmq5 lsb-release" - - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM PY_PKG_VER=3 - ## DGM else - ## DGM PY_PKG_VER="" - - ## DGM # These packages are PY2-ONLY - ## DGM __PACKAGES="${__PACKAGES} python-backports-abc python-m2crypto python-concurrent.futures" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-systemd" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" - - ## DGM if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - ## DGM # Install python-libcloud if asked to - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud" - ## DGM fi - - ## DGM # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 - - ## DGM return 0 -} - -install_debian_10_git_deps() { - - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - install_debian_git_deps || return 1 - return 0 - else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - fi - - ## DGM install_debian_deps || return 1 - ## DGM install_debian_git_pre || return 1 - - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM _py=${_PY_EXE} - ## DGM PY_PKG_VER=3 - ## DGM __PACKAGES="python${PY_PKG_VER}-distutils" - ## DGM else - ## DGM _py="python" - ## DGM PY_PKG_VER="" - ## DGM __PACKAGES="" - ## DGM fi - - ## DGM __install_tornado_pip "${_py}" || return 1 - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-jinja2" - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado python${PY_PKG_VER}-yaml python${PY_PKG_VER}-zmq" - - ## DGM # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - - ## DGM return 0 -} install_debian_stable() { __PACKAGES="" @@ -3901,21 +3750,6 @@ install_debian_stable() { return 0 } -install_debian_7_stable() { - install_debian_stable || return 1 - return 0 -} - -install_debian_8_stable() { - install_debian_stable || return 1 - return 0 -} - -install_debian_9_stable() { - install_debian_stable || return 1 - return 0 -} - install_debian_git() { if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} @@ -3959,21 +3793,6 @@ install_debian_git() { fi } -install_debian_7_git() { - install_debian_git || return 1 - return 0 -} - -install_debian_8_git() { - install_debian_git || return 1 - return 0 -} - -install_debian_9_git() { - install_debian_git || return 1 - return 0 -} - install_debian_onedir() { __PACKAGES="" @@ -4462,6 +4281,8 @@ install_fedora_onedir_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi + __PACKAGES="" + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then @@ -4470,8 +4291,6 @@ install_fedora_onedir_deps() { __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES}" - # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4617,6 +4436,8 @@ install_centos_stable_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi + __PACKAGES="" + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then @@ -4625,8 +4446,6 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES}" - # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4843,6 +4662,8 @@ install_centos_onedir_deps() { ## DGM __PACKAGES="yum-utils chkconfig" ## DGM fi + __PACKAGES="" + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then __PACKAGES="chkconfig" elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then @@ -4851,8 +4672,6 @@ install_centos_onedir_deps() { __PACKAGES="yum-utils chkconfig procps" fi - __PACKAGES="${__PACKAGES}" - # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 From 3535de7284a36a672a5982394aa1212cb61305ec Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jun 2024 11:04:19 -0600 Subject: [PATCH 21/80] WIP - Changes --- .github/workflows/ci.yml | 70 +++---- .github/workflows/templates/ci.yml | 9 +- .github/workflows/templates/generate.py | 32 +-- .github/workflows/test-linux.yml | 27 ++- .github/workflows/test-macos.yml | 28 ++- .github/workflows/test-windows.yml | 34 ++- .pre-commit-config.yaml | 6 +- CHANGELOG.md | 14 ++ Gemfile | 11 - bootstrap-salt.sh | 20 +- btstrap-build.linux.yml | 262 ++++++++++++++++++++++++ btstrap-build.macos.yml | 34 +++ btstrap-build.windows.yml | 34 +++ kitchen.bsd.yml | 55 ----- kitchen.macos.yml | 4 +- kitchen.windows.yml | 6 +- kitchen.yml | 4 +- 17 files changed, 474 insertions(+), 176 deletions(-) delete mode 100644 Gemfile create mode 100644 btstrap-build.linux.yml create mode 100644 btstrap-build.macos.yml create mode 100644 btstrap-build.windows.yml delete mode 100644 kitchen.bsd.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85015c7..2f5f9d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,9 @@ jobs: separator: "," files: | bootstrap-salt.* - Gemfile - kitchen*.yml + ## DGM Gemfile + ## DGM kitchen*.yml + btstrap-build*.yml tests/** .github/workflows/** files_ignore: | @@ -61,10 +62,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Pre-Commit run: | @@ -128,7 +129,7 @@ jobs: display-name: macOS 12 timeout: 20 runs-on: macos-12 - instances: '["stable-3006", "stable-3006-6", "latest"]' + instances: '["stable-3006", "stable-3006-8", "latest"]' macos-13: @@ -143,7 +144,7 @@ jobs: display-name: macOS 13 timeout: 20 runs-on: macos-13 - instances: '["stable-3006", "stable-3006-6", "latest"]' + instances: '["stable-3006", "stable-3006-8", "latest"]' @@ -159,7 +160,7 @@ jobs: display-name: Windows 2019 timeout: 20 runs-on: windows-2019 - instances: '["stable-3006", "stable-3006-6", "latest"]' + instances: '["stable-3006", "stable-3006-8", "latest"]' windows-2022: @@ -174,7 +175,7 @@ jobs: display-name: Windows 2022 timeout: 20 runs-on: windows-2022 - instances: '["stable-3006", "stable-3006-6", "latest"]' + instances: '["stable-3006", "stable-3006-8", "latest"]' @@ -189,7 +190,7 @@ jobs: distro-slug: almalinux-8 display-name: AlmaLinux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' almalinux-9: @@ -203,7 +204,7 @@ jobs: distro-slug: almalinux-9 display-name: AlmaLinux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' amazon-2: @@ -217,7 +218,7 @@ jobs: distro-slug: amazon-2 display-name: Amazon 2 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' amazon-2023: @@ -231,7 +232,7 @@ jobs: distro-slug: amazon-2023 display-name: Amazon 2023 timeout: 20 - instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' arch: @@ -259,7 +260,7 @@ jobs: distro-slug: centos-stream8 display-name: CentOS Stream 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' centos-stream9: @@ -273,7 +274,7 @@ jobs: distro-slug: centos-stream9 display-name: CentOS Stream 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' debian-11: @@ -287,7 +288,7 @@ jobs: distro-slug: debian-11 display-name: Debian 11 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' debian-12: @@ -301,7 +302,7 @@ jobs: distro-slug: debian-12 display-name: Debian 12 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' fedora-39: @@ -315,7 +316,7 @@ jobs: distro-slug: fedora-39 display-name: Fedora 39 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' fedora-40: @@ -329,7 +330,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' gentoo: @@ -388,20 +389,6 @@ jobs: instances: '["git-master", "latest", "default"]' - oraclelinux-7: - name: Oracle Linux 7 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: oraclelinux-7 - display-name: Oracle Linux 7 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' - - oraclelinux-8: name: Oracle Linux 8 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -413,7 +400,7 @@ jobs: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' oraclelinux-9: @@ -427,7 +414,7 @@ jobs: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' photon-4: @@ -441,7 +428,7 @@ jobs: distro-slug: photon-4 display-name: Photon OS 4 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' photon-5: @@ -455,7 +442,7 @@ jobs: distro-slug: photon-5 display-name: Photon OS 5 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' rockylinux-8: @@ -469,7 +456,7 @@ jobs: distro-slug: rockylinux-8 display-name: Rocky Linux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' rockylinux-9: @@ -483,7 +470,7 @@ jobs: distro-slug: rockylinux-9 display-name: Rocky Linux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' ubuntu-2004: @@ -497,7 +484,7 @@ jobs: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' ubuntu-2204: @@ -511,7 +498,7 @@ jobs: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' ubuntu-2404: @@ -525,7 +512,7 @@ jobs: distro-slug: ubuntu-2404 display-name: Ubuntu 24.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-6", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' set-pipeline-exit-status: @@ -555,7 +542,6 @@ jobs: - gentoo-systemd - opensuse-15 - opensuse-tumbleweed - - oraclelinux-7 - oraclelinux-8 - oraclelinux-9 - photon-4 diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 2bde230..f24688d 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -27,8 +27,9 @@ jobs: separator: "," files: | bootstrap-salt.* - Gemfile - kitchen*.yml + ## DGM Gemfile + ## DGM kitchen*.yml + btstrap-build*.yml tests/** .github/workflows/** files_ignore: | @@ -61,10 +62,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Pre-Commit run: | diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 0ddbf60..b4ca37c 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -22,7 +22,6 @@ LINUX_DISTROS = [ "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", - "oraclelinux-7", "oraclelinux-8", "oraclelinux-9", "photon-4", @@ -94,23 +93,15 @@ ONEDIR_DISTROS = [ ] ONEDIR_RC_DISTROS = [ - "almalinux-8", "almalinux-9", "amazon-2", "amazon-2023", - "centos-stream8", "centos-stream9", - "debian-11", "debian-12", - "oraclelinux-7", - "oraclelinux-8", "oraclelinux-9", "photon-4", "photon-5", - "rockylinux-8", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] @@ -150,7 +141,7 @@ BLACKLIST_GIT_MASTER = [ SALT_VERSIONS = [ "3006", - "3006-6", + "3006-8", "master", "latest", "nightly", @@ -165,7 +156,7 @@ ONEDIR_RC_SALT_VERSIONS = [] VERSION_DISPLAY_NAMES = { "3006": "v3006", - "3006-6": "v3006.6", + "3006-8": "v3006.8", "master": "Master", "latest": "Latest", "nightly": "Nightly", @@ -182,7 +173,7 @@ MAC_STABLE_VERSION_BLACKLIST = [ ] GIT_VERSION_BLACKLIST = [ - "3006-6", + "3006-8", "nightly", ] @@ -228,7 +219,6 @@ DISTRO_DISPLAY_NAMES = { "gentoo-systemd": "Gentoo (systemd)", "opensuse-15": "Opensuse 15", "opensuse-tumbleweed": "Opensuse Tumbleweed", - "oraclelinux-7": "Oracle Linux 7", "oraclelinux-8": "Oracle Linux 8", "oraclelinux-9": "Oracle Linux 9", "photon-4": "Photon OS 4", @@ -297,8 +287,8 @@ def generate_test_jobs(): if salt_version in MAC_STABLE_VERSION_BLACKLIST: continue - kitchen_target = f"{bootstrap_type}-{salt_version}" - instances.append(kitchen_target) + test_target = f"{bootstrap_type}-{salt_version}" + instances.append(test_target) for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: @@ -342,8 +332,8 @@ def generate_test_jobs(): if salt_version in STABLE_VERSION_BLACKLIST: continue - kitchen_target = f"{bootstrap_type}-{salt_version}" - instances.append(kitchen_target) + test_target = f"{bootstrap_type}-{salt_version}" + instances.append(test_target) for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: @@ -418,7 +408,7 @@ def generate_test_jobs(): BLACKLIST = { "3006": BLACKLIST_3006, - "3006-6": BLACKLIST_3006, + "3006-8": BLACKLIST_3006, } if bootstrap_type == "git": BLACKLIST = { @@ -433,13 +423,13 @@ def generate_test_jobs(): continue if ( - salt_version in ("3006", "3006-6", "master") + salt_version in ("3006", "3006-8", "master") and distro in BLACKLIST[salt_version] ): continue - kitchen_target = f"{bootstrap_type}-{salt_version}" - instances.append(kitchen_target) + test_target = f"{bootstrap_type}-{salt_version}" + instances.append(test_target) for bootstrap_type in ["default"]: if distro not in STABLE_DISTROS: diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 8b98ac6..757a801 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -26,7 +26,7 @@ on: jobs: Test: name: ${{ matrix.instance }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: ${{ inputs.timeout }} strategy: max-parallel: 2 @@ -37,16 +37,17 @@ jobs: steps: - uses: actions/checkout@v3 + ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.3 bundler-cache: true - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | @@ -55,17 +56,29 @@ jobs: - name: Create Test Instance run: | - bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ - (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) + ## DGM Need to replace this + ## DGM b + ## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) + ## DGM + ## DGM Need to select a GitHub runner here , ubuntu-latest + sleep 2 - name: Test Bootstrap run: | - bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM Need to replace this + ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM Need to run the bootstrap tests for Linux here + sleep 2 - name: Destroy Test Instance if: always() run: | - bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM Need to replace this + ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + sleep 2 - name: Set Exit Status if: always() diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 10b0f21..a42c9b4 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -28,8 +28,10 @@ on: default: 20 description: The timeout(in minutes) for the workflow -env: - KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' +## DGM env: +## DGM KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' +## DGM +## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ? jobs: Test: @@ -44,16 +46,17 @@ jobs: steps: - uses: actions/checkout@v3 + ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.3 bundler-cache: true - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | @@ -62,17 +65,26 @@ jobs: - name: Create Test Instance run: | - bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ - (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) + ## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ + ## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) + ## DGM + ## DGM Need to select a GitHub runner here , macos-latest + sleep 2 - name: Test Bootstrap run: | - bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM Need to run the bootstrap tests for MacOS here + sleep 2 - name: Destroy Test Instance if: always() run: | - bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + sleep 2 - name: Set Exit Status if: always() diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index d4616e5..930e6c9 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -28,11 +28,13 @@ on: default: 20 description: The timeout(in minutes) for the workflow -env: - machine_user: kitchen - machine_pass: Password1 - machine_port: 5985 - KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' +## DGM env: +## DGM machine_user: kitchen +## DGM machine_pass: Password1 +## DGM machine_port: 5985 +## DGM KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' +## DGM +## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ? jobs: Test: @@ -47,6 +49,7 @@ jobs: steps: - uses: actions/checkout@v3 + ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -79,10 +82,10 @@ jobs: winrm set winrm/config/service '@{AllowUnencrypted="True"}' env - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | @@ -91,17 +94,26 @@ jobs: - name: Create Test Instance run: | - bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM Need to select a GitHub runner here , ubuntu-latest + sleep 2 - name: Test Bootstrap run: | - env - bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM env + ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM Need to run the bootstrap tests for Windows here + sleep 2 - name: Destroy Test Instance if: always() run: | - bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} + ## DGM + ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + sleep 2 - name: Set Exit Status if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f3d0b6a..d916858 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,14 +41,14 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - name: Rewrite Code to be Py3.9+ - args: [--py39-plus] + name: Rewrite Code to be Py3.10+ + args: [--py310-plus] - repo: https://github.com/asottile/reorder_python_imports rev: v3.12.0 hooks: - id: reorder-python-imports - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/psf/black rev: 24.1.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index d6e92e0..f9a04d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# v2024.06.XX + +## What's Changed + +- Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities +- Migrated to using GitHub Actions +- Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7 +- Removed support for FreeBSD and OpenBSD +- Removed support for EOL Salt releases, pre-3006 +- Added support for new OS's, for example: Ubuntu 24.04, Debian 12 +- Updated to minimum Python 3.10 version from 3.9 + +**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.06.XX + # v2024.04.03 ## What's Changed diff --git a/Gemfile b/Gemfile deleted file mode 100644 index a70a9da..0000000 --- a/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gem 'test-kitchen', '>= 3.2.2' -gem 'kitchen-salt', '>= 0.7.2' -gem 'kitchen-docker', :git => 'https://github.com/test-kitchen/kitchen-docker.git', :branch => 'main' - -group :vagrant do - gem 'kitchen-vagrant' -end diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index efb7ef8..78e8cee 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -24,7 +24,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.06.04" +__ScriptVersion="2024.06.10" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -627,7 +627,8 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="$1" ITYPE="onedir" shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-10][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" _ONEDIR_REV="$1" ITYPE="onedir" @@ -645,7 +646,8 @@ elif [ "$ITYPE" = "onedir" ]; then if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then ONEDIR_REV="$1" shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}(\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" shift else @@ -667,18 +669,20 @@ elif [ "$ITYPE" = "onedir_rc" ]; then if [ "$(echo "$1" | grep -E '^(latest)$')" != "" ]; then ONEDIR_REV="$1" shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" shift else - echo "Unknown onedir_rc version: $1 (valid: 3006-6, latest.)" + echo "Unknown onedir_rc version: $1 (valid: 3006-8, latest.)" exit 1 fi fi @@ -7725,13 +7729,15 @@ __macosx_get_packagesite_onedir() { return 1 fi + ## DGM TBD need to allow for arm64 arch too DARWIN_ARCH="x86_64" __PY_VERSION_REPO="py3" if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then _PKG_VERSION=$(__parse_repo_json_python) - elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then + ## DGM elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then + elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-10][0-9]{3}(\.[0-9]*))')" != "" ]; then _PKG_VERSION=$_ONEDIR_REV else _PKG_VERSION=$(__parse_repo_json_python) diff --git a/btstrap-build.linux.yml b/btstrap-build.linux.yml new file mode 100644 index 0000000..b43f44b --- /dev/null +++ b/btstrap-build.linux.yml @@ -0,0 +1,262 @@ +--- +driver: + name: docker + use_sudo: false + hostname: salt + privileged: true + username: root + cap_add: + - sys_admin + disable_upstart: false + use_internal_docker_network: false + run_command: /usr/lib/systemd/systemd + +provisioner: + name: salt_solo + salt_install: bootstrap + salt_bootstrap_url: bootstrap-salt.sh + salt_bootstrap_options: -MPfq git %s + install_after_init_environment: true + log_level: info + sudo: false + require_chef: false + formula: tests + run_salt_call: false + init_environment: | + echo 'auto_accept: true' > /tmp/auto-accept-keys.conf + mkdir -p /etc/salt/master.d + mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf + sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' + +platforms: + - name: almalinux-9 + driver: + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: almalinux-8 + - name: amazon-2 + driver: + image: amazonlinux:2 + platform: rhel + provision_command: + - yum -y install procps-ng + - name: amazon-2023 + driver: + image: amazonlinux:2023 + platform: fedora + provision_command: + - yum -y install procps-ng + - name: arch + driver: + image: archlinux/archlinux + provision_command: + - pacman -Syu --noconfirm --needed systemd grep awk procps which + - systemctl enable sshd + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: centos-stream9 + driver: + platform: centosstream + image: quay.io/centos/centos:stream9 + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: centos-stream8 + driver: + image: quay.io/centos/centos:stream8 + - name: centos-7 + driver: + run_command: /lib/systemd/systemd + - name: debian-10 + driver: + run_command: /lib/systemd/systemd + - name: debian-11 + driver: + image: debian:bullseye + run_command: /lib/systemd/systemd + - name: debian-12 + driver: + image: debian:bullseye + run_command: /lib/systemd/systemd + - name: fedora-39 + - name: fedora-40 + driver: + provision_command: &fedora_provision_command + - dnf -y install procps-ng crypto-policies-scripts + - update-crypto-policies + - name: gentoo + driver: + image: gentoo/stage3:latest + run_command: /sbin/init + provision_command: + - rc-update add sshd default + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: gentoo-systemd + driver: + image: gentoo/stage3:systemd + run_command: /lib/systemd/systemd + provision_command: + - systemctl enable sshd.service + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: opensuse-15 + driver: + image: opensuse/leap:15.4 + provision_command: + - &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1 + - &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd + - &opensuse_provision_command_03 systemctl enable sshd.service + - name: opensuse-tumbleweed + driver: + image: opensuse/tumbleweed:latest + provision_command: + - *opensuse_provision_command_01 + - *opensuse_provision_command_02 + - *opensuse_provision_command_03 + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: rockylinux-9 + driver: + platform: centosstream + run_command: /usr/lib/systemd/systemd + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: rockylinux-8 + - name: oraclelinux-8 + - name: oraclelinux-7 + - name: rockylinux-8 + - name: ubuntu-22.04 + - name: ubuntu-23.10 + - name: ubuntu-24.04 + driver: + run_command: /lib/systemd/systemd + provision_command: + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: ubuntu-20.04 + driver: + run_command: /lib/systemd/systemd + - name: photon-4 + driver: + image: photon:4.0 + provision_command: + - tdnf -y install rpm procps-ng coreutils gawk + - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config + - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config + - systemctl enable sshd.service + - name: photon-5 + driver: + image: photon:5.0 + provision_command: + - tdnf -y install rpm procps-ng coreutils gawk + - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config + - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config + - systemctl enable sshd.service + +suites: + - name: git-3006 + provisioner: + salt_version: v3006 + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - freebsd-131 + - freebsd-123 + - openbsd-6 + - name: git-3006x + provisioner: + salt_version: 3006.x + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - gentoo + - gentoo-systemd + - freebsd-131 + - freebsd-123 + - openbsd-6 + - name: stable-3006 + provisioner: + salt_version: 3006 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - freebsd-131 + - freebsd-123 + - openbsd-6 + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - freebsd-131 + - freebsd-123 + - openbsd-6 + - name: git-master + provisioner: + salt_version: master + salt_bootstrap_options: -x python3 -MPfq -D git %s + + - name: latest + provisioner: + salt_version: latest + salt_bootstrap_options: -MP stable %s + + - name: default + provisioner: + salt_version: latest + salt_bootstrap_options: -MP + + - name: onedir-nightly + provisioner: + salt_version: nightly + salt_bootstrap_options: -MP onedir %s + + - name: onedir-latest + provisioner: + salt_version: latest + salt_bootstrap_options: -MP onedir %s + + - name: onedir-3006 + provisioner: + salt_version: 3006 + salt_bootstrap_options: -MP onedir %s + + - name: onedir-3007 + provisioner: + salt_version: 3007 + salt_bootstrap_options: -MP onedir %s + + - name: onedir-rc-3008-0rc1 + provisioner: + salt_version: 3008.0rc1 + salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s + excludes: + - arch + - freebsd-131 + - freebsd-123 + - gentoo + - openbsd-6 + - opensuse-15 + - opensuse-tumbleweed + + - name: quickstart + provisioner: + salt_bootstrap_options: -Q + +verifier: + name: shell + remote_exec: false + command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ diff --git a/btstrap-build.macos.yml b/btstrap-build.macos.yml new file mode 100644 index 0000000..a0d8921 --- /dev/null +++ b/btstrap-build.macos.yml @@ -0,0 +1,34 @@ +--- +driver: + name: exec + +provisioner: + sudo: true + salt_bootstrap_options: -MP stable %s + init_environment: | + echo 'auto_accept: true' > /tmp/auto-accept-keys.conf + sudo mkdir -p /etc/salt/master.d + sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf + brew install coreutils + sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' + +platforms: + - name: macos-12 + - name: macos-13 + +suites: + - name: stable-3006 + provisioner: + salt_version: 3006 + salt_call_command: /opt/salt/salt-call + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_call_command: /opt/salt/salt-call + - name: latest + provisioner: + salt_version: latest + salt_call_command: /opt/salt/salt-call + +verifier: + command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/btstrap-build.windows.yml b/btstrap-build.windows.yml new file mode 100644 index 0000000..951f703 --- /dev/null +++ b/btstrap-build.windows.yml @@ -0,0 +1,34 @@ +--- +driver: + name: proxy + host: localhost + reset_command: "exit 0" + port: 5985 + username: kitchen + password: Password1 + +provisioner: + salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1 + salt_bootstrap_options: -Version %s -Verbose + init_environment: '' + +platforms: + - name: windows-2022 + - name: windows-2019 + +suites: + - name: stable-3006 + provisioner: + salt_version: 3006.8 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: latest + provisioner: + salt_version: latest + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + +verifier: + command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.bsd.yml b/kitchen.bsd.yml deleted file mode 100644 index 64bc83a..0000000 --- a/kitchen.bsd.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -driver: - name: vagrant - vm_hostname: salt - username: vagrant - cache_directory: false - customize: - usbxhci: 'off' - gui: false - ssh: - shell: /bin/sh - linked_clone: true - <% unless ENV['CI'] %> - synced_folders: - - - '.kitchen/kitchen-vagrant/%{instance_name}/vagrant' - - '/vagrant' - - 'create: true, disabled: false' - <% end %> - -provisioner: - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - sudo mkdir -p /usr/local/etc/salt/master.d - sudo mv /tmp/auto-accept-keys.conf /usr/local/etc/salt/master.d/auto-accept-keys.conf - sudo pkg install -y shuf - sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - sudo: true - -platforms: - - name: freebsd-131 - driver: - box: bento/freebsd-13.1 - - name: freebsd-123 - driver: - box: bento/freebsd-12.3 - - name: openbsd-7 - driver: - box: generic/openbsd7 - ssh: - shell: /bin/ksh - synced_folders: [] - transport: - name: ssh - username: vagrant - password: vagrant - provisioner: - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - sudo mkdir -p /etc/salt/master.d - sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - sudo pkg_add coreutils - sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 308efdd..a0d8921 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -21,9 +21,9 @@ suites: provisioner: salt_version: 3006 salt_call_command: /opt/salt/salt-call - - name: stable-3006-6 + - name: stable-3006-8 provisioner: - salt_version: 3006.6 + salt_version: 3006.8 salt_call_command: /opt/salt/salt-call - name: latest provisioner: diff --git a/kitchen.windows.yml b/kitchen.windows.yml index a90894c..951f703 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -19,11 +19,11 @@ platforms: suites: - name: stable-3006 provisioner: - salt_version: 3006.6 + salt_version: 3006.8 salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3006-6 + - name: stable-3006-8 provisioner: - salt_version: 3006.6 + salt_version: 3006.8 salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - name: latest provisioner: diff --git a/kitchen.yml b/kitchen.yml index bea3256..1f4e8f4 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -194,9 +194,9 @@ suites: - freebsd-131 - freebsd-123 - openbsd-6 - - name: stable-3006-6 + - name: stable-3006-8 provisioner: - salt_version: 3006.6 + salt_version: 3006.8 salt_bootstrap_options: -x python3 -MP stable %s excludes: - opensuse-15 From 71094027fae20a4ebbea8b8ae5dc6c0e0476940b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jun 2024 14:36:36 -0600 Subject: [PATCH 22/80] WIP - adjustments before using runners for testing etc. --- .github/workflows/ci.yml | 46 +-- .github/workflows/nightly.yml | 1 + .github/workflows/release.yml | 3 + .github/workflows/templates/generate.py | 44 ++- .github/workflows/test-linux.yml | 10 +- CHANGELOG.md | 1 + bootstrap-salt.sh | 388 +----------------------- btstrap-build.linux.yml | 16 - kitchen.macos.yml | 34 --- kitchen.windows.yml | 34 --- kitchen.yml | 263 ---------------- 11 files changed, 73 insertions(+), 767 deletions(-) delete mode 100644 kitchen.macos.yml delete mode 100644 kitchen.windows.yml delete mode 100644 kitchen.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f5f9d1..dc3ac74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: display-name: macOS 12 timeout: 20 runs-on: macos-12 - instances: '["stable-3006", "stable-3006-8", "latest"]' + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' macos-13: @@ -144,7 +144,7 @@ jobs: display-name: macOS 13 timeout: 20 runs-on: macos-13 - instances: '["stable-3006", "stable-3006-8", "latest"]' + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -160,7 +160,7 @@ jobs: display-name: Windows 2019 timeout: 20 runs-on: windows-2019 - instances: '["stable-3006", "stable-3006-8", "latest"]' + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' windows-2022: @@ -175,7 +175,7 @@ jobs: display-name: Windows 2022 timeout: 20 runs-on: windows-2022 - instances: '["stable-3006", "stable-3006-8", "latest"]' + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -190,7 +190,7 @@ jobs: distro-slug: almalinux-8 display-name: AlmaLinux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' almalinux-9: @@ -204,7 +204,7 @@ jobs: distro-slug: almalinux-9 display-name: AlmaLinux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' amazon-2: @@ -218,7 +218,7 @@ jobs: distro-slug: amazon-2 display-name: Amazon 2 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' amazon-2023: @@ -232,7 +232,7 @@ jobs: distro-slug: amazon-2023 display-name: Amazon 2023 timeout: 20 - instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' arch: @@ -260,7 +260,7 @@ jobs: distro-slug: centos-stream8 display-name: CentOS Stream 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' centos-stream9: @@ -274,7 +274,7 @@ jobs: distro-slug: centos-stream9 display-name: CentOS Stream 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' debian-11: @@ -288,7 +288,7 @@ jobs: distro-slug: debian-11 display-name: Debian 11 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' debian-12: @@ -302,7 +302,7 @@ jobs: distro-slug: debian-12 display-name: Debian 12 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' fedora-39: @@ -316,7 +316,7 @@ jobs: distro-slug: fedora-39 display-name: Fedora 39 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' fedora-40: @@ -330,7 +330,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' gentoo: @@ -400,7 +400,7 @@ jobs: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' oraclelinux-9: @@ -414,7 +414,7 @@ jobs: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' photon-4: @@ -428,7 +428,7 @@ jobs: distro-slug: photon-4 display-name: Photon OS 4 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' photon-5: @@ -442,7 +442,7 @@ jobs: distro-slug: photon-5 display-name: Photon OS 5 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' rockylinux-8: @@ -456,7 +456,7 @@ jobs: distro-slug: rockylinux-8 display-name: Rocky Linux 8 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' rockylinux-9: @@ -470,7 +470,7 @@ jobs: distro-slug: rockylinux-9 display-name: Rocky Linux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' ubuntu-2004: @@ -484,7 +484,7 @@ jobs: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' ubuntu-2204: @@ -498,7 +498,7 @@ jobs: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' ubuntu-2404: @@ -512,7 +512,7 @@ jobs: distro-slug: ubuntu-2404 display-name: Ubuntu 24.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' set-pipeline-exit-status: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d043786..c16b46d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -46,6 +46,7 @@ jobs: name: Update S3 Bucket if: ${{ fromJSON(needs.workflow-requirements.outputs.requirements-met) }} runs-on: + ## DGM wonder about these - self-hosted - linux - repo-release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a18b48..d7b25f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,7 @@ jobs: update-develop: name: Update CHANGELOG.md and bootstrap-salt.sh runs-on: + ## DGM wonder about these - self-hosted - linux - repo-release @@ -295,6 +296,7 @@ jobs: update-s3-bucket: name: Update S3 Bucket runs-on: + ## DGM wonder about these - self-hosted - linux - repo-release @@ -356,6 +358,7 @@ jobs: update-develop-checksums: name: Update Release Checksums on Develop runs-on: + ## DGM wonder about these - self-hosted - linux - repo-release diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index b4ca37c..51e55dc 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -57,7 +57,6 @@ STABLE_DISTROS = [ "fedora-40", "opensuse-15", "opensuse-tumbleweed", - "oraclelinux-7", "oraclelinux-8", "oraclelinux-9", "photon-4", @@ -80,7 +79,6 @@ ONEDIR_DISTROS = [ "debian-12", "fedora-39", "fedora-40", - "oraclelinux-7", "oraclelinux-8", "oraclelinux-9", "photon-4", @@ -113,6 +111,14 @@ BLACKLIST_3006 = [ "opensuse-tumbleweed", ] +BLACKLIST_3007 = [ + "arch", + "gentoo", + "gentoo-systemd", + "opensuse-15", + "opensuse-tumbleweed", +] + BLACKLIST_GIT_3006 = [ "almalinux-9", "amazon-2", @@ -131,7 +137,27 @@ BLACKLIST_GIT_3006 = [ "rockylinux-9", "ubuntu-2004", "ubuntu-2204", - "ubuntu-2310", + "ubuntu-2404", +] + +BLACKLIST_GIT_3007 = [ + "almalinux-9", + "amazon-2", + "arch", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "gentoo", + "gentoo-systemd", + "opensuse-15", + "opensuse-tumbleweed", + "photon-4", + "photon-5", + "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] @@ -142,6 +168,8 @@ BLACKLIST_GIT_MASTER = [ SALT_VERSIONS = [ "3006", "3006-8", + "3007", + "3007-1", "master", "latest", "nightly", @@ -149,6 +177,7 @@ SALT_VERSIONS = [ ONEDIR_SALT_VERSIONS = [ "3006", + "3007", "latest", ] @@ -157,6 +186,8 @@ ONEDIR_RC_SALT_VERSIONS = [] VERSION_DISPLAY_NAMES = { "3006": "v3006", "3006-8": "v3006.8", + "3007": "v3007", + "3007-1": "v3007.1", "master": "Master", "latest": "Latest", "nightly": "Nightly", @@ -174,6 +205,7 @@ MAC_STABLE_VERSION_BLACKLIST = [ GIT_VERSION_BLACKLIST = [ "3006-8", + "3007-1", "nightly", ] @@ -192,7 +224,6 @@ GIT_DISTRO_BLACKLIST = [ "fedora-39", "fedora-40", "opensuse-15", - "oraclelinux-7", "oraclelinux-8", "oraclelinux-9", "rockylinux-8", @@ -409,10 +440,13 @@ def generate_test_jobs(): BLACKLIST = { "3006": BLACKLIST_3006, "3006-8": BLACKLIST_3006, + "3007": BLACKLIST_3007, + "3007-1": BLACKLIST_3007, } if bootstrap_type == "git": BLACKLIST = { "3006": BLACKLIST_GIT_3006, + "3007": BLACKLIST_GIT_3007, "master": BLACKLIST_GIT_MASTER, } @@ -423,7 +457,7 @@ def generate_test_jobs(): continue if ( - salt_version in ("3006", "3006-8", "master") + salt_version in ("3006", "3006-8", "3007", "3007-1", "master") and distro in BLACKLIST[salt_version] ): continue diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 757a801..63f458c 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -38,11 +38,11 @@ jobs: - uses: actions/checkout@v3 ## DGM Need to replace this - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2.3 - bundler-cache: true + ## DGM - name: Setup Ruby + ## DGM uses: ruby/setup-ruby@v1 + ## DGM with: + ## DGM ruby-version: 3.2.3 + ## DGM bundler-cache: true - name: Set up Python 3.10 uses: actions/setup-python@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a04d4..e503a9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Migrated to using GitHub Actions - Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7 - Removed support for FreeBSD and OpenBSD +- Removed support for Solaris and it's derivatives - Removed support for EOL Salt releases, pre-3006 - Added support for new OS's, for example: Ubuntu 24.04, Debian 12 - Updated to minimum Python 3.10 version from 3.9 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 78e8cee..b520a60 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1288,91 +1288,6 @@ __install_python() { } -#--- FUNCTION ------------------------------------------------------------------------------------------------------- -# NAME: __gather_sunos_system_info -# DESCRIPTION: Discover SunOS system info -#---------------------------------------------------------------------------------------------------------------------- -__gather_sunos_system_info() { - if [ -f /sbin/uname ]; then - DISTRO_VERSION=$(/sbin/uname -X | awk '/[kK][eE][rR][nN][eE][lL][iI][dD]/ { print $3 }') - fi - - DISTRO_NAME="" - if [ -f /etc/release ]; then - while read -r line; do - [ "${DISTRO_NAME}" != "" ] && break - case "$line" in - *OpenIndiana*oi_[0-9]*) - DISTRO_NAME="OpenIndiana" - DISTRO_VERSION=$(echo "$line" | sed -nE "s/OpenIndiana(.*)oi_([[:digit:]]+)(.*)/\\2/p") - break - ;; - *OpenSolaris*snv_[0-9]*) - DISTRO_NAME="OpenSolaris" - DISTRO_VERSION=$(echo "$line" | sed -nE "s/OpenSolaris(.*)snv_([[:digit:]]+)(.*)/\\2/p") - break - ;; - *Oracle*Solaris*[0-9]*) - DISTRO_NAME="Oracle Solaris" - DISTRO_VERSION=$(echo "$line" | sed -nE "s/(Oracle Solaris) ([[:digit:]]+)(.*)/\\2/p") - break - ;; - *Solaris*) - DISTRO_NAME="Solaris" - # Let's make sure we not actually on a Joyent's SmartOS VM since some releases - # don't have SmartOS in `/etc/release`, only `Solaris` - if uname -v | grep joyent >/dev/null 2>&1; then - DISTRO_NAME="SmartOS" - fi - break - ;; - *NexentaCore*) - DISTRO_NAME="Nexenta Core" - break - ;; - *SmartOS*) - DISTRO_NAME="SmartOS" - break - ;; - *OmniOS*) - DISTRO_NAME="OmniOS" - DISTRO_VERSION=$(echo "$line" | awk '{print $3}') - _SIMPLIFY_VERSION=$BS_FALSE - break - ;; - esac - done < /etc/release - fi - - if [ "${DISTRO_NAME}" = "" ]; then - DISTRO_NAME="Solaris" - DISTRO_VERSION=$( - echo "${OS_VERSION}" | - sed -e 's;^4\.;1.;' \ - -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ - -e 's;^5\.\([0-9][0-9]*\).*;\1;' - ) - fi - - if [ "${DISTRO_NAME}" = "SmartOS" ]; then - VIRTUAL_TYPE="smartmachine" - # shellcheck disable=SC2034 - if [ "$(zonename)" = "global" ]; then - VIRTUAL_TYPE="global" - fi - fi -} - - -#--- FUNCTION ------------------------------------------------------------------------------------------------------- -# NAME: __gather_bsd_system_info -# DESCRIPTION: Discover OpenBSD, NetBSD and FreeBSD systems information -#---------------------------------------------------------------------------------------------------------------------- -__gather_bsd_system_info() { - DISTRO_NAME=${OS_NAME} - DISTRO_VERSION=$(echo "${OS_VERSION}" | sed -e 's;[()];;' -e 's/-.*$//') -} - #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __gather_osx_system_info @@ -1393,12 +1308,6 @@ __gather_system_info() { linux ) __gather_linux_system_info ;; - sunos ) - __gather_sunos_system_info - ;; - openbsd|freebsd|netbsd ) - __gather_bsd_system_info - ;; darwin ) __gather_osx_system_info ;; @@ -1832,14 +1741,6 @@ __check_end_of_life_versions() { fi ;; - freebsd) - # FreeBSD versions lower than 11 are EOL - if [ "$DISTRO_MAJOR_VERSION" -lt 11 ]; then - echoerror "Versions lower than FreeBSD 11 are EOL and no longer supported." - exit 1 - fi - ;; - *) ;; esac @@ -1969,7 +1870,7 @@ if [ "$ITYPE" = "git" ]; then __TAG_REGEX_MATCH="MATCH" else case ${OS_NAME_L} in - openbsd|freebsd|netbsd|darwin ) + darwin ) __NEW_VS_TAG_REGEX_MATCH=$(echo "${GIT_REV}" | sed -E 's/^(v?3[0-9]{3}(\.[0-9]{1,2})?).*$/MATCH/') if [ "$__NEW_VS_TAG_REGEX_MATCH" = "MATCH" ]; then _POST_NEON_INSTALL=$BS_TRUE @@ -2611,32 +2512,6 @@ __check_services_debian() { } # ---------- end of function __check_services_debian ---------- -#--- FUNCTION ------------------------------------------------------------------------------------------------------- -# NAME: __check_services_openbsd -# DESCRIPTION: Return 0 or 1 in case the service is enabled or not -# PARAMETERS: servicename -#---------------------------------------------------------------------------------------------------------------------- -__check_services_openbsd() { - if [ $# -eq 0 ]; then - echoerror "You need to pass a service name to check!" - exit 1 - elif [ $# -ne 1 ]; then - echoerror "You need to pass a service name to check as the single argument to the function" - fi - - servicename=$1 - echodebug "Checking if service ${servicename} is enabled" - - # shellcheck disable=SC2086,SC2046,SC2144 - if rcctl get ${servicename} status; then - echodebug "Service ${servicename} is enabled" - return 0 - else - echodebug "Service ${servicename} is NOT enabled" - return 1 - fi -} # ---------- end of function __check_services_openbsd ---------- - #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __check_services_openrc # DESCRIPTION: Return 0 or 1 in case the service is enabled or not @@ -6551,267 +6426,6 @@ install_photon_onedir_post() { # ####################################################################################################################### -####################################################################################################################### -# -# FreeBSD Install Functions -# - -# Using a separate conf step to head for idempotent install... -__configure_freebsd_pkg_details() { - _SALT_ETC_DIR="/usr/local/etc/salt" - _PKI_DIR="${_SALT_ETC_DIR}/pki" - _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr/local" -} - -install_freebsd_deps() { - __configure_freebsd_pkg_details - pkg install -y pkg -} - -install_freebsd_git_deps() { - install_freebsd_deps || return 1 - - if ! __check_command_exists git; then - /usr/local/sbin/pkg install -y git || return 1 - fi - __git_clone_and_checkout || return 1 - - /usr/local/sbin/pkg install -y python py39-pip py39-setuptools libzmq4 libunwind || return 1 - - echodebug "Adapting paths to FreeBSD" - # The list of files was taken from Salt's BSD port Makefile - for file in doc/man/salt-key.1 doc/man/salt-cp.1 doc/man/salt-minion.1 \ - doc/man/salt-syndic.1 doc/man/salt-master.1 doc/man/salt-run.1 \ - doc/man/salt.7 doc/man/salt.1 doc/man/salt-call.1; do - [ ! -f "$file" ] && continue - echodebug "Patching ${file}" - sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ - -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ - -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" "${file}" - done - if [ ! -f salt/syspaths.py ]; then - # We still can't provide the system paths, salt 0.16.x - # Let's patch salt's source and adapt paths to what's expected on FreeBSD - echodebug "Replacing occurrences of '/etc/salt' with ${_SALT_ETC_DIR}" - # The list of files was taken from Salt's BSD port Makefile - for file in conf/minion conf/master salt/config.py salt/client.py \ - salt/modules/mysql.py salt/utils/parsers.py salt/modules/tls.py \ - salt/modules/postgres.py salt/utils/migrations.py; do - [ ! -f "$file" ] && continue - echodebug "Patching ${file}" - sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ - -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ - -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" "${file}" - done - fi - echodebug "Finished patching" - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - - fi - - return 0 -} - -install_freebsd_stable() { -# -# installing latest version of salt from FreeBSD CURRENT ports repo -# - # shellcheck disable=SC2086 - /usr/local/sbin/pkg install -y py39-salt || return 1 - - return 0 -} - -install_freebsd_git() { - - # /usr/local/bin/python3 in FreeBSD is a symlink to /usr/local/bin/python3.7 - __PYTHON_PATH=$(readlink -f "$(command -v python3)") - __ESCAPED_PYTHON_PATH=$(echo "${__PYTHON_PATH}" | sed 's/\//\\\//g') - - __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 - for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do - __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 - sed -i '' 's/%%PREFIX%%/\/usr\/local/g' "/usr/local/etc/rc.d/${script}" - sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" "/usr/local/etc/rc.d/${script}" - chmod +x "/usr/local/etc/rc.d/${script}" || return 1 - done - - # And we're good to go - return 0 -} - -install_freebsd_stable_post() { - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - enable_string="salt_${fname}_enable=YES" - grep "$enable_string" /etc/rc.conf >/dev/null 2>&1 - [ $? -eq 1 ] && sysrc "$enable_string" - - done -} - -install_freebsd_git_post() { - install_freebsd_stable_post || return 1 - return 0 -} - -install_freebsd_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return - - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - service "salt_$fname" stop > /dev/null 2>&1 - service "salt_$fname" start - done -} - -install_freebsd_onedir() { -# -# call install_freebsd_stable -# - install_freebsd_stable || return 1 - - return 0 -} -# -# Ended FreeBSD Install Functions -# -####################################################################################################################### - -####################################################################################################################### -# -# OpenBSD Install Functions -# - -install_openbsd_deps() { - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then - OPENBSD_REPO='https://cdn.openbsd.org/pub/OpenBSD' - echoinfo "setting package repository to $OPENBSD_REPO" - echo "${OPENBSD_REPO}" >/etc/installurl || return 1 - fi - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - pkg_add -I -v "${_EXTRA_PACKAGES}" || return 1 - fi - return 0 -} - -install_openbsd_git_deps() { - install_openbsd_deps || return 1 - - if ! __check_command_exists git; then - pkg_add -I -v git || return 1 - fi - __git_clone_and_checkout || return 1 - - pkg_add -I -v py3-pip py3-setuptools - - # - # Let's trigger config_salt() - # - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi - - return 0 -} - -install_openbsd_git() { - # - # Install from git - # - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 -} - -install_openbsd_stable() { - pkg_add -r -I -v salt || return 1 - return 0 -} - -install_openbsd_post() { - for fname in api master minion syndic; do - [ "$fname" = "api" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - rcctl enable "salt_$fname" - done - - return 0 -} - -install_openbsd_check_services() { - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && continue - - if [ -f "/etc/rc.d/salt_${fname}" ]; then - __check_services_openbsd "salt_${fname}" || return 1 - fi - done - - return 0 -} - -install_openbsd_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return - - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue - - # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue - - rcctl restart "salt_${fname}" - done - - return 0 -} - -install_openbsd_onedir() { -# -# Call install_openbsd_stable -# - install_openbsd_stable || return 1 - - return 0 -} -# -# Ended OpenBSD Install Functions -# -####################################################################################################################### - ####################################################################################################################### # diff --git a/btstrap-build.linux.yml b/btstrap-build.linux.yml index b43f44b..e43eea6 100644 --- a/btstrap-build.linux.yml +++ b/btstrap-build.linux.yml @@ -125,7 +125,6 @@ platforms: - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - name: oraclelinux-8 - - name: oraclelinux-7 - name: rockylinux-8 - name: ubuntu-22.04 - name: ubuntu-23.10 @@ -166,9 +165,6 @@ suites: - arch - gentoo - gentoo-systemd - - freebsd-131 - - freebsd-123 - - openbsd-6 - name: git-3006x provisioner: salt_version: 3006.x @@ -179,9 +175,6 @@ suites: - arch - gentoo - gentoo-systemd - - freebsd-131 - - freebsd-123 - - openbsd-6 - name: stable-3006 provisioner: salt_version: 3006 @@ -190,9 +183,6 @@ suites: - opensuse-15 - opensuse-tumbleweed - arch - - freebsd-131 - - freebsd-123 - - openbsd-6 - name: stable-3006-8 provisioner: salt_version: 3006.8 @@ -201,9 +191,6 @@ suites: - opensuse-15 - opensuse-tumbleweed - arch - - freebsd-131 - - freebsd-123 - - openbsd-6 - name: git-master provisioner: salt_version: master @@ -245,10 +232,7 @@ suites: salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s excludes: - arch - - freebsd-131 - - freebsd-123 - gentoo - - openbsd-6 - opensuse-15 - opensuse-tumbleweed diff --git a/kitchen.macos.yml b/kitchen.macos.yml deleted file mode 100644 index a0d8921..0000000 --- a/kitchen.macos.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -driver: - name: exec - -provisioner: - sudo: true - salt_bootstrap_options: -MP stable %s - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - sudo mkdir -p /etc/salt/master.d - sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - brew install coreutils - sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -platforms: - - name: macos-12 - - name: macos-13 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_call_command: /opt/salt/salt-call - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: /opt/salt/salt-call - - name: latest - provisioner: - salt_version: latest - salt_call_command: /opt/salt/salt-call - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.windows.yml b/kitchen.windows.yml deleted file mode 100644 index 951f703..0000000 --- a/kitchen.windows.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -driver: - name: proxy - host: localhost - reset_command: "exit 0" - port: 5985 - username: kitchen - password: Password1 - -provisioner: - salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1 - salt_bootstrap_options: -Version %s -Verbose - init_environment: '' - -platforms: - - name: windows-2022 - - name: windows-2019 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006.8 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: latest - provisioner: - salt_version: latest - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.yml b/kitchen.yml deleted file mode 100644 index 1f4e8f4..0000000 --- a/kitchen.yml +++ /dev/null @@ -1,263 +0,0 @@ ---- -driver: - name: docker - use_sudo: false - hostname: salt - privileged: true - username: root - cap_add: - - sys_admin - disable_upstart: false - use_internal_docker_network: false - run_command: /usr/lib/systemd/systemd - -provisioner: - name: salt_solo - salt_install: bootstrap - salt_bootstrap_url: bootstrap-salt.sh - salt_bootstrap_options: -MPfq git %s - install_after_init_environment: true - log_level: info - sudo: false - require_chef: false - formula: tests - run_salt_call: false - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - mkdir -p /etc/salt/master.d - mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -platforms: - - name: almalinux-9 - driver: - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: almalinux-8 - - name: amazon-2 - driver: - image: amazonlinux:2 - platform: rhel - provision_command: - - yum -y install procps-ng - - name: amazon-2023 - driver: - image: amazonlinux:2023 - platform: fedora - provision_command: - - yum -y install procps-ng - - name: arch - driver: - image: archlinux/archlinux - provision_command: - - pacman -Syu --noconfirm --needed systemd grep awk procps which - - systemctl enable sshd - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream9 - driver: - platform: centosstream - image: quay.io/centos/centos:stream9 - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream8 - driver: - image: quay.io/centos/centos:stream8 - - name: centos-7 - driver: - run_command: /lib/systemd/systemd - - name: debian-10 - driver: - run_command: /lib/systemd/systemd - - name: debian-11 - driver: - image: debian:bullseye - run_command: /lib/systemd/systemd - - name: debian-12 - driver: - image: debian:bullseye - run_command: /lib/systemd/systemd - - name: fedora-38 - driver: - provision_command: &fedora_provision_command - - dnf -y install procps-ng crypto-policies-scripts - - update-crypto-policies - - name: fedora-39 - driver: - provision_command: *fedora_provision_command - - name: gentoo - driver: - image: gentoo/stage3:latest - run_command: /sbin/init - provision_command: - - rc-update add sshd default - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: gentoo-systemd - driver: - image: gentoo/stage3:systemd - run_command: /lib/systemd/systemd - provision_command: - - systemctl enable sshd.service - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: opensuse-15 - driver: - image: opensuse/leap:15.4 - provision_command: - - &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1 - - &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd - - &opensuse_provision_command_03 systemctl enable sshd.service - - name: opensuse-tumbleweed - driver: - image: opensuse/tumbleweed:latest - provision_command: - - *opensuse_provision_command_01 - - *opensuse_provision_command_02 - - *opensuse_provision_command_03 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-9 - driver: - platform: centosstream - run_command: /usr/lib/systemd/systemd - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-8 - - name: oraclelinux-8 - - name: oraclelinux-7 - - name: rockylinux-8 - - name: ubuntu-22.04 - - name: ubuntu-23.10 - driver: - run_command: /lib/systemd/systemd - provision_command: - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: ubuntu-20.04 - driver: - run_command: /lib/systemd/systemd - - name: photon-4 - driver: - image: photon:4.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service - - name: photon-5 - driver: - image: photon:5.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service - -suites: - - name: git-3006 - provisioner: - salt_version: v3006 - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - debian-11 - - arch - - gentoo - - gentoo-systemd - - freebsd-131 - - freebsd-123 - - openbsd-6 - - name: git-3006x - provisioner: - salt_version: 3006.x - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - gentoo - - gentoo-systemd - - freebsd-131 - - freebsd-123 - - openbsd-6 - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - freebsd-131 - - freebsd-123 - - openbsd-6 - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - freebsd-131 - - freebsd-123 - - openbsd-6 - - name: git-master - provisioner: - salt_version: master - salt_bootstrap_options: -x python3 -MPfq -D git %s - - - name: latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP stable %s - - - name: default - provisioner: - salt_version: latest - salt_bootstrap_options: -MP - - - name: onedir-nightly - provisioner: - salt_version: nightly - salt_bootstrap_options: -MP onedir %s - - - name: onedir-latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3005 - provisioner: - salt_version: 3005 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-rc-3007-0rc1 - provisioner: - salt_version: 3007.0rc1 - salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s - excludes: - - arch - - freebsd-131 - - freebsd-123 - - gentoo - - openbsd-6 - - opensuse-15 - - opensuse-tumbleweed - - - name: quickstart - provisioner: - salt_bootstrap_options: -Q - -verifier: - name: shell - remote_exec: false - command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ From bd84c9c4df27a956f8686b786050c9544284a48b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jun 2024 14:41:01 -0600 Subject: [PATCH 23/80] Fix typo --- .github/workflows/test-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 63f458c..c8a1915 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -61,7 +61,7 @@ jobs: ## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) ## DGM ## DGM Need to select a GitHub runner here , ubuntu-latest - sleep 2 + sleep 2 - name: Test Bootstrap run: | From 1812ec20e690421b8ce2e22e119658e017827ef3 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 25 Jun 2024 09:39:50 -0600 Subject: [PATCH 24/80] Saving before revert to using kitchen in interest of speed --- btstrap-build.linux.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/btstrap-build.linux.yml b/btstrap-build.linux.yml index e43eea6..58329e8 100644 --- a/btstrap-build.linux.yml +++ b/btstrap-build.linux.yml @@ -1,4 +1,7 @@ --- +## DGM this was the ruby file used with kitchen-salt to provide the instances to test on using docker. +## DGM Need to duplicate this creation of docker containers process. + driver: name: docker use_sudo: false @@ -175,6 +178,7 @@ suites: - arch - gentoo - gentoo-systemd + - name: stable-3006 provisioner: salt_version: 3006 @@ -183,6 +187,7 @@ suites: - opensuse-15 - opensuse-tumbleweed - arch + - name: stable-3006-8 provisioner: salt_version: 3006.8 @@ -191,6 +196,36 @@ suites: - opensuse-15 - opensuse-tumbleweed - arch + + - name: git-3007 + provisioner: + salt_version: v3007 + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - name: git-3007x + provisioner: + salt_version: 3007.x + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - gentoo + - gentoo-systemd + - name: stable-3007-1 + provisioner: + salt_version: 3007.1 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch - name: git-master provisioner: salt_version: master From 1ad1dbe0fcfcd7c866b217b38528c623148a24ee Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 25 Jun 2024 11:23:53 -0600 Subject: [PATCH 25/80] Reverted to using kitchen-salt in order to get this out faster --- .github/workflows/ci.yml | 9 +- .github/workflows/templates/ci.yml | 9 +- .github/workflows/test-linux.yml | 28 ++- .github/workflows/test-macos.yml | 27 ++- .github/workflows/test-windows.yml | 33 ++-- .pre-commit-config.yaml | 11 +- CHANGELOG.md | 3 +- Gemfile | 11 ++ kitchen.macos.yml | 42 +++++ kitchen.windows.yml | 42 +++++ kitchen.yml | 286 +++++++++++++++++++++++++++++ 11 files changed, 436 insertions(+), 65 deletions(-) create mode 100644 Gemfile create mode 100644 kitchen.macos.yml create mode 100644 kitchen.windows.yml create mode 100644 kitchen.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc3ac74..73ae839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,8 @@ jobs: separator: "," files: | bootstrap-salt.* - ## DGM Gemfile - ## DGM kitchen*.yml - btstrap-build*.yml + Gemfile + kitchen*.yml tests/** .github/workflows/** files_ignore: | @@ -62,10 +61,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.9 - name: Install Pre-Commit run: | diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index f24688d..2bde230 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -27,9 +27,8 @@ jobs: separator: "," files: | bootstrap-salt.* - ## DGM Gemfile - ## DGM kitchen*.yml - btstrap-build*.yml + Gemfile + kitchen*.yml tests/** .github/workflows/** files_ignore: | @@ -62,10 +61,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.9 - name: Install Pre-Commit run: | diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index c8a1915..75235df 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -38,16 +38,17 @@ jobs: - uses: actions/checkout@v3 ## DGM Need to replace this - ## DGM - name: Setup Ruby - ## DGM uses: ruby/setup-ruby@v1 - ## DGM with: - ## DGM ruby-version: 3.2.3 - ## DGM bundler-cache: true + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ## DGM ruby-version: 3.2.3 + ruby-version: 2.6.10 + bundler-cache: true - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.9 - name: Install Python Dependencies run: | @@ -57,27 +58,20 @@ jobs: - name: Create Test Instance run: | ## DGM Need to replace this - ## DGM b - ## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) - ## DGM - ## DGM Need to select a GitHub runner here , ubuntu-latest + (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) sleep 2 - name: Test Bootstrap run: | ## DGM Need to replace this - ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM Need to run the bootstrap tests for Linux here + bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Destroy Test Instance if: always() run: | ## DGM Need to replace this - ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Set Exit Status diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index a42c9b4..8d53170 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -28,9 +28,9 @@ on: default: 20 description: The timeout(in minutes) for the workflow -## DGM env: -## DGM KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' -## DGM +env: + KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' + ## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ? jobs: @@ -50,13 +50,14 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.3 + ## DGM ruby-version: 3.2.3 + ruby-version: 2.6.10 bundler-cache: true - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.9 - name: Install Python Dependencies run: | @@ -65,25 +66,19 @@ jobs: - name: Create Test Instance run: | - ## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ - ## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) - ## DGM - ## DGM Need to select a GitHub runner here , macos-latest + bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ + (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) sleep 2 - name: Test Bootstrap run: | - ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM Need to run the bootstrap tests for MacOS here + bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Destroy Test Instance if: always() run: | - ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Set Exit Status diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 930e6c9..dea426a 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -28,12 +28,12 @@ on: default: 20 description: The timeout(in minutes) for the workflow -## DGM env: -## DGM machine_user: kitchen -## DGM machine_pass: Password1 -## DGM machine_port: 5985 -## DGM KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' -## DGM +env: + machine_user: kitchen + machine_pass: Password1 + machine_port: 5985 + KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' + ## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ? jobs: @@ -53,7 +53,8 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.3 + ## DGM ruby-version: 3.2.3 + ruby-version: 2.6.10 bundler-cache: true - name: Install Chef @@ -82,10 +83,10 @@ jobs: winrm set winrm/config/service '@{AllowUnencrypted="True"}' env - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.9 - name: Install Python Dependencies run: | @@ -94,25 +95,19 @@ jobs: - name: Create Test Instance run: | - ## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM Need to select a GitHub runner here , ubuntu-latest + bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Test Bootstrap run: | - ## DGM env - ## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM Need to run the bootstrap tests for Windows here + env + bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Destroy Test Instance if: always() run: | - ## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} - ## DGM - ## DGM this can be removed since using GitHub shared runners, and it should just close when done with it + bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Set Exit Status diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d916858..9fb6a26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,12 +37,19 @@ repos: args: - requirements/release.in +## DGM - repo: https://github.com/asottile/pyupgrade +## DGM rev: v3.15.0 +## DGM hooks: +## DGM - id: pyupgrade +## DGM name: Rewrite Code to be Py3.10+ +## DGM args: [--py310-plus] + - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: - id: pyupgrade - name: Rewrite Code to be Py3.10+ - args: [--py310-plus] + name: Rewrite Code to be Py3.9+ + args: [--py39-plus] - repo: https://github.com/asottile/reorder_python_imports rev: v3.12.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index e503a9c..f32d61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## What's Changed -- Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities +## DGM - Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities + - Migrated to using GitHub Actions - Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7 - Removed support for FreeBSD and OpenBSD diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a70a9da --- /dev/null +++ b/Gemfile @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem 'test-kitchen', '>= 3.2.2' +gem 'kitchen-salt', '>= 0.7.2' +gem 'kitchen-docker', :git => 'https://github.com/test-kitchen/kitchen-docker.git', :branch => 'main' + +group :vagrant do + gem 'kitchen-vagrant' +end diff --git a/kitchen.macos.yml b/kitchen.macos.yml new file mode 100644 index 0000000..616a489 --- /dev/null +++ b/kitchen.macos.yml @@ -0,0 +1,42 @@ +--- +driver: + name: exec + +provisioner: + sudo: true + salt_bootstrap_options: -MP stable %s + init_environment: | + echo 'auto_accept: true' > /tmp/auto-accept-keys.conf + sudo mkdir -p /etc/salt/master.d + sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf + brew install coreutils + sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' + +platforms: + - name: macos-12 + - name: macos-13 + +suites: + - name: stable-3006 + provisioner: + salt_version: 3006 + salt_call_command: /opt/salt/salt-call + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_call_command: /opt/salt/salt-call + - name: stable-3007 + provisioner: + salt_version: 3007 + salt_call_command: /opt/salt/salt-call + - name: stable-3007-1 + provisioner: + salt_version: 3007.1 + salt_call_command: /opt/salt/salt-call + - name: latest + provisioner: + salt_version: latest + salt_call_command: /opt/salt/salt-call + +verifier: + command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.windows.yml b/kitchen.windows.yml new file mode 100644 index 0000000..a2b88e2 --- /dev/null +++ b/kitchen.windows.yml @@ -0,0 +1,42 @@ +--- +driver: + name: proxy + host: localhost + reset_command: "exit 0" + port: 5985 + username: kitchen + password: Password1 + +provisioner: + salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1 + salt_bootstrap_options: -Version %s -Verbose + init_environment: '' + +platforms: + - name: windows-2022 + - name: windows-2019 + +suites: + - name: stable-3006 + provisioner: + salt_version: 3006 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: stable-3007 + provisioner: + salt_version: 3007 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: stable-3007-1 + provisioner: + salt_version: 3007.1 + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + - name: latest + provisioner: + salt_version: latest + salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe + +verifier: + command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.yml b/kitchen.yml new file mode 100644 index 0000000..f5d91cd --- /dev/null +++ b/kitchen.yml @@ -0,0 +1,286 @@ +--- +driver: + name: docker + use_sudo: false + hostname: salt + privileged: true + username: root + cap_add: + - sys_admin + disable_upstart: false + use_internal_docker_network: false + run_command: /usr/lib/systemd/systemd + +provisioner: + name: salt_solo + salt_install: bootstrap + salt_bootstrap_url: bootstrap-salt.sh + salt_bootstrap_options: -MPfq git %s + install_after_init_environment: true + log_level: info + sudo: false + require_chef: false + formula: tests + run_salt_call: false + init_environment: | + echo 'auto_accept: true' > /tmp/auto-accept-keys.conf + mkdir -p /etc/salt/master.d + mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf + sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' + +platforms: + - name: almalinux-9 + driver: + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: almalinux-8 + - name: amazon-2 + driver: + image: amazonlinux:2 + platform: rhel + provision_command: + - yum -y install procps-ng + - name: amazon-2023 + driver: + image: amazonlinux:2023 + platform: fedora + provision_command: + - yum -y install procps-ng + - name: arch + driver: + image: archlinux/archlinux + provision_command: + - pacman -Syu --noconfirm --needed systemd grep awk procps which + - systemctl enable sshd + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: centos-stream9 + driver: + platform: centosstream + image: quay.io/centos/centos:stream9 + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: centos-stream8 + driver: + image: quay.io/centos/centos:stream8 + - name: debian-11 + driver: + image: debian:bullseye + run_command: /lib/systemd/systemd + - name: debian-12 + driver: + image: debian:bookworm + run_command: /lib/systemd/systemd + - name: fedora-39 + driver: + provision_command: &fedora_provision_command + - dnf -y install procps-ng crypto-policies-scripts + - update-crypto-policies --set LEGACY + - name: fedora-40 + driver: + provision_command: *fedora_provision_command + - name: gentoo + driver: + image: gentoo/stage3:latest + run_command: /sbin/init + provision_command: + - rc-update add sshd default + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: gentoo-systemd + driver: + image: gentoo/stage3:systemd + run_command: /lib/systemd/systemd + provision_command: + - systemctl enable sshd.service + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: opensuse-15 + driver: + image: opensuse/leap:15.4 + provision_command: + - &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1 + - &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd + - &opensuse_provision_command_03 systemctl enable sshd.service + - name: opensuse-tumbleweed + driver: + image: opensuse/tumbleweed:latest + provision_command: + - *opensuse_provision_command_01 + - *opensuse_provision_command_02 + - *opensuse_provision_command_03 + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: rockylinux-9 + driver: + platform: centosstream + run_command: /usr/lib/systemd/systemd + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: rockylinux-8 + - name: oraclelinux-8 + - name: rockylinux-8 + - name: ubuntu-22.04 + - name: ubuntu-24.04 + driver: + run_command: /lib/systemd/systemd + provision_command: + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: ubuntu-20.04 + driver: + run_command: /lib/systemd/systemd + - name: photon-4 + driver: + image: photon:4.0 + provision_command: + - tdnf -y install rpm procps-ng coreutils gawk + - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config + - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config + - systemctl enable sshd.service + - name: photon-5 + driver: + image: photon:5.0 + provision_command: + - tdnf -y install rpm procps-ng coreutils gawk + - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config + - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config + - systemctl enable sshd.service + +suites: + - name: git-3006 + provisioner: + salt_version: v3006 + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - name: git-3006x + provisioner: + salt_version: 3006.x + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - name: git-3007 + provisioner: + salt_version: v3007 + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - name: git-3007x + provisioner: + salt_version: 3007.x + salt_bootstrap_options: -x python3 -MPfq git %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - debian-11 + - arch + - gentoo + - gentoo-systemd + - name: stable-3006 + provisioner: + salt_version: 3006 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - name: stable-3006-8 + provisioner: + salt_version: 3006.8 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - name: stable-3007 + provisioner: + salt_version: 3007 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - name: stable-3007-1 + provisioner: + salt_version: 3007.1 + salt_bootstrap_options: -x python3 -MP stable %s + excludes: + - opensuse-15 + - opensuse-tumbleweed + - arch + - name: git-master + provisioner: + salt_version: master + salt_bootstrap_options: -x python3 -MPfq -D git %s + + - name: latest + provisioner: + salt_version: latest + salt_bootstrap_options: -MP stable %s + + - name: default + provisioner: + salt_version: latest + salt_bootstrap_options: -MP + + - name: onedir-nightly + provisioner: + salt_version: nightly + salt_bootstrap_options: -MP onedir %s + + - name: onedir-latest + provisioner: + salt_version: latest + salt_bootstrap_options: -MP onedir %s + + - name: onedir-3006 + provisioner: + salt_version: 3006 + salt_bootstrap_options: -MP onedir %s + + - name: onedir-3007 + provisioner: + salt_version: 3007 + salt_bootstrap_options: -MP onedir %s + + - name: onedir-rc-3008-0rc1 + provisioner: + salt_version: 3008.0rc1 + salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s + excludes: + - arch + - gentoo + - opensuse-15 + - opensuse-tumbleweed + - ubuntu-2004 + - ubuntu-2204 + + + - name: quickstart + provisioner: + salt_bootstrap_options: -Q + +verifier: + name: shell + remote_exec: false + command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ From 679bc97156a751144833f3ee05bfad886eb3d934 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 25 Jun 2024 13:54:09 -0600 Subject: [PATCH 26/80] Revert PR 1985 changes to artiface@v3, etc. --- .github/workflows/ci.yml | 27 ++++++++++++++++--------- .github/workflows/templates/ci-tail.yml | 6 ++++-- .github/workflows/templates/ci.yml | 21 ++++++++++++------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73ae839..6f6c6bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v42 + uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -47,7 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -59,7 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Set up Python 3.9 uses: actions/setup-python@v4 @@ -84,7 +88,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -96,7 +101,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -109,7 +115,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -555,14 +562,16 @@ jobs: - name: Download Exit Status Files if: always() - uses: actions/download-artifact@v4 + ## DGM uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: exitstatus path: exitstatus - name: Delete Exit Status Artifacts if: always() - uses: geekyeggo/delete-artifact@v4 + ## DGM uses: geekyeggo/delete-artifact@v4 + uses: geekyeggo/delete-artifact@v3 with: name: exitstatus failOnError: false diff --git a/.github/workflows/templates/ci-tail.yml b/.github/workflows/templates/ci-tail.yml index da692ed..2314089 100644 --- a/.github/workflows/templates/ci-tail.yml +++ b/.github/workflows/templates/ci-tail.yml @@ -11,14 +11,16 @@ - name: Download Exit Status Files if: always() - uses: actions/download-artifact@v4 + ## DGM uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: exitstatus path: exitstatus - name: Delete Exit Status Artifacts if: always() - uses: geekyeggo/delete-artifact@v4 + ## DGM uses: geekyeggo/delete-artifact@v4 + uses: geekyeggo/delete-artifact@v3 with: name: exitstatus failOnError: false diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 2bde230..8788ce7 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -16,13 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v42 + uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -47,7 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -59,7 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Set up Python 3.9 uses: actions/setup-python@v4 @@ -84,7 +88,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -96,7 +101,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -109,7 +115,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus From f88a3208554802958d608e5a8afe8d4d4b087d78 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 25 Jun 2024 15:56:18 -0600 Subject: [PATCH 27/80] Made defaults Python 3, and other fixes for chkconfig and procps --- bootstrap-salt.sh | 97 ++++++++++++++++------------------------- btstrap-build.linux.yml | 6 --- 2 files changed, 38 insertions(+), 65 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index b520a60..ea6b4a7 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -627,8 +627,8 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="$1" ITYPE="onedir" shift - ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then - elif [ "$(echo "$1" | grep -E '^([3-10][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" _ONEDIR_REV="$1" ITYPE="onedir" @@ -646,8 +646,8 @@ elif [ "$ITYPE" = "onedir" ]; then if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then ONEDIR_REV="$1" shift - ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then - elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}(\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}(\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" shift else @@ -669,14 +669,14 @@ elif [ "$ITYPE" = "onedir_rc" ]; then if [ "$(echo "$1" | grep -E '^(latest)$')" != "" ]; then ONEDIR_REV="$1" shift - ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then - elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" shift - ## DGM elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then - elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then + ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" @@ -768,6 +768,11 @@ if [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then fi fi + +# Default to Python 3, no longer support for Python 2 +_PY_PKG_VER="3.10" +_PY_MAJOR_VERSION="3" + # Check if we're installing via a different Python executable and set major version variables if [ -n "$_PY_EXE" ]; then if [ "$(uname)" = "Darwin" ]; then @@ -776,8 +781,8 @@ if [ -n "$_PY_EXE" ]; then _PY_PKG_VER=$(echo "$_PY_EXE" | sed -E "s/\\.//g") fi - _PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7) - if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + TEST_PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7) + if [ "$TEST_PY_MAJOR_VERSION" -eq 2 ]; then echoerror "Python 2 is no longer supported, only Python 3" return 1 fi @@ -792,8 +797,8 @@ if [ -n "$_PY_EXE" ]; then echoinfo "Detected -x option. Using $_PY_EXE to install Salt." fi else - _PY_PKG_VER="" - _PY_MAJOR_VERSION="" + _PY_PKG_VER="3.10" + _PY_MAJOR_VERSION="3" fi # If the configuration directory or archive does not exist, error out @@ -4152,24 +4157,16 @@ install_fedora_onedir_deps() { fi ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream - ## DGM also EL9 doesn't have propcs - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi - - __PACKAGES="" - - if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then - __PACKAGES="chkconfig" - elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="chkconfig procps" + ## DGM but find it on 8 and 9 Centos Stream also EL9 doesn't have propcs + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="dnf-utils chkconfig" else - __PACKAGES="yum-utils chkconfig procps" + __PACKAGES="yum-utils chkconfig" fi + __PACKAGES="${__PACKAGES} procps" + + # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4307,24 +4304,15 @@ install_centos_stable_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM also EL9 doesn't have propcs - ## DGM and probably don't need these packages since using onedir - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi - - __PACKAGES="" - - if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then - __PACKAGES="chkconfig" - elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="chkconfig procps" + ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="dnf-utils chkconfig" else - __PACKAGES="yum-utils chkconfig procps" + __PACKAGES="yum-utils chkconfig" fi + __PACKAGES="${__PACKAGES} procps" + # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4533,24 +4521,15 @@ install_centos_onedir_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM also EL9 doesn't have propcs - ## DGM and probably don't need these packages since using onedir - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi - - __PACKAGES="" - - if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then - __PACKAGES="chkconfig" - elif [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="chkconfig procps" + ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="dnf-utils chkconfig" else - __PACKAGES="yum-utils chkconfig procps" + __PACKAGES="yum-utils chkconfig" fi + __PACKAGES="${__PACKAGES} procps" + # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -7350,8 +7329,8 @@ __macosx_get_packagesite_onedir() { if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then _PKG_VERSION=$(__parse_repo_json_python) - ## DGM elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then - elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-10][0-9]{3}(\.[0-9]*))')" != "" ]; then + elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then + ## DGM elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-10][0-9]{3}(\.[0-9]*))')" != "" ]; then _PKG_VERSION=$_ONEDIR_REV else _PKG_VERSION=$(__parse_repo_json_python) diff --git a/btstrap-build.linux.yml b/btstrap-build.linux.yml index 58329e8..6c9a7f4 100644 --- a/btstrap-build.linux.yml +++ b/btstrap-build.linux.yml @@ -69,12 +69,6 @@ platforms: - name: centos-stream8 driver: image: quay.io/centos/centos:stream8 - - name: centos-7 - driver: - run_command: /lib/systemd/systemd - - name: debian-10 - driver: - run_command: /lib/systemd/systemd - name: debian-11 driver: image: debian:bullseye From 9716ff0b9176e4e9f6d1249b5c033286cc281f88 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 25 Jun 2024 16:54:18 -0600 Subject: [PATCH 28/80] Updated to use procps-ng for Redhat family --- bootstrap-salt.sh | 43 ++++++++++++++++++++++++------------------- kitchen.yml | 6 +++--- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ea6b4a7..b36d123 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3873,7 +3873,7 @@ install_fedora_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream ## DGM __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" - __PACKAGES="${__PACKAGES} libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" + __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip python${PY_PKG_VER}-m2crypto python${PY_PKG_VER}-pyyaml" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-systemd" @@ -4158,14 +4158,15 @@ install_fedora_onedir_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream also EL9 doesn't have propcs - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi - __PACKAGES="${__PACKAGES} procps" + ## DGM __PACKAGES="${__PACKAGES} procps" + __PACKAGES="dnf-utils chkconfig procps-ng" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4305,13 +4306,15 @@ install_centos_stable_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi - __PACKAGES="${__PACKAGES} procps" + ## DGM __PACKAGES="${__PACKAGES} procps" + + __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4522,13 +4525,15 @@ install_centos_onedir_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM else + ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM fi - __PACKAGES="${__PACKAGES} procps" + ## DGM __PACKAGES="${__PACKAGES} procps" + + __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 diff --git a/kitchen.yml b/kitchen.yml index f5d91cd..c6442a7 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -114,17 +114,17 @@ platforms: - *opensuse_provision_command_03 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-9 + - name: rockylinux-8 driver: platform: centosstream run_command: /usr/lib/systemd/systemd provision_command: - - dnf -y install crypto-policies-scripts procps-ng + ## DGM - dnf -y install crypto-policies-scripts procps-ng ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - yum -y install crypto-policies-scripts procps-ng - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-8 - name: oraclelinux-8 - - name: rockylinux-8 - name: ubuntu-22.04 - name: ubuntu-24.04 driver: From 8a14ff6c04de4dfac8c2af62cc4c5a2030462d71 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 26 Jun 2024 12:00:17 -0600 Subject: [PATCH 29/80] Updated code --- .github/workflows/ci.yml | 9 ++- .github/workflows/templates/ci.yml | 9 ++- .github/workflows/test-linux.yml | 9 ++- .github/workflows/test-macos.yml | 9 ++- .github/workflows/test-windows.yml | 9 ++- bootstrap-salt.sh | 121 ++++++++++------------------- kitchen.yml | 17 ++-- 7 files changed, 88 insertions(+), 95 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f6c6bc..3bb9da6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,10 +65,15 @@ jobs: ## DGM - uses: actions/checkout@v4 - uses: actions/checkout@v3 - - name: Set up Python 3.9 + ## DGM - name: Set up Python 3.9 + ## DGM uses: actions/setup-python@v4 + ## DGM with: + ## DGM python-version: 3.9 + + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Pre-Commit run: | diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 8788ce7..03504c2 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -65,10 +65,15 @@ jobs: ## DGM - uses: actions/checkout@v4 - uses: actions/checkout@v3 - - name: Set up Python 3.9 + ## DGM - name: Set up Python 3.9 + ## DGM uses: actions/setup-python@v4 + ## DGM with: + ## DGM python-version: 3.9 + + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Pre-Commit run: | diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 75235df..83192eb 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -45,10 +45,15 @@ jobs: ruby-version: 2.6.10 bundler-cache: true - - name: Set up Python 3.9 + ## DGM - name: Set up Python 3.9 + ## DGM uses: actions/setup-python@v4 + ## DGM with: + ## DGM python-version: 3.9 + + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 8d53170..0ff92c8 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -54,10 +54,15 @@ jobs: ruby-version: 2.6.10 bundler-cache: true - - name: Set up Python 3.9 + ## DGM - name: Set up Python 3.9 + ## DGM uses: actions/setup-python@v4 + ## DGM with: + ## DGM python-version: 3.9 + + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index dea426a..7f2050e 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -83,10 +83,15 @@ jobs: winrm set winrm/config/service '@{AllowUnencrypted="True"}' env - - name: Set up Python 3.9 + ## DGM - name: Set up Python 3.9 + ## DGM uses: actions/setup-python@v4 + ## DGM with: + ## DGM python-version: 3.9 + + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Python Dependencies run: | diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index b36d123..94608d8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -770,7 +770,9 @@ fi # Default to Python 3, no longer support for Python 2 -_PY_PKG_VER="3.10" +PY_PKG_VER=3 +__PY_VERSION_REPO="py3" +_PY_PKG_VER="python3" _PY_MAJOR_VERSION="3" # Check if we're installing via a different Python executable and set major version variables @@ -787,7 +789,7 @@ if [ -n "$_PY_EXE" ]; then return 1 fi - if [ "$_PY_MAJOR_VERSION" != 3 ]; then + if [ "$TEST_PY_MAJOR_VERSION" != 3 ]; then echoerror "Detected -x option, but Python major version is not 3." echoerror "The -x option must be passed as python3, python38, or python3.8 (use the Python '3' versions of examples)." exit 1 @@ -797,7 +799,7 @@ if [ -n "$_PY_EXE" ]; then echoinfo "Detected -x option. Using $_PY_EXE to install Salt." fi else - _PY_PKG_VER="3.10" + _PY_PKG_VER="python3" _PY_MAJOR_VERSION="3" fi @@ -2741,8 +2743,8 @@ EOM fi _setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}" - if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - echoerror "Python 2 is no longer supported, only Python 3" + if [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -2939,8 +2941,6 @@ __install_saltstack_ubuntu_repository() { return 1 fi - __PY_VERSION_REPO="py3" - # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list @@ -2979,8 +2979,6 @@ __install_saltstack_ubuntu_onedir_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 - __PY_VERSION_REPO="py3" - # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${ONEDIR_REV}/" if [ "${ONEDIR_REV}" = "nightly" ] ; then @@ -3007,10 +3005,8 @@ install_ubuntu_deps() { __PACKAGES='' - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 - else - echoerror "Python 2 is no longer supported, only Python 3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -3095,10 +3091,8 @@ install_ubuntu_git_deps() { __git_clone_and_checkout || return 1 - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 - else - echoerror "Python 2 is no longer supported, only Python 3" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -3402,8 +3396,6 @@ __install_saltstack_debian_repository() { return 1 fi - __PY_VERSION_REPO="py3" - # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3420,7 +3412,7 @@ __install_saltstack_debian_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput "${__PACKAGES}" || return 1 - # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location + # amd64 is just a part of repository URI SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" @@ -3438,8 +3430,6 @@ __install_saltstack_debian_onedir_repository() { return 1 fi - __PY_VERSION_REPO="py3" - # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3456,7 +3446,7 @@ __install_saltstack_debian_onedir_repository() { # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput "${__PACKAGES}" || return 1 - # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location + # amd64 is just a part of repository URI SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${ONEDIR_REV}/" if [ "${ONEDIR_REV}" = "nightly" ] ; then SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/" @@ -3492,10 +3482,9 @@ install_debian_deps() { __apt_get_upgrade_noinput || return 1 fi - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 - else - PY_PKG_VER="" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 @@ -3545,10 +3534,9 @@ install_debian_onedir_deps() { __apt_get_upgrade_noinput || return 1 fi - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 - else - PY_PKG_VER="" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 @@ -3596,10 +3584,9 @@ install_debian_git_deps() { install_debian_deps || return 1 install_debian_git_pre || return 1 - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - PY_PKG_VER=3 - else - PY_PKG_VER="" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 fi __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" @@ -3643,38 +3630,21 @@ install_debian_git() { return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - # We can use --prefix on debian based ditributions - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM else - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM fi - _POST_NEON_PIP_INSTALL_ARGS="" - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 + # We can use --prefix on debian based ditributions + _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - # Account for new path for services files in later releases - if [ -d "pkg/common" ]; then - _SERVICE_DIR="pkg/common" - else - _SERVICE_DIR="pkg" - fi + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 + cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 - sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service - return 0 + # Account for new path for services files in later releases + if [ -d "pkg/common" ]; then + _SERVICE_DIR="pkg/common" else - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 + _SERVICE_DIR="pkg" fi - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - # shellcheck disable=SC2086 - "${_PYEXE}" setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 - else - # shellcheck disable=SC2086 - "${_PYEXE}" setup.py "${SETUP_PY_INSTALL_ARGS}" install --install-layout=deb || return 1 - fi + sed -i 's:/usr/bin:/usr/local/bin:g' "${_SERVICE_DIR}"/*.service + return 0 } install_debian_onedir() { @@ -3776,7 +3746,7 @@ install_debian_restart_daemons() { [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue if [ -f /bin/systemctl ]; then - # Debian 8 uses systemd + # Debian 8 and above uses systemd /bin/systemctl stop "salt-$fname" > /dev/null 2>&1 /bin/systemctl start "salt-$fname.service" && continue if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then @@ -3862,8 +3832,8 @@ install_fedora_deps() { fi __PACKAGES="${__PACKAGES:=}" - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -lt 3 ]; then - echoerror "There are no Python 2 stable packages for Fedora, only Py3 packages" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -3961,12 +3931,8 @@ install_fedora_stable_post() { } install_fedora_git_deps() { - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - # Packages are named python3- - PY_PKG_VER=3 - else - ## DGM PY_PKG_VER=2 - echoerror "Python 2 is no longer supported, only Py3 packages" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -6127,7 +6093,7 @@ install_arch_linux_onedir_post() { __install_saltstack_photon_onedir_repository() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python 2 is no longer supported, only Python 3" + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -6163,7 +6129,7 @@ __install_saltstack_photon_onedir_repository() { install_photon_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python 2 is no longer supported, only Python 3" + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -6207,7 +6173,7 @@ install_photon_stable_post() { install_photon_git_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python 2 is no longer supported, only Python 3" + echoerror "Python version is no longer supported, only Python 3" return 1 fi @@ -6744,8 +6710,6 @@ install_opensuse_15_stable_deps() { return 1 fi - PY_PKG_VER=3 - # YAML module is used for generating custom master/minion configs # requests is still used by many salt modules __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" @@ -7298,7 +7262,6 @@ __macosx_get_packagesite() { # TBD DGM need to update for arch and 3006+ repo locations DARWIN_ARCH="x86_64" - __PY_VERSION_REPO="py3" PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg" SALTPKGCONFURL="https://${_REPO_URL}/osx/${PKG}" } @@ -7323,15 +7286,13 @@ __macosx_get_packagesite_onedir() { # TBD DGM need to update for arch and 3006+ repo locations if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python 2 is no longer supported, only Python 3" + echoerror "Python version is no longer supported, only Python 3" return 1 fi ## DGM TBD need to allow for arm64 arch too DARWIN_ARCH="x86_64" - __PY_VERSION_REPO="py3" - if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then _PKG_VERSION=$(__parse_repo_json_python) elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then diff --git a/kitchen.yml b/kitchen.yml index c6442a7..9bb4153 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -33,8 +33,7 @@ platforms: driver: provision_command: - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - update-crypto-policies + - update-crypto-policies --set DEFAULT:SHA1 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: almalinux-8 - name: amazon-2 @@ -62,8 +61,7 @@ platforms: image: quay.io/centos/centos:stream9 provision_command: - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - update-crypto-policies + - update-crypto-policies --set DEFAULT:SHA1 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: centos-stream8 driver: @@ -114,6 +112,15 @@ platforms: - *opensuse_provision_command_03 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-9 + driver: + platform: centosstream + run_command: /usr/lib/systemd/systemd + provision_command: + ## DGM - dnf -y install crypto-policies-scripts procps-ng + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - yum -y install crypto-policies-scripts procps-ng + - update-crypto-policies --set DEFAULT:SHA1 + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 driver: platform: centosstream @@ -122,7 +129,7 @@ platforms: ## DGM - dnf -y install crypto-policies-scripts procps-ng ## DGM - update-crypto-policies --set DEFAULT:SHA1 - yum -y install crypto-policies-scripts procps-ng - - update-crypto-policies + - update-crypto-policies --set DEFAULT:SHA1 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: oraclelinux-8 - name: ubuntu-22.04 From 06107058d98b75384975a498eac067fdd4073fad Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 26 Jun 2024 14:14:24 -0600 Subject: [PATCH 30/80] Revert some changes for centos/redhat install --- bootstrap-salt.sh | 84 ++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 94608d8..a56be88 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1,4 +1,4 @@ -#!/bin/sh - +#!/bin/sh -x # WARNING: Changes to this file in the salt repo will be overwritten! # Please submit pull requests against the salt-bootstrap repo: @@ -24,7 +24,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.06.10" +__ScriptVersion="2024.06.26" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -1494,7 +1494,7 @@ __ubuntu_codename_translation() { DISTRO_CODENAME="noble" ;; *) - DISTRO_CODENAME="jammy" + DISTRO_CODENAME="noble" ;; esac } @@ -1610,9 +1610,9 @@ __debian_codename_translation() { __check_end_of_life_versions() { case "${DISTRO_NAME_L}" in debian) - # Debian versions below 9 are not supported + # Debian versions below 11 are not supported ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 9 ]; then - if [ "$DISTRO_MAJOR_VERSION" -lt 10 ]; then + if [ "$DISTRO_MAJOR_VERSION" -le 10 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.debian.org/DebianReleases" @@ -1679,7 +1679,7 @@ __check_end_of_life_versions() { fedora) # Fedora lower than 38 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 38 ]; then + if [ "$DISTRO_MAJOR_VERSION" -lt 39 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://fedoraproject.org/wiki/Releases" @@ -1688,8 +1688,8 @@ __check_end_of_life_versions() { ;; centos) - # CentOS versions lower than 7 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then + # CentOS versions lower than 8 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " http://wiki.centos.org/Download" @@ -1698,8 +1698,8 @@ __check_end_of_life_versions() { ;; red_hat*linux) - # Red Hat (Enterprise) Linux versions lower than 7 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then + # Red Hat (Enterprise) Linux versions lower than 8 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://access.redhat.com/support/policy/updates/errata/" @@ -1708,8 +1708,8 @@ __check_end_of_life_versions() { ;; oracle*linux) - # Oracle Linux versions lower than 7 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then + # Oracle Linux versions lower than 8 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " http://www.oracle.com/us/support/library/elsp-lifetime-069338.pdf" @@ -1718,8 +1718,8 @@ __check_end_of_life_versions() { ;; scientific*linux) - # Scientific Linux versions lower than 7 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then + # Scientific Linux versions lower than 8 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://www.scientificlinux.org/downloads/sl-versions/" @@ -1728,8 +1728,8 @@ __check_end_of_life_versions() { ;; cloud*linux) - # Cloud Linux versions lower than 7 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then + # Cloud Linux versions lower than 8 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://docs.cloudlinux.com/index.html?cloudlinux_life-cycle.html" @@ -4200,8 +4200,6 @@ __install_saltstack_rhel_onedir_repository() { return 1 fi - __PY_VERSION_REPO="py3" - # Avoid using '$releasever' variable for yum. # Instead, this should work correctly on all RHEL variants. base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${ONEDIR_REV}/" @@ -4269,18 +4267,27 @@ install_centos_stable_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi + ## DGM ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir + ## DGM ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## DGM ## DGM __PACKAGES="dnf-utils chkconfig" + ## DGM ## DGM else + ## DGM ## DGM __PACKAGES="yum-utils chkconfig" + ## DGM ## DGM fi - ## DGM __PACKAGES="${__PACKAGES} procps" + ## DGM ## DGM __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng" + ## DGM __PACKAGES="yum-utils chkconfig procps-ng" + + ## DGM Trying original + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="dnf-utils chkconfig" + else + __PACKAGES="yum-utils chkconfig" + fi + + __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4291,7 +4298,6 @@ install_centos_stable_deps() { __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 fi - return 0 } @@ -4362,8 +4368,7 @@ install_centos_git_deps() { # Set ONEDIR_REV to STABLE_REV in case we # end up calling install_centos_onedir_deps ONEDIR_REV="${STABLE_REV}" - install_centos_onedir_deps || \ - return 1 + install_centos_onedir_deps || return 1 if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __yum_install_noinput ca-certificates || return 1 @@ -4499,7 +4504,20 @@ install_centos_onedir_deps() { ## DGM __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng" + ## DGM __PACKAGES="yum-utils chkconfig procps-ng" + + ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them + ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir + + ## DGM trying original + if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + __PACKAGES="dnf-utils chkconfig" + else + __PACKAGES="yum-utils chkconfig" + fi + + __PACKAGES="${__PACKAGES} procps" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -5391,7 +5409,6 @@ install_alpine_linux_stable() { } install_alpine_linux_git() { - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 } @@ -5945,7 +5962,6 @@ install_arch_linux_git() { _PIP_DOWNLOAD_ARGS="${_PIP_DOWNLOAD_ARGS} --use-pep517" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 return 0 } From dddcd3b67c4a6975e40929ff177b51e6d29d644d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 26 Jun 2024 16:10:43 -0600 Subject: [PATCH 31/80] Added debugging --- bootstrap-salt.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a56be88..26b1522 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -622,19 +622,18 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="latest" ITYPE="onedir" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3006|3007)$')" != "" ]; then ONEDIR_REV="$1" _ONEDIR_REV="$1" ITYPE="onedir" shift elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then - ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" _ONEDIR_REV="$1" ITYPE="onedir" shift else - echo "Unknown stable version: $1 (valid: 3006, latest)" + echo "Unknown stable version: $1 (valid: 3006, 3007, latest)" exit 1 fi fi @@ -643,15 +642,14 @@ elif [ "$ITYPE" = "onedir" ]; then if [ "$#" -eq 0 ];then ONEDIR_REV="latest" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3006|3007)$')" != "" ]; then ONEDIR_REV="$1" shift elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then - ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}(\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" shift else - echo "Unknown onedir version: $1 (valid: 3006, latest, nightly.)" + echo "Unknown onedir version: $1 (valid: 3006, 3007, latest, nightly.)" exit 1 fi fi @@ -670,19 +668,17 @@ elif [ "$ITYPE" = "onedir_rc" ]; then ONEDIR_REV="$1" shift elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then - ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}?rc[0-9]-[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" shift elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then - ## DGM elif [ "$(echo "$1" | grep -E '^([3-10][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix #ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') ONEDIR_REV="minor/$1" shift else - echo "Unknown onedir_rc version: $1 (valid: 3006-8, latest.)" + echo "Unknown onedir_rc version: $1 (valid: 3006-8, 3007-1, latest)" exit 1 fi fi @@ -3511,6 +3507,9 @@ install_debian_deps() { } install_debian_onedir_deps() { + ## DGM Debugging + set -v + set -x if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -7312,7 +7311,6 @@ __macosx_get_packagesite_onedir() { if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then _PKG_VERSION=$(__parse_repo_json_python) elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then - ## DGM elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-10][0-9]{3}(\.[0-9]*))')" != "" ]; then _PKG_VERSION=$_ONEDIR_REV else _PKG_VERSION=$(__parse_repo_json_python) From 969584dd957956da5e2b4aa889b978b7fe39de2e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 26 Jun 2024 16:45:14 -0600 Subject: [PATCH 32/80] Updated bootstrap --- bootstrap-salt.sh | 55 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 26b1522..2f20708 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1936,6 +1936,9 @@ __function_defined() { # process is finished so the script doesn't exit on a locked proc. #---------------------------------------------------------------------------------------------------------------------- __wait_for_apt(){ + ## DGM Debugging + set -v + set -x # Timeout set at 15 minutes WAIT_TIMEOUT=900 @@ -2007,6 +2010,10 @@ __temp_gpg_pub() { # PARAMETERS: url #---------------------------------------------------------------------------------------------------------------------- __apt_key_fetch() { + ## DGM Debugging + set -v + set -x + url=$1 tempfile="$(__temp_gpg_pub)" @@ -2049,6 +2056,10 @@ __rpm_import_gpg() { # DESCRIPTION: (DRY) yum install with noinput options #---------------------------------------------------------------------------------------------------------------------- __yum_install_noinput() { + ## DGM Debugging + set -v + set -x + if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then # We need to install one package at a time because --enablerepo=X disables ALL OTHER REPOS!!!! @@ -2673,6 +2684,10 @@ __install_pip_deps() { # PARAMETERS: py_exe #---------------------------------------------------------------------------------------------------------------------- __install_salt_from_repo_post_neon() { + ## DGM Debugging + set -v + set -x + _py_exe="$1" if [ "${_py_exe}" = "" ]; then @@ -3109,6 +3124,9 @@ install_ubuntu_git_deps() { } install_ubuntu_onedir_deps() { + ## DGM Debugging + set -v + set -x if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -4099,6 +4117,9 @@ install_fedora_check_services() { } install_fedora_onedir_deps() { + ## DGM Debugging + set -v + set -x if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 @@ -4280,13 +4301,15 @@ install_centos_stable_deps() { ## DGM __PACKAGES="yum-utils chkconfig procps-ng" ## DGM Trying original - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ### if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ### __PACKAGES="dnf-utils chkconfig" + ### else + ### __PACKAGES="yum-utils chkconfig" + ### fi - __PACKAGES="${__PACKAGES} procps" + ### __PACKAGES="${__PACKAGES} procps" + + __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4361,6 +4384,9 @@ install_centos_stable_post() { } install_centos_git_deps() { + ## DGM Debugging + set -v + set -x # First try stable deps then fall back to onedir deps if that one fails # if we're installing on a Red Hat based host that doesn't have the classic # package repos available. @@ -4471,6 +4497,9 @@ install_centos_git_post() { } install_centos_onedir_deps() { + ## DGM Debugging + set -v + set -x if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -4510,13 +4539,15 @@ install_centos_onedir_deps() { ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir ## DGM trying original - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - __PACKAGES="dnf-utils chkconfig" - else - __PACKAGES="yum-utils chkconfig" - fi + ## if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then + ## __PACKAGES="dnf-utils chkconfig" + ## else + ## __PACKAGES="yum-utils chkconfig" + ## fi - __PACKAGES="${__PACKAGES} procps" + ## __PACKAGES="${__PACKAGES} procps" + + __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 __yum_install_noinput "${__PACKAGES}" || return 1 From 289a5a2d0b73d6bbcb85cfca8e21a8ece9390de3 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 27 Jun 2024 11:34:44 -0600 Subject: [PATCH 33/80] Checking quotes issue on input to OS install command --- bootstrap-salt.sh | 123 +++++++++++++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 39 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2f20708..538827e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1942,10 +1942,15 @@ __wait_for_apt(){ # Timeout set at 15 minutes WAIT_TIMEOUT=900 + ## DGM see if sync'ing the clocks helps + hwclock -s + # Run our passed in apt command "${@}" 2>"$APT_ERR" APT_RETURN=$? + echoerror"DGM __wait_for_apt APT_ERR: $APT_ERR" + # Make sure we're not waiting on a lock while [ "$APT_RETURN" -ne 0 ] && grep -q '^E: Could not get lock' "$APT_ERR"; do echoinfo "Aware of the lock. Patiently waiting $WAIT_TIMEOUT more seconds..." @@ -1971,7 +1976,8 @@ __wait_for_apt(){ # PARAMETERS: packages #---------------------------------------------------------------------------------------------------------------------- __apt_get_install_noinput() { - __wait_for_apt apt-get install -y -o DPkg::Options::=--force-confold "${@}"; return $? + ## DGM __wait_for_apt apt-get install -y -o DPkg::Options::=--force-confold "${@}"; return $? + __wait_for_apt apt-get install -V -y -o DPkg::Options::=--force-confold "${@}"; return $? } # ---------- end of function __apt_get_install_noinput ---------- @@ -1980,7 +1986,8 @@ __apt_get_install_noinput() { # DESCRIPTION: (DRY) apt-get upgrade with noinput options #---------------------------------------------------------------------------------------------------------------------- __apt_get_upgrade_noinput() { - __wait_for_apt apt-get upgrade -y -o DPkg::Options::=--force-confold; return $? + ## DGM __wait_for_apt apt-get upgrade -y -o DPkg::Options::=--force-confold; return $? + __wait_for_apt apt-get upgrade -V -y -o DPkg::Options::=--force-confold; return $? } # ---------- end of function __apt_get_upgrade_noinput ---------- @@ -3176,7 +3183,8 @@ install_ubuntu_stable() { fi # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -3227,7 +3235,8 @@ install_ubuntu_onedir() { fi # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -3424,7 +3433,8 @@ __install_saltstack_debian_repository() { fi # shellcheck disable=SC2086,SC2090 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 # amd64 is just a part of repository URI SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" @@ -3458,7 +3468,8 @@ __install_saltstack_debian_onedir_repository() { fi # shellcheck disable=SC2086,SC2090 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 # amd64 is just a part of repository URI SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${ONEDIR_REV}/" @@ -3508,7 +3519,8 @@ install_debian_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __check_dpkg_architecture || return 1 @@ -3518,7 +3530,8 @@ install_debian_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -3563,7 +3576,8 @@ install_debian_onedir_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __check_dpkg_architecture || return 1 @@ -3573,7 +3587,8 @@ install_debian_onedir_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -3609,7 +3624,8 @@ install_debian_git_deps() { __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" echodebug "install_debian_git_deps() Installing ${__PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -3633,7 +3649,8 @@ install_debian_stable() { fi # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -3681,7 +3698,8 @@ install_debian_onedir() { fi # shellcheck disable=SC2086 - __apt_get_install_noinput "${__PACKAGES}" || return 1 + ## __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -3869,7 +3887,8 @@ install_fedora_deps() { fi # shellcheck disable=SC2086 - __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 + ## DGM __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 + __dnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 return 0 } @@ -3903,7 +3922,8 @@ install_fedora_stable() { fi # shellcheck disable=SC2086 - __dnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 + __dnf_install_noinput ${__PACKAGES} || return 1 __python="python3" if ! __check_command_exists python3; then @@ -3963,7 +3983,8 @@ install_fedora_git_deps() { if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 - __dnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 + __dnf_install_noinput ${__PACKAGES} || return 1 __PACKAGES="" fi @@ -4012,7 +4033,8 @@ install_fedora_git_deps() { __PACKAGES="${__PACKAGES} gcc-c++" fi # shellcheck disable=SC2086 - __dnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 + __dnf_install_noinput ${__PACKAGES} || return 1 fi # Let's trigger config_salt() @@ -4155,12 +4177,14 @@ install_fedora_onedir_deps() { __PACKAGES="dnf-utils chkconfig procps-ng" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -4188,7 +4212,8 @@ install_fedora_onedir() { fi # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -4312,12 +4337,14 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -4340,7 +4367,8 @@ install_centos_stable() { fi # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 # Workaround for 3.11 broken on CentOS Stream 8.x # Re-install Python 3.6 @@ -4429,7 +4457,8 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -4550,12 +4579,14 @@ install_centos_onedir_deps() { __PACKAGES="yum-utils chkconfig procps-ng" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -4578,7 +4609,8 @@ install_centos_onedir() { fi # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 return 0 } @@ -5001,7 +5033,9 @@ install_oracle_linux_stable_deps() { if [ "${_EPEL_REPOS_INSTALLED}" -eq "$BS_FALSE" ]; then _EPEL_REPO="oracle-epel-release-el${DISTRO_MAJOR_VERSION}" if ! rpm -q "${_EPEL_REPO}" > /dev/null; then - __yum_install_noinput "${_EPEL_REPO}" + # shellcheck disable=SC2086 + ## DGM __yum_install_noinput "${_EPEL_REPO}" + __yum_install_noinput ${_EPEL_REPO} fi _EPEL_REPOS_INSTALLED="$BS_TRUE" fi @@ -5559,7 +5593,8 @@ install_amazon_linux_ami_2_git_deps() { if ! __check_command_exists "${PIP_EXE}"; then # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 fi if ! __check_command_exists git; then @@ -5570,7 +5605,8 @@ install_amazon_linux_ami_2_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -5632,7 +5668,8 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -5690,7 +5727,8 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -5759,7 +5797,8 @@ install_amazon_linux_ami_2023_git_deps() { if ! __check_command_exists "${PIP_EXE}"; then # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 fi if ! __check_command_exists git; then @@ -5770,7 +5809,8 @@ install_amazon_linux_ami_2023_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" # shellcheck disable=SC2086 - __yum_install_noinput "${__PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 + __yum_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -5830,7 +5870,8 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -6196,7 +6237,8 @@ install_photon_deps() { fi # shellcheck disable=SC2086 - __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 + ## DGM __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 + __tdnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 return 0 } @@ -6244,7 +6286,8 @@ install_photon_git_deps() { __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" # shellcheck disable=SC2086 - __tdnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 + __tdnf_install_noinput ${__PACKAGES} || return 1 if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then # Need newer version of setuptools on Photon @@ -6374,12 +6417,14 @@ install_photon_onedir_deps() { __PACKAGES="procps-ng" # shellcheck disable=SC2086 - __tdnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 + __tdnf_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __tdnf_install_noinput "${_EXTRA_PACKAGES}" || return 1 + ## DGM __tdnf_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __tdnf_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 From 8ac6918056a7c4fe4dd3d0f7fedafa5315c82249 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 27 Jun 2024 14:18:42 -0600 Subject: [PATCH 34/80] Updated bootstrap, more quoting handling and other changes --- CHANGELOG.md | 1 + bootstrap-salt.sh | 164 ++++++++++++++++++++++------------------------ kitchen.yml | 8 ++- 3 files changed, 83 insertions(+), 90 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f32d61f..b3a4994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Removed support for EOL Salt releases, pre-3006 - Added support for new OS's, for example: Ubuntu 24.04, Debian 12 - Updated to minimum Python 3.10 version from 3.9 +- Removed '-y' option which was experimental and only on RHEL 7 or less which are now EOL **Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.06.XX diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 538827e..4d1a39d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -271,7 +271,7 @@ _REPO_URL="repo.saltproject.io" _ONEDIR_DIR="salt" _ONEDIR_NIGHTLY_DIR="salt-dev/${_ONEDIR_DIR}" _PY_EXE="python3" -_INSTALL_PY="$BS_FALSE" +## DGM _INSTALL_PY="$BS_FALSE" ## DGM _TORNADO_MAX_PY3_VERSION="5.0" _POST_NEON_INSTALL=$BS_FALSE _MINIMUM_PIP_VERSION="9.0.1" @@ -410,19 +410,20 @@ __usage() { Python 2.7 is no longer supported. Fedora git installation, CentOS 8, Ubuntu 20.04 support python3. -X Do not start daemons after installation - -y Installs a different python version on host. Currently this has only been - tested with CentOS 7 and is considered experimental. This will install the - ius repo on the box if disable repo is false. This must be used in conjunction - with -x . For example: - sh bootstrap.sh -P -y -x python3.8 git v3006.3 - The above will install python38 and install the git version of salt using the - python3.8 executable. This only works for git and pip installations. EOT } # ---------- end of function __usage ---------- +## DGM -y Installs a different python version on host. Currently this has only been +## DGM tested with CentOS 7 and is considered experimental. This will install the +## DGM ius repo on the box if disable repo is false. This must be used in conjunction +## DGM with -x . For example: +## DGM sh bootstrap.sh -P -y -x python3.8 git v3006.3 +## DGM The above will install python38 and install the git version of salt using the +## DGM python3.8 executable. This only works for git and pip installations. -while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt +## DGM while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt +while getopts ':hvnDc:g:Gx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt do case "${opt}" in @@ -468,7 +469,6 @@ do q ) _QUIET_GIT_INSTALLATION=$BS_TRUE ;; Q ) _QUICK_START=$BS_TRUE ;; x ) _PY_EXE="$OPTARG" ;; - y ) _INSTALL_PY="$BS_TRUE" ;; \?) echo echoerror "Option does not exist : $OPTARG" @@ -480,6 +480,7 @@ do done shift $((OPTIND-1)) +## DGM y ) _INSTALL_PY="$BS_TRUE" ;; # Define our logging file and pipe paths LOGFILE="/tmp/$( echo "$__ScriptName" | sed s/.sh/.log/g )" @@ -2741,7 +2742,8 @@ EOM if ! ${_py_exe} -c "$CHECK_PIP_VERSION_SCRIPT"; then # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip" echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION}'" - ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" + ## DGM ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" + ${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} -v "pip>=${_MINIMUM_PIP_VERSION}" sleep 1 echodebug "PATH: ${PATH}" _pip_cmd="pip${_py_version}" @@ -2767,7 +2769,8 @@ EOM fi echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" - ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" + ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" + ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" echoinfo "Installing salt using ${_py_exe}" cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -2775,11 +2778,13 @@ EOM mkdir /tmp/git/deps echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" - ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) + ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) + ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" - ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 + ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 + ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 rm -f /tmp/git/deps/* echoinfo "Building Salt Python Wheel" @@ -2797,8 +2802,10 @@ EOM echoinfo "Installing Built Salt Wheel" ${_pip_cmd} uninstall --yes salt 2>/dev/null || true echodebug "Running '${_pip_cmd} install --no-deps --force-reinstall ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'" + + ## DGM "${_POST_NEON_PIP_INSTALL_ARGS}" \ ${_pip_cmd} install --no-deps --force-reinstall \ - "${_POST_NEON_PIP_INSTALL_ARGS}" \ + ${_POST_NEON_PIP_INSTALL_ARGS} \ --global-option="--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" \ /tmp/git/deps/salt*.whl || return 1 @@ -3097,6 +3104,10 @@ install_ubuntu_stable_deps() { } install_ubuntu_git_deps() { + ## DGM Debugging + set -v + set -x + __wait_for_apt apt-get update || return 1 if ! __check_command_exists git; then @@ -3202,6 +3213,14 @@ install_ubuntu_git() { return 1 fi + ## DGM this original code was then negated to "" originally, why was it not removed ? + ## DGM # We can use --prefix on debian based ditributions + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM else + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM fi + _POST_NEON_PIP_INSTALL_ARGS="" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -3630,7 +3649,17 @@ install_debian_git_deps() { return 0 } +install_debian_11_git_deps() { + install_debian_git_deps || return 1 + return 0 +} + +install_debian_12_git_deps() { + + install_debian_git_deps || return 1 + return 0 +} install_debian_stable() { __PACKAGES="" @@ -3665,7 +3694,15 @@ install_debian_git() { fi # We can use --prefix on debian based ditributions - _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM this original code was then negated to "" originally, why was it not removed ? + ## DGM # We can use --prefix on debian based ditributions + ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM else + ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" + ## DGM fi + + _POST_NEON_PIP_INSTALL_ARGS="" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -3990,52 +4027,13 @@ install_fedora_git_deps() { __git_clone_and_checkout || return 1 - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - __PACKAGES="${__PACKAGES} ca-certificates" - fi - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr" - fi - - install_fedora_deps || return 1 - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - if __check_command_exists python3; then - __python="python3" - fi - elif [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - ## DGM how did that get set - echoerror "Python 2 is no longer supported, only Py3 packages" - return 1 - ## DGM if __check_command_exists python2; then - ## DGM __python="python2" - ## DGM fi - else - if ! __check_command_exists python; then - echoerror "Unable to find a python binary?!" - return 1 - fi - # Let's hope it's the right one - ## TBD DGM check if Fedora has made python equiv. to python3 - __python="python" - fi - - grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" | while IFS=' - ' read -r dep; do - echodebug "Running '${__python}' -m pip install '${dep}'" - "${__python}" -m pip install "${dep}" || return 1 - done - else - __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - if [ "${DISTRO_VERSION}" -ge 35 ]; then - __PACKAGES="${__PACKAGES} gcc-c++" - fi - # shellcheck disable=SC2086 - ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 - __dnf_install_noinput ${__PACKAGES} || return 1 + __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + if [ "${DISTRO_VERSION}" -ge 35 ]; then + __PACKAGES="${__PACKAGES} gcc-c++" fi + # shellcheck disable=SC2086 + ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 + __dnf_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -4415,6 +4413,7 @@ install_centos_git_deps() { ## DGM Debugging set -v set -x + # First try stable deps then fall back to onedir deps if that one fails # if we're installing on a Red Hat based host that doesn't have the classic # package repos available. @@ -4436,25 +4435,14 @@ install_centos_git_deps() { __PACKAGES="" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - # Packages are named python3- - PY_PKG_VER=3 - __PACKAGES="${__PACKAGES} python3" - else - # Packages are named python36- - PY_PKG_VER=36 - __PACKAGES="${__PACKAGES} python36" - fi + # Packages are named python3- + PY_PKG_VER=3 + __PACKAGES="${__PACKAGES} python3" else echoerror "Python 2 is no longer supported, only Python 3" return 1 fi - if [ "${_INSTALL_PY}" -eq "${BS_TRUE}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then - # Install Python if "-y" was passed in. - __install_python || return 1 - fi - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -5975,13 +5963,6 @@ install_arch_linux_stable_deps() { } install_arch_linux_git_deps() { - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then - echoerror "Python 2 is no longer supported, only Python 3" - return 1 - else - PY_PKG_VER="" - fi - install_arch_linux_stable_deps # Don't fail if un-installing python2-distribute threw an error @@ -5990,6 +5971,14 @@ install_arch_linux_git_deps() { fi __git_clone_and_checkout || return 1 + + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then + echoerror "Python 2 is no longer supported, only Python 3" + return 1 + else + PY_PKG_VER="" + fi + __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 pacman -Su --noconfirm --needed "${__PACKAGES}" @@ -6607,6 +6596,7 @@ install_opensuse_git_deps() { __git_clone_and_checkout || return 1 + # Check for Tumbleweed if [ "${DISTRO_MAJOR_VERSION}" -ge 20210101 ]; then __PACKAGES="python3-pip gcc-c++ python3-pyzmq-devel" else @@ -6818,11 +6808,6 @@ install_opensuse_15_stable_deps() { } install_opensuse_15_git_deps() { - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python version is no longer supported, only Python 3" - return 1 - fi - install_opensuse_15_stable_deps || return 1 if ! __check_command_exists git; then @@ -6831,6 +6816,11 @@ install_opensuse_15_git_deps() { __git_clone_and_checkout || return 1 + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi + PY_PKG_VER=3 __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" diff --git a/kitchen.yml b/kitchen.yml index 9bb4153..4e43c55 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -33,7 +33,8 @@ platforms: driver: provision_command: - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: almalinux-8 - name: amazon-2 @@ -61,7 +62,8 @@ platforms: image: quay.io/centos/centos:stream9 provision_command: - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + ## DGM - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: centos-stream8 driver: @@ -119,7 +121,7 @@ platforms: ## DGM - dnf -y install crypto-policies-scripts procps-ng ## DGM - update-crypto-policies --set DEFAULT:SHA1 - yum -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 + - update-crypto-policies - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 driver: From 74bae42128869d319f41504463aa2d1411a2267b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 27 Jun 2024 15:02:27 -0600 Subject: [PATCH 35/80] Adjusted keyring for Debian and Ubuntu --- bootstrap-salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4d1a39d..b7d1dd5 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2027,8 +2027,9 @@ __apt_key_fetch() { tempfile="$(__temp_gpg_pub)" __fetch_url "$tempfile" "$url" || return 1 - mkdir -p /etc/apt/keyrings || return 1 - cp -f "$tempfile" /etc/apt/keyrings/salt-archive-keyring-2023.gpg && chmod 644 /etc/apt/keyrings/salt-archive-keyring-2023.gpg || return 1 + ## DGM mkdir -p /etc/apt/keyrings || return 1 + ## DGM cp -f "$tempfile" /etc/apt/keyrings/salt-archive-keyring-2023.gpg && chmod 644 /etc/apt/keyrings/salt-archive-keyring-2023.gpg || return 1 + cp -f "$tempfile" /usr/share/keyrings/salt-archive-keyring.gpg && chmod 644 /usr/share/keyrings/salt-archive-keyring.gpg || return 1 rm -f "$tempfile" return 0 From 2feff7baa4f873ab94efe088d0ba7556ae50cbbb Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 28 Jun 2024 11:21:30 -0600 Subject: [PATCH 36/80] Updated testings --- bootstrap-salt.sh | 4 ++-- kitchen.yml | 26 ++++++++------------------ 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index b7d1dd5..fed127b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4333,7 +4333,7 @@ install_centos_stable_deps() { ### __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng" + __PACKAGES="yum-utils chkconfig procps-ng findutils" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4565,7 +4565,7 @@ install_centos_onedir_deps() { ## __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng" + __PACKAGES="yum-utils chkconfig procps-ng findutils" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 diff --git a/kitchen.yml b/kitchen.yml index 4e43c55..4d4b099 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -33,8 +33,8 @@ platforms: driver: provision_command: - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - update-crypto-policies + - update-crypto-policies --set DEFAULT:SHA1 + ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: almalinux-8 - name: amazon-2 @@ -62,8 +62,8 @@ platforms: image: quay.io/centos/centos:stream9 provision_command: - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - update-crypto-policies + - update-crypto-policies --set DEFAULT:SHA1 + ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: centos-stream8 driver: @@ -118,21 +118,12 @@ platforms: platform: centosstream run_command: /usr/lib/systemd/systemd provision_command: - ## DGM - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - yum -y install crypto-policies-scripts procps-ng - - update-crypto-policies + - dnf -y install crypto-policies-scripts procps-ng + - update-crypto-policies --set DEFAULT:SHA1 + ### DGM - yum -y install crypto-policies-scripts procps-ng + ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - driver: - platform: centosstream - run_command: /usr/lib/systemd/systemd - provision_command: - ## DGM - dnf -y install crypto-policies-scripts procps-ng - ## DGM - update-crypto-policies --set DEFAULT:SHA1 - - yum -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: oraclelinux-8 - name: ubuntu-22.04 - name: ubuntu-24.04 @@ -284,7 +275,6 @@ suites: - ubuntu-2004 - ubuntu-2204 - - name: quickstart provisioner: salt_bootstrap_options: -Q From 62b8a7341a0cd1525b8fc3e1a91aff9a325c03bb Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 28 Jun 2024 17:04:56 -0600 Subject: [PATCH 37/80] Updates quotes to match develop branch --- bootstrap-salt.sh | 1280 ++++++++++++++++++++++----------------------- 1 file changed, 639 insertions(+), 641 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index fed127b..64056ba 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -133,7 +133,7 @@ __check_pip_allowed() { _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" fi - if [ "$_PIP_ALLOWED" -eq "$BS_FALSE" ]; then + if [ "$_PIP_ALLOWED" -eq $BS_FALSE ]; then echoerror "$_PIP_ALLOWED_ERROR_MSG" __usage exit 1 @@ -273,7 +273,6 @@ _ONEDIR_NIGHTLY_DIR="salt-dev/${_ONEDIR_DIR}" _PY_EXE="python3" ## DGM _INSTALL_PY="$BS_FALSE" ## DGM _TORNADO_MAX_PY3_VERSION="5.0" -_POST_NEON_INSTALL=$BS_FALSE _MINIMUM_PIP_VERSION="9.0.1" _MINIMUM_SETUPTOOLS_VERSION="9.1" _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr" @@ -321,13 +320,15 @@ __usage() { - ${__ScriptName} stable 3006.1 - ${__ScriptName} testing - ${__ScriptName} git - - ${__ScriptName} git 3006.4 - - ${__ScriptName} git v3006.6 + - ${__ScriptName} git 3006.7 + - ${__ScriptName} git v3006.8 + - ${__ScriptName} git 3007.1 + - ${__ScriptName} git v3007.1 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 - ${__ScriptName} onedir - ${__ScriptName} onedir 3006 - ${__ScriptName} onedir_rc - - ${__ScriptName} onedir_rc 3006 + - ${__ScriptName} onedir_rc 3008 Options: @@ -527,7 +528,7 @@ __exit_cleanup() { EXIT_CODE=$? if [ "$ITYPE" = "git" ] && [ -d "${_SALT_GIT_CHECKOUT_DIR}" ]; then - if [ "$_KEEP_TEMP_FILES" -eq "$BS_FALSE" ]; then + if [ $_KEEP_TEMP_FILES -eq $BS_FALSE ]; then # Clean up the checked out repository echodebug "Cleaning up the Salt Temporary Git Repository" # shellcheck disable=SC2164 @@ -556,7 +557,7 @@ __exit_cleanup() { # shellcheck disable=SC2009 TEE_PID=$(ps ax | grep tee | grep "$LOGFILE" | awk '{print $1}') - [ "$TEE_PID" = "" ] && exit "$EXIT_CODE" + [ "$TEE_PID" = "" ] && exit $EXIT_CODE echodebug "Killing logging pipe tee's with pid(s): $TEE_PID" @@ -565,7 +566,7 @@ __exit_cleanup() { __trap_errors() { echoinfo "Errors Trapped: $EXIT_CODE" # Exit with the "original" exit code, not the trapped code - exit "$EXIT_CODE" + exit $EXIT_CODE } trap "__trap_errors" INT ABRT QUIT TERM @@ -573,7 +574,7 @@ __exit_cleanup() { kill -s TERM "$TEE_PID" # In case the 127 errno is not triggered, exit with the "original" exit code - exit "$EXIT_CODE" + exit $EXIT_CODE } trap "__exit_cleanup" EXIT INT @@ -768,9 +769,9 @@ fi # Default to Python 3, no longer support for Python 2 PY_PKG_VER=3 -__PY_VERSION_REPO="py3" _PY_PKG_VER="python3" _PY_MAJOR_VERSION="3" +__PY_VERSION_REPO="py3" # Check if we're installing via a different Python executable and set major version variables if [ -n "$_PY_EXE" ]; then @@ -795,9 +796,6 @@ if [ -n "$_PY_EXE" ]; then if [ "$_PY_EXE" != "python3" ]; then echoinfo "Detected -x option. Using $_PY_EXE to install Salt." fi -else - _PY_PKG_VER="python3" - _PY_MAJOR_VERSION="3" fi # If the configuration directory or archive does not exist, error out @@ -814,7 +812,7 @@ fi # -a and -V only work from git if [ "$ITYPE" != "git" ]; then - if [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then + if [ "$_PIP_ALL" -eq $BS_TRUE ]; then echoerror "Pip installing all python packages with -a is only possible when installing Salt via git" exit 1 fi @@ -829,14 +827,14 @@ if [ "$_CUSTOM_REPO_URL" != "null" ]; then _REPO_URL="$_CUSTOM_REPO_URL" # Check for -r since -R is being passed. Set -r with a warning. - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then + if [ "$_DISABLE_REPOS" -eq $BS_FALSE ]; then echowarn "Detected -R option. No other repositories will be configured when -R is used. Setting -r option to True." - _DISABLE_REPOS="$BS_TRUE" + _DISABLE_REPOS=$BS_TRUE fi fi # Check the _DISABLE_SSL value and set HTTP or HTTPS. -if [ "$_DISABLE_SSL" -eq "$BS_TRUE" ]; then +if [ "$_DISABLE_SSL" -eq $BS_TRUE ]; then HTTP_VAL="http" else HTTP_VAL="https" @@ -1006,9 +1004,7 @@ __derive_debian_numeric_version() { INPUT_VERSION="$(cat /etc/debian_version)" fi if [ -z "$NUMERIC_VERSION" ]; then - if [ "$INPUT_VERSION" = "buster/sid" ]; then - NUMERIC_VERSION=$(__parse_version_string "10.0") - elif [ "$INPUT_VERSION" = "bullseye/sid" ]; then + if [ "$INPUT_VERSION" = "bullseye/sid" ]; then NUMERIC_VERSION=$(__parse_version_string "11.0") elif [ "$INPUT_VERSION" = "bookworm/sid" ]; then NUMERIC_VERSION=$(__parse_version_string "12.0") @@ -1269,7 +1265,7 @@ __install_python() { __PACKAGES="$_PY_PKG_VER" - if [ "${_DISABLE_REPOS}" -eq "${BS_FALSE}" ]; then + if [ ${_DISABLE_REPOS} -eq ${BS_FALSE} ]; then echoinfo "Attempting to install a repo to help provide a separate python package" echoinfo "$DISTRO_NAME_L" case "$DISTRO_NAME_L" in @@ -1392,7 +1388,8 @@ __check_dpkg_architecture() { fi __REPO_ARCH="$DPKG_ARCHITECTURE" - __REPO_ARCH_DEB='deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg]' + ## DGM __REPO_ARCH_DEB='deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg]' + __REPO_ARCH_DEB='deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg]' __return_code=0 case $DPKG_ARCHITECTURE in @@ -1405,15 +1402,13 @@ __check_dpkg_architecture() { error_msg="" ;; "arm64") - error_msg="" + # Saltstack official repository has full arm64 support since 3006 + __REPO_ARCH="arm64" + __REPO_ARCH_DEB="deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=$__REPO_ARCH]" ;; "armhf") - if [ "$DISTRO_NAME_L" = "ubuntu" ] || [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then - error_msg="Support for armhf packages at $_REPO_URL is limited to Debian/Raspbian 8 platforms." - __return_code=1 - else - error_msg="" - fi + error_msg="$_REPO_URL doesn't have packages for your system architecture: $DPKG_ARCHITECTURE." + __return_code=1 ;; *) error_msg="$_REPO_URL doesn't have packages for your system architecture: $DPKG_ARCHITECTURE." @@ -1609,7 +1604,7 @@ __check_end_of_life_versions() { debian) # Debian versions below 11 are not supported ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 9 ]; then - if [ "$DISTRO_MAJOR_VERSION" -le 10 ]; then + if [ "$DISTRO_MAJOR_VERSION" -lt 11 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.debian.org/DebianReleases" @@ -1862,7 +1857,7 @@ if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$_VIRTUALENV_DIR" != "null" ]; then fi # Only Ubuntu has support for pip installing all packages -if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then +if [ "${DISTRO_NAME_L}" != "ubuntu" ] && [ $_PIP_ALL -eq $BS_TRUE ]; then echoerror "${DISTRO_NAME} does not have -a support" exit 1 fi @@ -1870,14 +1865,12 @@ fi if [ "$ITYPE" = "git" ]; then if [ "${GIT_REV}" = "master" ]; then - _POST_NEON_INSTALL=$BS_TRUE __TAG_REGEX_MATCH="MATCH" else case ${OS_NAME_L} in darwin ) __NEW_VS_TAG_REGEX_MATCH=$(echo "${GIT_REV}" | sed -E 's/^(v?3[0-9]{3}(\.[0-9]{1,2})?).*$/MATCH/') if [ "$__NEW_VS_TAG_REGEX_MATCH" = "MATCH" ]; then - _POST_NEON_INSTALL=$BS_TRUE __TAG_REGEX_MATCH="${__NEW_VS_TAG_REGEX_MATCH}" echodebug "Post Neon Tag Regex Match On: ${GIT_REV}" else @@ -1888,7 +1881,6 @@ if [ "$ITYPE" = "git" ]; then * ) __NEW_VS_TAG_REGEX_MATCH=$(echo "${GIT_REV}" | sed 's/^.*\(v\?3[[:digit:]]\{3\}\(\.[[:digit:]]\{1,2\}\)\?\).*$/MATCH/') if [ "$__NEW_VS_TAG_REGEX_MATCH" = "MATCH" ]; then - _POST_NEON_INSTALL=$BS_TRUE __TAG_REGEX_MATCH="${__NEW_VS_TAG_REGEX_MATCH}" echodebug "Post Neon Tag Regex Match On: ${GIT_REV}" else @@ -1968,7 +1960,7 @@ __wait_for_apt(){ fi done - return "$APT_RETURN" + return $APT_RETURN } #--- FUNCTION ------------------------------------------------------------------------------------------------------- @@ -2008,7 +2000,7 @@ __temp_gpg_pub() { tempfile="/tmp/salt-gpg-$$.pub" fi - echo "$tempfile" + echo $tempfile } # ----------- end of function __temp_gpg_pub ----------- @@ -2253,11 +2245,11 @@ __copyfile() { # The destination file does not exist, copy echodebug "Copying $sfile to $dfile" cp "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -eq $BS_TRUE ]; then # The destination exist and we're overwriting echodebug "Overwriting $dfile with $sfile" cp -f "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -ne $BS_TRUE ]; then echodebug "Not overwriting $dfile with $sfile" fi return 0 @@ -2283,7 +2275,7 @@ __movefile() { exit 1 fi - if [ "$_KEEP_TEMP_FILES" -eq "$BS_TRUE" ]; then + if [ "$_KEEP_TEMP_FILES" -eq $BS_TRUE ]; then # We're being told not to move files, instead copy them so we can keep # them around echodebug "Since BS_KEEP_TEMP_FILES=1 we're copying files instead of moving them" @@ -2309,11 +2301,11 @@ __movefile() { # The destination file does not exist, move echodebug "Moving $sfile to $dfile" mv "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -eq $BS_TRUE ]; then # The destination exist and we're overwriting echodebug "Overriding $dfile with $sfile" mv -f "$sfile" "$dfile" || return 1 - elif [ -f "$dfile" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then + elif [ -f "$dfile" ] && [ "$overwrite" -ne $BS_TRUE ]; then echodebug "Not overriding $dfile with $sfile" fi @@ -2359,11 +2351,11 @@ __linkfile() { # The destination file does not exist, create link echodebug "Creating $linkname symlink pointing to $sfile" ln -s "$sfile" "$linkname" || return 1 - elif [ -e "$linkname" ] && [ "$overwrite" -eq "$BS_TRUE" ]; then + elif [ -e "$linkname" ] && [ "$overwrite" -eq $BS_TRUE ]; then # The destination exist and we're overwriting echodebug "Overwriting $linkname symlink to point on $sfile" ln -sf "$sfile" "$linkname" || return 1 - elif [ -e "$linkname" ] && [ "$overwrite" -ne "$BS_TRUE" ]; then + elif [ -e "$linkname" ] && [ "$overwrite" -ne $BS_TRUE ]; then echodebug "Not overwriting $linkname symlink to point on $sfile" fi done @@ -2569,7 +2561,7 @@ __check_services_openrc() { __create_virtualenv() { if [ ! -d "$_VIRTUALENV_DIR" ]; then echoinfo "Creating virtualenv ${_VIRTUALENV_DIR}" - if [ "$_PIP_ALL" -eq "$BS_TRUE" ]; then + if [ "$_PIP_ALL" -eq $BS_TRUE ]; then virtualenv --no-site-packages "${_VIRTUALENV_DIR}" || return 1 else virtualenv --system-site-packages "${_VIRTUALENV_DIR}" || return 1 @@ -2599,21 +2591,20 @@ __activate_virtualenv() { #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __install_pip_pkgs # DESCRIPTION: Return 0 or 1 if successfully able to install pip packages. Can provide a different python version to -# install pip packages with. If $py_ver is not specified it will use the default python3 version. +# install pip packages with. If $py_ver is not specified it will use the default python version. # PARAMETERS: pkgs, py_ver, upgrade #---------------------------------------------------------------------------------------------------------------------- __install_pip_pkgs() { _pip_pkgs="$1" _py_exe="$2" + _py_pkg=$(echo "$_py_exe" | sed -E "s/\\.//g") + _pip_cmd="${_py_exe} -m pip" if [ "${_py_exe}" = "" ]; then _py_exe='python3' fi - _py_pkg=$(echo "$_py_exe" | sed -E "s/\\.//g") - _pip_cmd="${_py_exe} -m pip" - __check_pip_allowed # Install pip and pip dependencies @@ -2677,7 +2668,7 @@ __install_pip_deps() { fi __PIP_PACKAGES='' - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # shellcheck disable=SC2089 __PIP_PACKAGES="${__PIP_PACKAGES} 'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'" fi @@ -2729,7 +2720,7 @@ import sys try: import pip installed_pip_version=tuple([int(part.strip()) for part in pip.__version__.split('.') if part.isdigit()]) - desired_pip_version=($(echo "${_MINIMUM_PIP_VERSION}" | sed 's/\./, /g' )) + desired_pip_version=($(echo ${_MINIMUM_PIP_VERSION} | sed 's/\./, /g' )) if installed_pip_version < desired_pip_version: print('Desired pip version {!r} > Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version)))) sys.exit(1) @@ -2790,7 +2781,7 @@ EOM echoinfo "Building Salt Python Wheel" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then SETUP_PY_INSTALL_ARGS="-v" fi @@ -3012,13 +3003,13 @@ __install_saltstack_ubuntu_onedir_repository() { fi echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - __apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 + __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } install_ubuntu_deps() { - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then + if [ "$_DISABLE_REPOS" -eq $BS_FALSE ]; then # Install add-apt-repository if ! __check_command_exists add-apt-repository; then __apt_get_install_noinput software-properties-common || return 1 @@ -3037,16 +3028,13 @@ install_ubuntu_deps() { fi if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] && [ -z "$_PY_EXE" ]; then - echoerror "Python 2 is no longer supported, only Python 3" - return 1 + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}" fi if [ "$_VIRTUALENV_DIR" != "null" ]; then - __PACKAGES="${__PACKAGES} python-virtualenv" - # TBD DGM - implies Python 2, need check - echoerror "Python 2 is no longer supported, only Python 3" - return 1 + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-virtualenv" fi + # Need python-apt for managing packages via Salt __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt" @@ -3072,7 +3060,7 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3081,8 +3069,8 @@ install_ubuntu_stable_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then - if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style ## also apt-key is deprecated if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then @@ -3115,7 +3103,7 @@ install_ubuntu_git_deps() { __apt_get_install_noinput git-core || return 1 fi - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __apt_get_install_noinput ca-certificates fi @@ -3146,7 +3134,7 @@ install_ubuntu_onedir_deps() { ## DGM Debugging set -v set -x - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3155,11 +3143,11 @@ install_ubuntu_onedir_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then - if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc. ## also apt-key is deprecated - if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && @@ -3181,16 +3169,16 @@ install_ubuntu_onedir_deps() { install_ubuntu_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -3241,16 +3229,16 @@ install_ubuntu_git() { install_ubuntu_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -3264,23 +3252,23 @@ install_ubuntu_onedir() { install_ubuntu_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then # Using systemd - /bin/systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( - /bin/systemctl preset "salt-$fname.service" > /dev/null 2>&1 && - /bin/systemctl enable "salt-$fname.service" > /dev/null 2>&1 + /bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( + /bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && + /bin/systemctl enable salt-$fname.service > /dev/null 2>&1 ) sleep 1 /bin/systemctl daemon-reload - elif [ -f "/etc/init.d/salt-$fname" ]; then - update-rc.d "salt-$fname defaults" + elif [ -f /etc/init.d/salt-$fname ]; then + update-rc.d salt-$fname defaults fi done @@ -3290,11 +3278,11 @@ install_ubuntu_stable_post() { install_ubuntu_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -3307,23 +3295,23 @@ install_ubuntu_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload elif [ -f /sbin/initctl ]; then _upstart_conf="/etc/init/salt-$fname.conf" # We have upstart support echodebug "There's upstart support" - if [ ! -f "$_upstart_conf" ]; then + if [ ! -f $_upstart_conf ]; then # upstart does not know about our service, let's copy the proper file echowarn "Upstart does not appear to know about salt-$fname" echodebug "Copying ${_SERVICE_DIR}/salt-$fname.upstart to $_upstart_conf" __copyfile "${_SERVICE_DIR}/salt-${fname}.upstart" "$_upstart_conf" # Set service to know about virtualenv if [ "${_VIRTUALENV_DIR}" != "null" ]; then - echo "SALT_USE_VIRTUALENV=${_VIRTUALENV_DIR}" > "/etc/default/salt-${fname}" + echo "SALT_USE_VIRTUALENV=${_VIRTUALENV_DIR}" > /etc/default/salt-${fname} fi /sbin/initctl reload-configuration || return 1 fi @@ -3332,12 +3320,12 @@ install_ubuntu_git_post() { echodebug "There's NO upstart support!?" echodebug "Copying ${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init to /etc/init.d/salt-$fname" __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init" "/etc/init.d/salt-$fname" - chmod +x "/etc/init.d/salt-$fname" + chmod +x /etc/init.d/salt-$fname # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - update-rc.d "salt-$fname" defaults + update-rc.d salt-$fname defaults else echoerror "Neither upstart nor init.d was setup for salt-$fname" fi @@ -3347,7 +3335,7 @@ install_ubuntu_git_post() { } install_ubuntu_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return # Ensure upstart configs / systemd units are loaded if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then @@ -3358,21 +3346,21 @@ install_ubuntu_restart_daemons() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then echodebug "There's systemd support while checking salt-$fname" - systemctl stop "salt-$fname" > /dev/null 2>&1 - systemctl start "salt-$fname.service" && continue + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue # We failed to start the service, let's test the SysV code below echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi fi @@ -3380,22 +3368,22 @@ install_ubuntu_restart_daemons() { if [ -f /sbin/initctl ]; then echodebug "There's upstart support while checking salt-$fname" - if status "salt-$fname" 2>/dev/null | grep -q running; then - stop "salt-$fname" || (echodebug "Failed to stop salt-$fname" && return 1) + if status salt-$fname 2>/dev/null | grep -q running; then + stop salt-$fname || (echodebug "Failed to stop salt-$fname" && return 1) fi - start "salt-$fname" && continue + start salt-$fname && continue # We failed to start the service, let's test the SysV code below echodebug "Failed to start salt-$fname using Upstart" fi - if [ ! -f "/etc/init.d/salt-$fname" ]; then + if [ ! -f /etc/init.d/salt-$fname ]; then echoerror "No init.d support for salt-$fname was found" return 1 fi - "/etc/init.d/salt-$fname" stop > /dev/null 2>&1 - "/etc/init.d/salt-$fname" start + /etc/init.d/salt-$fname stop > /dev/null 2>&1 + /etc/init.d/salt-$fname start done return 0 @@ -3404,19 +3392,18 @@ install_ubuntu_restart_daemons() { install_ubuntu_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then __check_services_systemd salt-$fname || return 1 elif [ -f /etc/init.d/salt-$fname ]; then __check_services_debian salt-$fname || return 1 fi - done return 0 @@ -3456,7 +3443,6 @@ __install_saltstack_debian_repository() { ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 - # amd64 is just a part of repository URI SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" @@ -3504,7 +3490,7 @@ __install_saltstack_debian_onedir_repository() { } install_debian_deps() { - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3513,9 +3499,9 @@ install_debian_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3561,7 +3547,7 @@ install_debian_onedir_deps() { ## DGM Debugging set -v set -x - if [ "$_START_DAEMONS" -eq "$BS_FALSE" ]; then + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3570,9 +3556,9 @@ install_debian_onedir_deps() { __wait_for_apt apt-get update || return 1 - if [ "${_UPGRADE_SYS}" -eq "$BS_TRUE" ]; then + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq "$BS_TRUE" ]; then + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3619,7 +3605,7 @@ install_debian_git_pre() { __apt_get_install_noinput git || return 1 fi - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __apt_get_install_noinput ca-certificates fi @@ -3650,6 +3636,29 @@ install_debian_git_deps() { return 0 } +install_debian_stable() { + __PACKAGES="" + + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then + __PACKAGES="${__PACKAGES} salt-cloud" + fi + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then + __PACKAGES="${__PACKAGES} salt-master" + fi + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then + __PACKAGES="${__PACKAGES} salt-minion" + fi + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then + __PACKAGES="${__PACKAGES} salt-syndic" + fi + + # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 + + return 0 +} + install_debian_11_git_deps() { install_debian_git_deps || return 1 @@ -3662,29 +3671,6 @@ install_debian_12_git_deps() { return 0 } -install_debian_stable() { - __PACKAGES="" - - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then - __PACKAGES="${__PACKAGES} salt-cloud" - fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} salt-master" - fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} salt-minion" - fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then - __PACKAGES="${__PACKAGES} salt-syndic" - fi - - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - __apt_get_install_noinput ${__PACKAGES} || return 1 - - return 0 -} - install_debian_git() { if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} @@ -3719,19 +3705,29 @@ install_debian_git() { return 0 } +install_debian_11_git() { + install_debian_git || return 1 + return 0 +} + +install_debian_12_git() { + install_debian_git || return 1 + return 0 +} + install_debian_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -3746,10 +3742,10 @@ install_debian_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -3760,15 +3756,15 @@ install_debian_git_post() { # Configure SystemD for Debian 8 "Jessie" and later if [ -f /bin/systemctl ]; then - if [ ! -f "/lib/systemd/system/salt-${fname}.service" ] || \ - { [ -f "/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then + if [ ! -f /lib/systemd/system/salt-${fname}.service ] || \ + { [ -f /lib/systemd/system/salt-${fname}.service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]; }; then if [ -f "${_SERVICE_DIR}/salt-${fname}.service" ]; then __copyfile "${_SERVICE_DIR}/salt-${fname}.service" /lib/systemd/system __copyfile "${_SERVICE_DIR}/salt-${fname}.environment" "/etc/default/salt-${fname}" else # workaround before adding Debian-specific unit files to the Salt main repo __copyfile "${_SERVICE_DIR}/salt-${fname}.service" /lib/systemd/system - sed -i -e '/^Type/ s/notify/simple/' "/lib/systemd/system/salt-${fname}.service" + sed -i -e '/^Type/ s/notify/simple/' /lib/systemd/system/salt-${fname}.service fi fi @@ -3776,11 +3772,11 @@ install_debian_git_post() { [ "$fname" = "api" ] && continue /bin/systemctl enable "salt-${fname}.service" - SYSTEMD_RELOAD="$BS_TRUE" + SYSTEMD_RELOAD=$BS_TRUE # Install initscripts for Debian 7 "Wheezy" elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then + { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}" __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}" @@ -3807,29 +3803,29 @@ install_debian_2021_post() { } install_debian_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then # Debian 8 and above uses systemd - /bin/systemctl stop "salt-$fname" > /dev/null 2>&1 - /bin/systemctl start "salt-$fname.service" && continue - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + /bin/systemctl stop salt-$fname > /dev/null 2>&1 + /bin/systemctl start salt-$fname.service && continue + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi - elif [ -f "/etc/init.d/salt-$fname" ]; then + elif [ -f /etc/init.d/salt-$fname ]; then # Still in SysV init - "/etc/init.d/salt-$fname" stop > /dev/null 2>&1 - "/etc/init.d/salt-$fname" start + /etc/init.d/salt-$fname stop > /dev/null 2>&1 + /etc/init.d/salt-$fname start fi done } @@ -3837,17 +3833,17 @@ install_debian_restart_daemons() { install_debian_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - __check_services_systemd "salt-$fname" || return 1 - elif [ -f "/etc/init.d/salt-$fname" ]; then - __check_services_debian "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 + elif [ -f /etc/init.d/salt-$fname ]; then + __check_services_debian salt-$fname || return 1 fi done return 0 @@ -3880,7 +3876,7 @@ __install_saltstack_fedora_onedir_repository() { REPO_FILE="/etc/yum.repos.d/salt.repo" - if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then + if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" @@ -3900,7 +3896,7 @@ __install_saltstack_fedora_onedir_repository() { } install_fedora_deps() { - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then dnf -y update || return 1 fi @@ -3915,7 +3911,6 @@ install_fedora_deps() { ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after ## DGM but find it on 8 and 9 Centos Stream - ## DGM __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip python${PY_PKG_VER}-m2crypto python${PY_PKG_VER}-pyyaml" @@ -3946,16 +3941,16 @@ install_fedora_stable() { fi __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud${__SALT_VERSION}" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master${__SALT_VERSION}" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion${__SALT_VERSION}" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" fi @@ -3963,28 +3958,28 @@ install_fedora_stable() { ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} || return 1 - __python="python3" + ## DGM __python="python3" if ! __check_command_exists python3; then echoerror "Could not find a python3 binary?!" return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_FALSE" ]; then - __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" - __installed_tornado_rpm=$(rpm -qa | grep "python${PY_PKG_VER}-tornado") - if [ -n "${__installed_tornado_rpm}" ]; then - echodebug "Removing system package ${__installed_tornado_rpm}" - rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 - fi - __get_site_packages_dir_code=$(cat << EOM -import site -print([d for d in site.getsitepackages() if d.startswith('/usr/lib/python')][0]) -EOM -) - __target_path=$(${__python} -c "${__get_site_packages_dir_code}") - echodebug "Running '${__python}' -m pip install --target ${__target_path} 'tornado<5.0'" - "${__python}" -m pip install --target "${__target_path}" "tornado<5" || return 1 - fi +## DGM if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then +## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" +## DGM __installed_tornado_rpm=$(rpm -qa | grep python${PY_PKG_VER}-tornado) +## DGM if [ -n "${__installed_tornado_rpm}" ]; then +## DGM echodebug "Removing system package ${__installed_tornado_rpm}" +## DGM rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 +## DGM fi +## DGM __get_site_packages_dir_code=$(cat << EOM +## DGM import site +## DGM print([d for d in site.getsitepackages() if d.startswith('/usr/lib/python')][0]) +## DGM EOM +## DGM ) +## DGM __target_path=$(${__python} -c "${__get_site_packages_dir_code}") +## DGM echodebug "Running '${__python}' -m pip install --target ${__target_path} 'tornado<5.0'" +## DGM "${__python}" -m pip install --target "${__target_path}" "tornado<5" || return 1 +## DGM fi return 0 } @@ -3992,14 +3987,14 @@ EOM install_fedora_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload done @@ -4028,10 +4023,7 @@ install_fedora_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - if [ "${DISTRO_VERSION}" -ge 35 ]; then - __PACKAGES="${__PACKAGES} gcc-c++" - fi + __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc gcc-c++" # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} || return 1 @@ -4055,27 +4047,19 @@ install_fedora_git() { return 1 fi - if [ "${_POST_NEON_INSTALL}" -eq "$BS_TRUE" ]; then - __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 - return 0 - fi - - if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 - else - ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 - fi + __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 return 0 + } install_fedora_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -4091,31 +4075,31 @@ install_fedora_git_post() { #fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload done } install_fedora_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ $_START_DAEMONS -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - systemctl stop "salt-$fname" > /dev/null 2>&1 - systemctl start "salt-$fname.service" && continue + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi done @@ -4124,14 +4108,14 @@ install_fedora_restart_daemons() { install_fedora_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_systemd "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 done return 0 @@ -4142,7 +4126,7 @@ install_fedora_onedir_deps() { set -v set -x - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -4192,21 +4176,21 @@ install_fedora_onedir_deps() { install_fedora_onedir() { - STABLE_REV="$ONEDIR_REV" + STABLE_REV=$ONEDIR_REV #install_fedora_stable || return 1 __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -4218,7 +4202,7 @@ install_fedora_onedir() { } install_fedora_onedir_post() { - STABLE_REV="$ONEDIR_REV" + STABLE_REV=$ONEDIR_REV install_fedora_stable_post || return 1 return 0 @@ -4260,7 +4244,7 @@ __install_saltstack_rhel_onedir_repository() { repo_file="/etc/yum.repos.d/salt.repo" - if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then + if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then cat <<_eof > "$repo_file" [saltstack] name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever @@ -4288,9 +4272,8 @@ _eof return 0 } - install_centos_stable_deps() { - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -4301,7 +4284,8 @@ install_centos_stable_deps() { fi if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then - __install_saltstack_rhel_onedir_repository || return 1 + echoerror "old-stable packages are no longer supported and are End-Of-Life." + return 1 fi # If -R was passed, we need to configure custom repo url with rsync-ed packages @@ -4352,16 +4336,16 @@ install_centos_stable_deps() { install_centos_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -4384,26 +4368,26 @@ install_centos_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - /bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( - /bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && - /bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 + /bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( + /bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && + /bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 ) SYSTEMD_RELOAD=$BS_TRUE elif [ -f "/etc/init.d/salt-${fname}" ]; then - /sbin/chkconfig "salt-${fname}" on + /sbin/chkconfig salt-${fname} on fi done - if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then + if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then /bin/systemctl daemon-reload fi @@ -4420,10 +4404,10 @@ install_centos_git_deps() { # package repos available. # Set ONEDIR_REV to STABLE_REV in case we # end up calling install_centos_onedir_deps - ONEDIR_REV="${STABLE_REV}" + ONEDIR_REV=${STABLE_REV} install_centos_onedir_deps || return 1 - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then __yum_install_noinput ca-certificates || return 1 fi @@ -4475,15 +4459,15 @@ install_centos_git() { } install_centos_git_post() { - SYSTEMD_RELOAD="$BS_FALSE" + SYSTEMD_RELOAD=$BS_FALSE for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -4493,19 +4477,19 @@ install_centos_git_post() { fi if [ -f /bin/systemctl ]; then if [ ! -f "/usr/lib/systemd/system/salt-${fname}.service" ] || \ - { [ -f "/usr/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then + { [ -f "/usr/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then __copyfile "${_SERVICE_FILE}" /usr/lib/systemd/system fi - SYSTEMD_RELOAD="$BS_TRUE" + SYSTEMD_RELOAD=$BS_TRUE elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; }; then + { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}" /etc/init.d - chmod +x "/etc/init.d/salt-${fname}" + chmod +x /etc/init.d/salt-${fname} fi done - if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then + if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then /bin/systemctl daemon-reload fi @@ -4533,8 +4517,8 @@ install_centos_onedir_deps() { fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has - # its own check in case -r was passed without -R. + # Which was still handled in __install_saltstack_rhel_repository, which was for old-stable which + # is removed since End-Of-Life. This call has its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then __install_saltstack_rhel_onedir_repository || return 1 fi @@ -4584,16 +4568,16 @@ install_centos_onedir_deps() { install_centos_onedir() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -4605,30 +4589,30 @@ install_centos_onedir() { } install_centos_onedir_post() { - SYSTEMD_RELOAD="$BS_FALSE" + SYSTEMD_RELOAD=$BS_FALSE for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - /bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( - /bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && - /bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 + /bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( + /bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && + /bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 ) SYSTEMD_RELOAD=$BS_TRUE elif [ -f "/etc/init.d/salt-${fname}" ]; then - "/sbin/chkconfig salt-${fname}" on + /sbin/chkconfig salt-${fname} on fi done - if [ "$SYSTEMD_RELOAD" -eq "$BS_TRUE" ]; then + if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then /bin/systemctl daemon-reload fi @@ -4636,43 +4620,43 @@ install_centos_onedir_post() { } install_centos_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /sbin/initctl ] && [ -f "/etc/init/salt-${fname}.conf" ]; then + if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then # We have upstart support and upstart knows about our service - if ! /sbin/initctl status "salt-$fname" > /dev/null 2>&1; then + if ! /sbin/initctl status salt-$fname > /dev/null 2>&1; then # Everything is in place and upstart gave us an error code? Fail! return 1 fi # upstart knows about this service. # Let's try to stop it, and then start it - /sbin/initctl stop "salt-$fname" > /dev/null 2>&1 + /sbin/initctl stop salt-$fname > /dev/null 2>&1 # Restart service - if ! /sbin/initctl start "salt-$fname" > /dev/null 2>&1; then + if ! /sbin/initctl start salt-$fname > /dev/null 2>&1; then # Failed the restart?! return 1 fi - elif [ -f "/etc/init.d/salt-$fname" ]; then + elif [ -f /etc/init.d/salt-$fname ]; then # Disable stdin to fix shell session hang on killing tee pipe - service "salt-$fname" stop < /dev/null > /dev/null 2>&1 - service "salt-$fname" start < /dev/null + service salt-$fname stop < /dev/null > /dev/null 2>&1 + service salt-$fname start < /dev/null elif [ -f /usr/bin/systemctl ]; then # CentOS 7 uses systemd - /usr/bin/systemctl stop "salt-$fname" > /dev/null 2>&1 - /usr/bin/systemctl start "salt-$fname.service" && continue + /usr/bin/systemctl stop salt-$fname > /dev/null 2>&1 + /usr/bin/systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi fi @@ -4697,16 +4681,14 @@ install_centos_testing_post() { install_centos_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /sbin/initctl ] && [ -f "/etc/init/salt-${fname}.conf" ]; then - __check_services_upstart "salt-$fname" || return 1 - elif [ -f "/etc/init.d/salt-$fname" ]; then + if [ -f "/etc/init.d/salt-$fname" ]; then __check_services_sysvinit "salt-$fname" || return 1 elif [ -f /usr/bin/systemctl ]; then __check_services_systemd "salt-$fname" || return 1 @@ -5019,14 +5001,14 @@ install_red_hat_enterprise_workstation_testing_post() { # install_oracle_linux_stable_deps() { # Install Oracle's EPEL. - if [ "${_EPEL_REPOS_INSTALLED}" -eq "$BS_FALSE" ]; then - _EPEL_REPO="oracle-epel-release-el${DISTRO_MAJOR_VERSION}" + if [ "${_EPEL_REPOS_INSTALLED}" -eq $BS_FALSE ]; then + _EPEL_REPO=oracle-epel-release-el${DISTRO_MAJOR_VERSION} if ! rpm -q "${_EPEL_REPO}" > /dev/null; then # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${_EPEL_REPO}" __yum_install_noinput ${_EPEL_REPO} fi - _EPEL_REPOS_INSTALLED="$BS_TRUE" + _EPEL_REPOS_INSTALLED=$BS_TRUE fi install_centos_stable_deps || return 1 @@ -5443,16 +5425,16 @@ install_alpine_linux_git_deps() { install_alpine_linux_stable() { __PACKAGES="salt" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi @@ -5469,11 +5451,11 @@ install_alpine_linux_git() { install_alpine_linux_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /sbin/rc-update ]; then script_url="${_SALTSTACK_REPO_URL%.git}/raw/master/pkg/alpine/salt-$fname" @@ -5488,7 +5470,7 @@ install_alpine_linux_post() { fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue /sbin/rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 fi @@ -5496,60 +5478,60 @@ install_alpine_linux_post() { } install_alpine_linux_restart_daemons() { - [ "${_START_DAEMONS}" -eq "$BS_FALSE" ] && return + [ "${_START_DAEMONS}" -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Disable stdin to fix shell session hang on killing tee pipe - /sbin/rc-service "salt-$fname" stop < /dev/null > /dev/null 2>&1 - /sbin/rc-service "salt-$fname" start < /dev/null || return 1 + /sbin/rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 + /sbin/rc-service salt-$fname start < /dev/null || return 1 done } install_alpine_linux_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_openrc "salt-$fname" || return 1 + __check_services_openrc salt-$fname || return 1 done return 0 } daemons_running_alpine_linux() { - [ "${_START_DAEMONS}" -eq "$BS_FALSE" ] && return + [ "${_START_DAEMONS}" -eq $BS_FALSE ] && return FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # shellcheck disable=SC2009 - if [ "$(ps wwwaux | grep -v grep | grep "salt-$fname")" = "" ]; then + if [ "$(ps wwwaux | grep -v grep | grep salt-$fname)" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return "$FAILED_DAEMONS" + return $FAILED_DAEMONS } # @@ -5565,7 +5547,7 @@ daemons_running_alpine_linux() { # Support for Amazon Linux 2 install_amazon_linux_ami_2_git_deps() { - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then yum -y install ca-certificates || return 1 fi @@ -5623,11 +5605,11 @@ install_amazon_linux_ami_2_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" PY_PKG_VER=3 __PY_VERSION_REPO="py3" @@ -5679,11 +5661,11 @@ install_amazon_linux_ami_2_onedir_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" __PY_VERSION_REPO="py3" PY_PKG_VER=3 @@ -5698,7 +5680,6 @@ install_amazon_linux_ami_2_onedir_deps() { gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.pub" - # This should prob be refactored to use __install_saltstack_rhel_onedir_repository() # With args passed in to do the right thing. Reformatted to be more like the # amazon linux yum file. if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then @@ -5774,7 +5755,7 @@ install_amazon_linux_ami_2_onedir_post() { # Support for Amazon Linux 2023 # the following code needs adjustment to allow for 2023, 2024, 2025, etc - 2023 for now install_amazon_linux_ami_2023_git_deps() { - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then yum -y install ca-certificates || return 1 fi @@ -5822,11 +5803,11 @@ install_amazon_linux_ami_2023_onedir_deps() { __yum_install_noinput yum-utils # Do upgrade early - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + if [ "$_DISABLE_REPOS" -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then __REPO_FILENAME="salt.repo" __PY_VERSION_REPO="py3" PY_PKG_VER=3 @@ -5951,7 +5932,7 @@ install_arch_linux_stable_deps() { # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-yaml - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-apache-libcloud || return 1 fi @@ -5959,7 +5940,8 @@ install_arch_linux_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - pacman -Su --noconfirm --needed "${_EXTRA_PACKAGES}" || return 1 + ## DGM pacman -Su --noconfirm --needed "${_EXTRA_PACKAGES}" || return 1 + pacman -Su --noconfirm --needed ${_EXTRA_PACKAGES} || return 1 fi } @@ -5982,7 +5964,8 @@ install_arch_linux_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 - pacman -Su --noconfirm --needed "${__PACKAGES}" + ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" + pacman -Su --noconfirm --needed ${__PACKAGES} # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6030,28 +6013,28 @@ install_arch_linux_git() { install_arch_linux_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Since Arch's pacman renames configuration files if [ "$_TEMP_CONFIG_DIR" != "null" ] && [ -f "$_SALT_ETC_DIR/$fname.pacorig" ]; then # Since a configuration directory was provided, it also means that any # configuration file copied was renamed by Arch, see: # https://wiki.archlinux.org/index.php/Pacnew_and_Pacsave_Files#.pacorig - __copyfile "$_SALT_ETC_DIR/$fname.pacorig" "$_SALT_ETC_DIR/$fname" "$BS_TRUE" + __copyfile "$_SALT_ETC_DIR/$fname.pacorig" "$_SALT_ETC_DIR/$fname" $BS_TRUE fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue if [ -f /usr/bin/systemctl ]; then # Using systemd - /usr/bin/systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( - /usr/bin/systemctl preset "salt-$fname.service" > /dev/null 2>&1 && - /usr/bin/systemctl enable "salt-$fname.service" > /dev/null 2>&1 + /usr/bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( + /usr/bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && + /usr/bin/systemctl enable salt-$fname.service > /dev/null 2>&1 ) sleep 1 /usr/bin/systemctl daemon-reload @@ -6065,11 +6048,11 @@ install_arch_linux_post() { install_arch_linux_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -6082,11 +6065,11 @@ install_arch_linux_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - /usr/bin/systemctl is-enabled "salt-${fname}.service" > /dev/null 2>&1 || ( - /usr/bin/systemctl preset "salt-${fname}.service" > /dev/null 2>&1 && - /usr/bin/systemctl enable "salt-${fname}.service" > /dev/null 2>&1 + /usr/bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( + /usr/bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && + /usr/bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 ) sleep 1 /usr/bin/systemctl daemon-reload @@ -6095,34 +6078,34 @@ install_arch_linux_git_post() { # SysV init!? __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-$fname" "/etc/rc.d/init.d/salt-$fname" - chmod +x "/etc/rc.d/init.d/salt-$fname" + chmod +x /etc/rc.d/init.d/salt-$fname done } install_arch_linux_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /usr/bin/systemctl ]; then - /usr/bin/systemctl stop "salt-$fname.service" > /dev/null 2>&1 - /usr/bin/systemctl start "salt-$fname.service" && continue + /usr/bin/systemctl stop salt-$fname.service > /dev/null 2>&1 + /usr/bin/systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi fi - "/etc/rc.d/salt-$fname" stop > /dev/null 2>&1 - "/etc/rc.d/salt-$fname" start + /etc/rc.d/salt-$fname stop > /dev/null 2>&1 + /etc/rc.d/salt-$fname start done } @@ -6134,14 +6117,14 @@ install_arch_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_systemd "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 done return 0 @@ -6183,7 +6166,7 @@ __install_saltstack_photon_onedir_repository() { __PY_VERSION_REPO="py3" REPO_FILE="/etc/yum.repos.d/salt.repo" - if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then + if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" @@ -6210,7 +6193,7 @@ install_photon_deps() { return 1 fi - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then tdnf -y update || return 1 fi @@ -6236,14 +6219,14 @@ install_photon_deps() { install_photon_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload done @@ -6305,9 +6288,9 @@ install_photon_git() { fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 + ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 else - ${_PYEXE} setup.py "${SETUP_PY_INSTALL_ARGS}" install --prefix=/usr || return 1 + ${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1 fi return 0 } @@ -6315,11 +6298,11 @@ install_photon_git() { install_photon_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -6335,31 +6318,31 @@ install_photon_git_post() { #fi # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload done } install_photon_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - systemctl stop "salt-$fname" > /dev/null 2>&1 - systemctl start "salt-$fname.service" && continue + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi done @@ -6368,14 +6351,14 @@ install_photon_restart_daemons() { install_photon_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_systemd "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 done return 0 @@ -6383,7 +6366,7 @@ install_photon_check_services() { install_photon_onedir_deps() { - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then tdnf -y update || return 1 fi @@ -6398,8 +6381,8 @@ install_photon_onedir_deps() { fi # If -R was passed, we need to configure custom repo url with rsync-ed packages - # Which is still handled in __install_saltstack_rhel_onedir_repository. This call has - # its own check in case -r was passed without -R. + # Which was handled in __install_saltstack_rhel_repository buu that hanlded old-stable which is for + # releases which are End-Of-Life. This call has its own check in case -r was passed without -R. if [ "$_CUSTOM_REPO_URL" != "null" ]; then __install_saltstack_photon_onedir_repository || return 1 fi @@ -6423,31 +6406,32 @@ install_photon_onedir_deps() { install_photon_onedir() { - STABLE_REV="$ONEDIR_REV" + STABLE_REV=$ONEDIR_REV __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __tdnf_install_noinput "${__PACKAGES}" || return 1 + ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 + __tdnf_install_noinput ${__PACKAGES} || return 1 return 0 } install_photon_onedir_post() { - STABLE_REV="$ONEDIR_REV" + STABLE_REV=$ONEDIR_REV install_photon_stable_post || return 1 return 0 @@ -6499,9 +6483,9 @@ __version_lte() { fi 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 - __ZYPPER_REQUIRES_REPLACE_FILES="${BS_TRUE}" + __ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE} else - __ZYPPER_REQUIRES_REPLACE_FILES="${BS_FALSE}" + __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} fi } @@ -6538,7 +6522,7 @@ __zypper_install() { __opensuse_prep_install() { # DRY function for common installation preparatory steps for SUSE - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then + if [ "$_DISABLE_REPOS" -eq $BS_FALSE ]; then # Is the repository already known __set_suse_pkg_repo # Check zypper repos and refresh if necessary @@ -6554,7 +6538,7 @@ __opensuse_prep_install() { return 1 fi - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then __zypper --gpg-auto-import-keys update || return 1 fi } @@ -6573,19 +6557,21 @@ install_opensuse_stable_deps() { __PACKAGES="python-PyYAML python-requests python-zypp" # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 + ## DGM __zypper_install "${__PACKAGES}" || return 1 + __zypper_install ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install "${_EXTRA_PACKAGES}" || return 1 + ## DGM __zypper_install "${_EXTRA_PACKAGES}" || return 1 + __zypper_install ${_EXTRA_PACKAGES} || return 1 fi return 0 } install_opensuse_git_deps() { - if [ "$_INSECURE_DL" -eq "$BS_FALSE" ] && [ "${_SALT_REPO_URL%%://*}" = "https" ] && ! __check_command_exists update-ca-certificates; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ] && ! __check_command_exists update-ca-certificates; then __zypper_install ca-certificates || return 1 fi @@ -6605,7 +6591,8 @@ install_opensuse_git_deps() { fi # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 + ## DGM __zypper_install "${__PACKAGES}" || return 1 + __zypper_install ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6623,21 +6610,22 @@ install_opensuse_onedir_deps() { install_opensuse_stable() { __PACKAGES="" - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ];then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-cloud" fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-master" fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - __zypper_install "$__PACKAGES" || return 1 + ## DGM __zypper_install "$__PACKAGES" || return 1 + __zypper_install $__PACKAGES || return 1 return 0 } @@ -6654,22 +6642,22 @@ install_opensuse_onedir() { install_opensuse_stable_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ] || [ -f /usr/bin/systemctl ]; then - systemctl is-enabled "salt-$fname.service" || (systemctl preset "salt-$fname.service" && systemctl enable "salt-$fname.service") + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) sleep 1 systemctl daemon-reload continue fi - /sbin/chkconfig --add "salt-$fname" - /sbin/chkconfig "salt-$fname" on + /sbin/chkconfig --add salt-$fname + /sbin/chkconfig salt-$fname on done return 0 @@ -6678,21 +6666,21 @@ install_opensuse_stable_post() { install_opensuse_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if command -v systemctl; then - use_usr_lib="$BS_FALSE" + use_usr_lib=$BS_FALSE if [ "${DISTRO_MAJOR_VERSION}" -ge 15 ]; then - use_usr_lib="$BS_TRUE" + use_usr_lib=$BS_TRUE fi if [ "${DISTRO_MAJOR_VERSION}" -eq 12 ] && [ -d "/usr/lib/systemd/" ]; then - use_usr_lib="$BS_TRUE" + use_usr_lib=$BS_TRUE fi # Account for new path for services files in later releases @@ -6702,7 +6690,7 @@ install_opensuse_git_post() { _SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/" fi - if [ "${use_usr_lib}" -eq "$BS_TRUE" ]; then + if [ "${use_usr_lib}" -eq $BS_TRUE ]; then __copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service" else __copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" @@ -6712,7 +6700,7 @@ install_opensuse_git_post() { fi __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-$fname" "/etc/init.d/salt-$fname" - chmod +x "/etc/init.d/salt-$fname" + chmod +x /etc/init.d/salt-$fname done install_opensuse_stable_post || return 1 @@ -6725,29 +6713,29 @@ install_opensuse_onedir_post() { } install_opensuse_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - systemctl stop "salt-$fname" > /dev/null 2>&1 - systemctl start "salt-$fname.service" && continue + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi fi - service "salt-$fname" stop > /dev/null 2>&1 - service "salt-$fname" start + service salt-$fname stop > /dev/null 2>&1 + service salt-$fname start done } @@ -6759,14 +6747,14 @@ install_opensuse_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_systemd "salt-$fname" > /dev/null 2>&1 || __check_services_systemd "salt-$fname.service" > /dev/null 2>&1 || return 1 + __check_services_systemd salt-$fname > /dev/null 2>&1 || __check_services_systemd salt-$fname.service > /dev/null 2>&1 || return 1 done return 0 @@ -6797,12 +6785,14 @@ install_opensuse_15_stable_deps() { __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 + ## DGM __zypper_install "${__PACKAGES}" || return 1 + __zypper_install ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __zypper_install "${_EXTRA_PACKAGES}" || return 1 + ## DGM __zypper_install "${_EXTRA_PACKAGES}" || return 1 + __zypper_install ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -6826,7 +6816,8 @@ install_opensuse_15_git_deps() { __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" # shellcheck disable=SC2086 - __zypper_install "${__PACKAGES}" || return 1 + ## DGM __zypper_install "${__PACKAGES}" || return 1 + __zypper_install ${__PACKAGES} || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -6955,14 +6946,14 @@ __autounmask() { __emerge() { EMERGE_FLAGS='-q' - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then EMERGE_FLAGS='-v' fi # Do not re-emerge packages that are already installed EMERGE_FLAGS="${EMERGE_FLAGS} --noreplace" - if [ "$_GENTOO_USE_BINHOST" -eq "$BS_TRUE" ]; then + if [ "$_GENTOO_USE_BINHOST" -eq $BS_TRUE ]; then EMERGE_FLAGS="${EMERGE_FLAGS} --getbinpkg" fi @@ -6971,7 +6962,7 @@ __emerge() { } __gentoo_pre_dep() { - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then if __check_command_exists eix; then eix-sync else @@ -7005,9 +6996,11 @@ __gentoo_post_dep() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __autounmask "${_EXTRA_PACKAGES}" || return 1 + ## DGM __autounmask "${_EXTRA_PACKAGES}" || return 1 + __autounmask ${_EXTRA_PACKAGES} || return 1 # shellcheck disable=SC2086 - __emerge "${_EXTRA_PACKAGES}" || return 1 + ## DGM __emerge "${_EXTRA_PACKAGES}" || return 1 + __emerge ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -7017,20 +7010,20 @@ install_gentoo_deps() { __gentoo_pre_dep || return 1 # Make sure that the 'libcloud' use flag is set when Salt Cloud support is requested - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then SALT_USE_FILE='/etc/portage/package.use' if [ -d '/etc/portage/package.use' ]; then SALT_USE_FILE='/etc/portage/package.use/salt' fi - SALT_USE_FLAGS="$(grep -E '^[<>=~]*app-admin/salt.*' "${SALT_USE_FILE}" 2>/dev/null)" + SALT_USE_FLAGS="$(grep -E '^[<>=~]*app-admin/salt.*' ${SALT_USE_FILE} 2>/dev/null)" SALT_USE_FLAG_LIBCLOUD="$(echo "${SALT_USE_FLAGS}" | grep ' libcloud' 2>/dev/null)" # Set the libcloud use flag, if it is not set yet if [ -z "${SALT_USE_FLAGS}" ]; then - echo "app-admin/salt libcloud" >> "${SALT_USE_FILE}" + echo "app-admin/salt libcloud" >> ${SALT_USE_FILE} elif [ -z "${SALT_USE_FLAG_LIBCLOUD}" ]; then - sed 's#^\([<>=~]*app-admin/salt[^ ]*\)\(.*\)#\1 libcloud\2#g' -i "${SALT_USE_FILE}" + sed 's#^\([<>=~]*app-admin/salt[^ ]*\)\(.*\)#\1 libcloud\2#g' -i ${SALT_USE_FILE} fi fi @@ -7051,7 +7044,7 @@ install_gentoo_git_deps() { fi # Install libcloud when Salt Cloud support was requested - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES:-} dev-python/libcloud" fi @@ -7078,9 +7071,11 @@ install_gentoo_stable() { fi # shellcheck disable=SC2086 - __autounmask "${GENTOO_SALT_PACKAGE}" || return 1 + ## DGM __autounmask "${GENTOO_SALT_PACKAGE}" || return 1 + __autounmask ${GENTOO_SALT_PACKAGE} || return 1 # shellcheck disable=SC2086 - __emerge "${GENTOO_SALT_PACKAGE}" || return 1 + ## DGM __emerge "${GENTOO_SALT_PACKAGE}" || return 1 + __emerge ${GENTOO_SALT_PACKAGE} || return 1 } install_gentoo_git() { @@ -7095,29 +7090,29 @@ install_gentoo_git() { } install_gentoo_onedir() { - STABLE_REV="${ONEDIR_REV}" + STABLE_REV=${ONEDIR_REV} install_gentoo_stable || return 1 } install_gentoo_post() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if __check_command_exists systemctl ; then - systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( - systemctl preset "salt-$fname.service" > /dev/null 2>&1 && - systemctl enable "salt-$fname.service" > /dev/null 2>&1 + systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( + systemctl preset salt-$fname.service > /dev/null 2>&1 && + systemctl enable salt-$fname.service > /dev/null 2>&1 ) else # Salt minion cannot start in a docker container because the "net" service is not available - if [ "$fname" = "minion" ] && [ -f /.dockerenv ]; then - sed '/need net/d' -i "/etc/init.d/salt-$fname" + if [ $fname = "minion" ] && [ -f /.dockerenv ]; then + sed '/need net/d' -i /etc/init.d/salt-$fname fi rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 @@ -7128,11 +7123,11 @@ install_gentoo_post() { install_gentoo_git_post() { for fname in api master minion syndic; do # Skip if not meant to be installed - [ "$fname" = "api" ] && \ - ([ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] || ! __check_command_exists "salt-${fname}") && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Account for new path for services files in later releases if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then @@ -7145,11 +7140,11 @@ install_gentoo_git_post() { __copyfile "${_SERVICE_DIR}/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 - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue - systemctl is-enabled "salt-$fname.service" > /dev/null 2>&1 || ( - systemctl preset "salt-$fname.service" > /dev/null 2>&1 && - systemctl enable "salt-$fname.service" > /dev/null 2>&1 + systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( + systemctl preset salt-$fname.service > /dev/null 2>&1 && + systemctl enable salt-$fname.service > /dev/null 2>&1 ) else cat <<_eof > "/etc/init.d/salt-${fname}" @@ -7168,7 +7163,7 @@ depend() { use net logger } _eof - chmod +x "/etc/init.d/salt-$fname" + chmod +x /etc/init.d/salt-$fname cat <<_eof > "/etc/conf.d/salt-${fname}" # /etc/conf.d/salt-${fname}: config file for /etc/init.d/salt-master @@ -7179,7 +7174,7 @@ SALT_OPTS="--log-level=warning" _eof # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 fi @@ -7193,7 +7188,7 @@ install_gentoo_onedir_post() { } install_gentoo_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return # Ensure upstart configs / systemd units are loaded if __check_command_exists systemctl ; then @@ -7202,25 +7197,25 @@ install_gentoo_restart_daemons() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if __check_command_exists systemctl ; then - systemctl stop "salt-$fname" > /dev/null 2>&1 - systemctl start "salt-$fname.service" && continue + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq "$BS_TRUE" ]; then - systemctl status "salt-$fname.service" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service journalctl -xe fi else # Disable stdin to fix shell session hang on killing tee pipe - rc-service "salt-$fname" stop < /dev/null > /dev/null 2>&1 - rc-service "salt-$fname" start < /dev/null || return 1 + rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 + rc-service salt-$fname start < /dev/null || return 1 fi done @@ -7230,17 +7225,17 @@ install_gentoo_restart_daemons() { install_gentoo_check_services() { for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if __check_command_exists systemctl ; then - __check_services_systemd "salt-$fname" || return 1 + __check_services_systemd salt-$fname || return 1 else - __check_services_openrc "salt-$fname" || return 1 + __check_services_openrc salt-$fname || return 1 fi done @@ -7256,7 +7251,7 @@ install_gentoo_check_services() { # VoidLinux Install Functions # install_voidlinux_stable_deps() { - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then xbps-install -Suy || return 1 fi @@ -7275,54 +7270,54 @@ install_voidlinux_stable() { install_voidlinux_stable_post() { for fname in master minion syndic; do - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - ln -s "/etc/sv/salt-$fname" /var/service/. + ln -s /etc/sv/salt-$fname /var/service/. done } install_voidlinux_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return for fname in master minion syndic; do - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - sv restart "salt-$fname" + sv restart salt-$fname done } install_voidlinux_check_services() { for fname in master minion syndic; do - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - [ -e "/var/service/salt-$fname" ] || return 1 + [ -e /var/service/salt-$fname ] || return 1 done return 0 } daemons_running_voidlinux() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 FAILED_DAEMONS=0 for fname in master minion syndic; do - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ "$(sv status "salt-$fname" | grep run)" = "" ]; then + if [ "$(sv status salt-$fname | grep run)" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return "$FAILED_DAEMONS" + return $FAILED_DAEMONS } # # Ended VoidLinux Install Functions @@ -7413,7 +7408,7 @@ install_macosx_git_deps() { if ! echo "$PATH" | grep -q /usr/local/bin; then echowarn "/usr/local/bin was not found in \$PATH. Adding it for the duration of the script execution." - export PATH="/usr/local/bin:$PATH" + export PATH=/usr/local/bin:$PATH fi __fetch_url "/tmp/get-pip.py" "https://bootstrap.pypa.io/get-pip.py" || return 1 @@ -7492,14 +7487,14 @@ install_macosx_git_post() { } install_macosx_restart_daemons() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then /bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1 /bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1 fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then /bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.master.plist || return 1 /bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist || return 1 fi @@ -7520,13 +7515,13 @@ config_salt() { # If the configuration directory is not passed, return [ "$_TEMP_CONFIG_DIR" = "null" ] && return - if [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then + if [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then echowarn "Passing -C (config only) option implies -F (forced overwrite)." - if [ "$_FORCE_OVERWRITE" -ne "$BS_TRUE" ]; then + if [ "$_FORCE_OVERWRITE" -ne $BS_TRUE ]; then echowarn "Overwriting configs in 11 seconds!" sleep 11 - _FORCE_OVERWRITE="$BS_TRUE" + _FORCE_OVERWRITE=$BS_TRUE fi fi @@ -7536,9 +7531,9 @@ config_salt() { # If -C or -F was passed, we don't need a .bak file for the config we're updating # This is used in the custom master/minion config file checks below - CREATE_BAK="$BS_TRUE" - if [ "$_FORCE_OVERWRITE" -eq "$BS_TRUE" ]; then - CREATE_BAK="$BS_FALSE" + CREATE_BAK=$BS_TRUE + if [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then + CREATE_BAK=$BS_FALSE fi CONFIGURED_ANYTHING=$BS_FALSE @@ -7547,11 +7542,11 @@ config_salt() { if [ -f "$_TEMP_CONFIG_DIR/grains" ]; then echodebug "Moving provided grains file from $_TEMP_CONFIG_DIR/grains to $_SALT_ETC_DIR/grains" __movefile "$_TEMP_CONFIG_DIR/grains" "$_SALT_ETC_DIR/grains" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi - if [ "$_INSTALL_MINION" -eq "$BS_TRUE" ] || \ - [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ] || [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then + if [ "$_INSTALL_MINION" -eq $BS_TRUE ] || \ + [ "$_CONFIG_ONLY" -eq $BS_TRUE ] || [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then # Create the PKI directory [ -d "$_PKI_DIR/minion" ] || (mkdir -p "$_PKI_DIR/minion" && chmod 700 "$_PKI_DIR/minion") || return 1 @@ -7561,50 +7556,50 @@ config_salt() { # Check if a minion config file already exists and move to .bak if needed if [ -f "$_SALT_ETC_DIR/minion" ] && [ "$CREATE_BAK" -eq "$BS_TRUE" ]; then __movefile "$_SALT_ETC_DIR/minion" "$_SALT_ETC_DIR/minion.bak" "$BS_TRUE" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi # Overwrite/create the config file with the yaml string __overwriteconfig "$_SALT_ETC_DIR/minion" "$_CUSTOM_MINION_CONFIG" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE # Copy the minions configuration if found # Explicitly check for custom master config to avoid moving the minion config elif [ -f "$_TEMP_CONFIG_DIR/minion" ] && [ "$_CUSTOM_MASTER_CONFIG" = "null" ]; then __movefile "$_TEMP_CONFIG_DIR/minion" "$_SALT_ETC_DIR" "$_FORCE_OVERWRITE" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi # Copy the minion's keys if found if [ -f "$_TEMP_CONFIG_DIR/minion.pem" ]; then __movefile "$_TEMP_CONFIG_DIR/minion.pem" "$_PKI_DIR/minion/" "$_FORCE_OVERWRITE" || return 1 chmod 400 "$_PKI_DIR/minion/minion.pem" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi if [ -f "$_TEMP_CONFIG_DIR/minion.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/minion.pub" "$_PKI_DIR/minion/" "$_FORCE_OVERWRITE" || return 1 chmod 664 "$_PKI_DIR/minion/minion.pub" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi # For multi-master-pki, copy the master_sign public key if found if [ -f "$_TEMP_CONFIG_DIR/master_sign.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/master_sign.pub" "$_PKI_DIR/minion/" || return 1 chmod 664 "$_PKI_DIR/minion/master_sign.pub" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi fi # only (re)place master or syndic configs if -M (install master) or -S # (install syndic) specified - OVERWRITE_MASTER_CONFIGS="$BS_FALSE" - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then - OVERWRITE_MASTER_CONFIGS="$BS_TRUE" + OVERWRITE_MASTER_CONFIGS=$BS_FALSE + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ] && [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then + OVERWRITE_MASTER_CONFIGS=$BS_TRUE fi - if [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then - OVERWRITE_MASTER_CONFIGS="$BS_TRUE" + if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ] && [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then + OVERWRITE_MASTER_CONFIGS=$BS_TRUE fi - if [ "$_INSTALL_MASTER" -eq "$BS_TRUE" ] || [ "$_INSTALL_SYNDIC" -eq "$BS_TRUE" ] || [ "$OVERWRITE_MASTER_CONFIGS" -eq "$BS_TRUE" ] || [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then + if [ "$_INSTALL_MASTER" -eq $BS_TRUE ] || [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ] || [ "$OVERWRITE_MASTER_CONFIGS" -eq $BS_TRUE ] || [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then # Create the PKI directory [ -d "$_PKI_DIR/master" ] || (mkdir -p "$_PKI_DIR/master" && chmod 700 "$_PKI_DIR/master") || return 1 @@ -7614,33 +7609,33 @@ config_salt() { # Check if a master config file already exists and move to .bak if needed if [ -f "$_SALT_ETC_DIR/master" ] && [ "$CREATE_BAK" -eq "$BS_TRUE" ]; then __movefile "$_SALT_ETC_DIR/master" "$_SALT_ETC_DIR/master.bak" "$BS_TRUE" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi # Overwrite/create the config file with the yaml string __overwriteconfig "$_SALT_ETC_DIR/master" "$_CUSTOM_MASTER_CONFIG" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE # Copy the masters configuration if found elif [ -f "$_TEMP_CONFIG_DIR/master" ]; then __movefile "$_TEMP_CONFIG_DIR/master" "$_SALT_ETC_DIR" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi # Copy the masters keys if found if [ -f "$_TEMP_CONFIG_DIR/master.pem" ]; then __movefile "$_TEMP_CONFIG_DIR/master.pem" "$_PKI_DIR/master/" || return 1 chmod 400 "$_PKI_DIR/master/master.pem" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi if [ -f "$_TEMP_CONFIG_DIR/master.pub" ]; then __movefile "$_TEMP_CONFIG_DIR/master.pub" "$_PKI_DIR/master/" || return 1 chmod 664 "$_PKI_DIR/master/master.pub" || return 1 - CONFIGURED_ANYTHING="$BS_TRUE" + CONFIGURED_ANYTHING=$BS_TRUE fi fi - if [ "$_INSTALL_CLOUD" -eq "$BS_TRUE" ]; then + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # Recursively copy salt-cloud configs with overwriting if necessary for file in "$_TEMP_CONFIG_DIR"/cloud*; do if [ -f "$file" ]; then @@ -7657,7 +7652,7 @@ config_salt() { done fi - if [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ] && [ "$CONFIGURED_ANYTHING" -eq "$BS_FALSE" ]; then + if [ "$_CONFIG_ONLY" -eq $BS_TRUE ] && [ "$CONFIGURED_ANYTHING" -eq $BS_FALSE ]; then echowarn "No configuration or keys were copied over. No configuration was done!" exit 0 fi @@ -7709,17 +7704,17 @@ preseed_master() { # This function checks if all of the installed daemons are running or not. # daemons_running_onedir() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f "/opt/saltstack/salt/run/run" ]; then salt_path="/opt/saltstack/salt/run/run ${fname}" @@ -7733,7 +7728,7 @@ daemons_running_onedir() { fi done - return "$FAILED_DAEMONS" + return $FAILED_DAEMONS } # @@ -7746,17 +7741,17 @@ daemons_running_onedir() { # This function checks if all of the installed daemons are running or not. # daemons_running() { - [ "$_START_DAEMONS" -eq "$BS_FALSE" ] && return 0 + [ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0 FAILED_DAEMONS=0 for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # shellcheck disable=SC2009 if [ "${DISTRO_NAME}" = "SmartOS" ]; then @@ -7764,13 +7759,13 @@ daemons_running() { echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi - elif [ "$(ps wwwaux | grep -v grep | grep "salt-$fname")" = "" ]; then + elif [ "$(ps wwwaux | grep -v grep | grep salt-$fname)" = "" ]; then echoerror "salt-$fname was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done - return "${FAILED_DAEMONS}" + return ${FAILED_DAEMONS} } # # Ended daemons running check function @@ -7783,7 +7778,7 @@ daemons_running() { # Let's get the dependencies install function DEP_FUNC_NAMES="" -if [ ${_NO_DEPS} -eq "$BS_FALSE" ]; then +if [ ${_NO_DEPS} -eq $BS_FALSE ]; then DEP_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_deps" DEP_FUNC_NAMES="$DEP_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_deps" DEP_FUNC_NAMES="$DEP_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_deps" @@ -7793,9 +7788,10 @@ if [ ${_NO_DEPS} -eq "$BS_FALSE" ]; then fi DEPS_INSTALL_FUNC="null" -for FUNC_NAME in $(__strip_duplicates "${DEP_FUNC_NAMES}"); do - if __function_defined "${FUNC_NAME}"; then - DEPS_INSTALL_FUNC="${FUNC_NAME}" +# shellcheck disable=SC2086 +for FUNC_NAME in $(__strip_duplicates ${DEP_FUNC_NAMES}); do + if __function_defined ${FUNC_NAME}; then + DEPS_INSTALL_FUNC=${FUNC_NAME} break fi done @@ -7803,17 +7799,17 @@ echodebug "DEPS_INSTALL_FUNC=${DEPS_INSTALL_FUNC}" # Let's get the Salt config function CONFIG_FUNC_NAMES="config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}_${ITYPE}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_${DISTRO_NAME_L}_salt" -CONFIG_FUNC_NAMES="${CONFIG_FUNC_NAMES} config_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}_${ITYPE}_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}_salt" +CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_salt" CONFIG_SALT_FUNC="null" -for FUNC_NAME in $(__strip_duplicates "${CONFIG_FUNC_NAMES}"); do - if __function_defined "${FUNC_NAME}"; then - CONFIG_SALT_FUNC="${FUNC_NAME}" +for FUNC_NAME in $(__strip_duplicates "$CONFIG_FUNC_NAMES"); do + if __function_defined "$FUNC_NAME"; then + CONFIG_SALT_FUNC="$FUNC_NAME" break fi done @@ -7938,17 +7934,17 @@ fi # Install dependencies -if [ "${_NO_DEPS}" -eq "$BS_FALSE" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then +if [ "${_NO_DEPS}" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then # Only execute function is not in config mode only echoinfo "Running ${DEPS_INSTALL_FUNC}()" - if ! "${DEPS_INSTALL_FUNC}"; then + if ! ${DEPS_INSTALL_FUNC}; then echoerror "Failed to run ${DEPS_INSTALL_FUNC}()!!!" exit 1 fi fi -if [ "${ITYPE}" = "git" ] && [ "${_NO_DEPS}" -eq "${BS_TRUE}" ]; then +if [ "${ITYPE}" = "git" ] && [ ${_NO_DEPS} -eq ${BS_TRUE} ]; then if ! __git_clone_and_checkout; then echo "Failed to clone and checkout git repository." exit 1 @@ -7962,7 +7958,7 @@ if [ "$_CUSTOM_MASTER_CONFIG" != "null" ] || [ "$_CUSTOM_MINION_CONFIG" != "null _TEMP_CONFIG_DIR="$_SALT_ETC_DIR" fi - if [ "${_NO_DEPS}" -eq "$BS_FALSE" ] && [ "$_CONFIG_ONLY" -eq "$BS_TRUE" ]; then + if [ "${_NO_DEPS}" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then # Execute function to satisfy dependencies for configuration step echoinfo "Running ${DEPS_INSTALL_FUNC}()" if ! ${DEPS_INSTALL_FUNC}; then @@ -7985,7 +7981,7 @@ fi if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then [ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d" cat <<_eof > "$_SALT_ETC_DIR/minion.d/99-master-address.conf" -master: "$_SALT_MASTER_ADDRESS" +master: $_SALT_MASTER_ADDRESS _eof fi @@ -7998,74 +7994,76 @@ fi # Pre-seed master keys if [ "$PRESEED_MASTER_FUNC" != "null" ] && [ "$_TEMP_KEYS_DIR" != "null" ]; then echoinfo "Running ${PRESEED_MASTER_FUNC}()" - if ! "${PRESEED_MASTER_FUNC}"; then + if ! ${PRESEED_MASTER_FUNC}; then echoerror "Failed to run ${PRESEED_MASTER_FUNC}()!!!" exit 1 fi fi # Install Salt -if [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then +if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then # Only execute function is not in config mode only echoinfo "Running ${INSTALL_FUNC}()" - if ! "${INSTALL_FUNC}"; then + if ! ${INSTALL_FUNC}; then echoerror "Failed to run ${INSTALL_FUNC}()!!!" exit 1 fi fi # Run any post install function. Only execute function if not in config mode only -if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then +if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Running ${POST_INSTALL_FUNC}()" - if ! "${POST_INSTALL_FUNC}"; then + if ! ${POST_INSTALL_FUNC}; then echoerror "Failed to run ${POST_INSTALL_FUNC}()!!!" exit 1 fi fi # Run any check services function, Only execute function if not in config mode only -if [ "$CHECK_SERVICES_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then +if [ "$CHECK_SERVICES_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Running ${CHECK_SERVICES_FUNC}()" - if ! "${CHECK_SERVICES_FUNC}"; then + if ! ${CHECK_SERVICES_FUNC}; then echoerror "Failed to run ${CHECK_SERVICES_FUNC}()!!!" exit 1 fi fi # Run any start daemons function -if [ "$STARTDAEMONS_INSTALL_FUNC" != "null" ] && [ "${_START_DAEMONS}" -eq "$BS_TRUE" ]; then +if [ "$STARTDAEMONS_INSTALL_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; then echoinfo "Running ${STARTDAEMONS_INSTALL_FUNC}()" echodebug "Waiting ${_SLEEP} seconds for processes to settle before checking for them" - sleep "${_SLEEP}" - if ! "${STARTDAEMONS_INSTALL_FUNC}"; then + # shellcheck disable=SC2086 + sleep ${_SLEEP} + if ! ${STARTDAEMONS_INSTALL_FUNC}; then echoerror "Failed to run ${STARTDAEMONS_INSTALL_FUNC}()!!!" exit 1 fi fi # Check if the installed daemons are running or not -if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ "${_START_DAEMONS}" -eq "$BS_TRUE" ]; then +if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; then echoinfo "Running ${DAEMONS_RUNNING_FUNC}()" echodebug "Waiting ${_SLEEP} seconds for processes to settle before checking for them" - sleep "${_SLEEP}" # Sleep a little bit to let daemons start - if ! "${DAEMONS_RUNNING_FUNC}"; then + # shellcheck disable=SC2086 + sleep ${_SLEEP} # Sleep a little bit to let daemons start + if ! ${DAEMONS_RUNNING_FUNC}; then echoerror "Failed to run ${DAEMONS_RUNNING_FUNC}()!!!" for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + [ $fname = "api" ] && continue # Skip if not meant to be installed - [ "$fname" = "master" ] && [ "$_INSTALL_MASTER" -eq "$BS_FALSE" ] && continue - [ "$fname" = "minion" ] && [ "$_INSTALL_MINION" -eq "$BS_FALSE" ] && continue - [ "$fname" = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq "$BS_FALSE" ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ "$_ECHO_DEBUG" -eq "$BS_FALSE" ]; then + if [ "$_ECHO_DEBUG" -eq $BS_FALSE ]; then echoerror "salt-$fname was not found running. Pass '-D' to ${__ScriptName} when bootstrapping for additional debugging information..." continue fi - [ ! -f "$_SALT_ETC_DIR/$fname" ] && [ "$fname" != "syndic" ] && echodebug "$_SALT_ETC_DIR/$fname does not exist" + [ ! -f "$_SALT_ETC_DIR/$fname" ] && [ $fname != "syndic" ] && echodebug "$_SALT_ETC_DIR/$fname does not exist" echodebug "Running salt-$fname by hand outputs: $(nohup salt-$fname -l debug)" @@ -8089,7 +8087,7 @@ if [ "$_AUTO_ACCEPT_MINION_KEYS" -eq "$BS_TRUE" ]; then fi # Done! -if [ "$_CONFIG_ONLY" -eq "$BS_FALSE" ]; then +if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Salt installed!" else echoinfo "Salt configured!" From 3aaa73bbb418ce1882106b15fe23c0cff795967b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 11:48:29 -0600 Subject: [PATCH 38/80] Updated bootstrap script to install tornado, since missing in pkg for 3006.x, fixed debian/ubuntu urls for repos --- bootstrap-salt.sh | 204 +++++++++++++++++++++++++++++++++++++--------- kitchen.yml | 4 +- 2 files changed, 168 insertions(+), 40 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 64056ba..37e912c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -127,11 +127,14 @@ __check_command_exists() { # DESCRIPTION: Simple function to let the users know that -P needs to be used. #---------------------------------------------------------------------------------------------------------------------- __check_pip_allowed() { - if [ $# -eq 1 ]; then - _PIP_ALLOWED_ERROR_MSG=$1 - else - _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" - fi + ## DGM __install_tornado_pip supplied an error msg, but no longer used, now shellcheck complains about unused parameter + ## DGM if [ $# -eq 1 ]; then + ## DGM _PIP_ALLOWED_ERROR_MSG=$1 + ## DGM else + ## DGM _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" + ## DGM fi + + _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" if [ "$_PIP_ALLOWED" -eq $BS_FALSE ]; then echoerror "$_PIP_ALLOWED_ERROR_MSG" @@ -1932,6 +1935,7 @@ __wait_for_apt(){ ## DGM Debugging set -v set -x + # Timeout set at 15 minutes WAIT_TIMEOUT=900 @@ -2061,7 +2065,6 @@ __yum_install_noinput() { set -v set -x - if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then # We need to install one package at a time because --enablerepo=X disables ALL OTHER REPOS!!!! for package in "${@}"; do @@ -2077,6 +2080,9 @@ __yum_install_noinput() { # DESCRIPTION: (DRY) dnf install with noinput options #---------------------------------------------------------------------------------------------------------------------- __dnf_install_noinput() { + ## DGM Debugging + set -v + set -x dnf -y install "${@}" || return $? } # ---------- end of function __dnf_install_noinput ---------- @@ -2086,6 +2092,9 @@ __dnf_install_noinput() { # DESCRIPTION: (DRY) tdnf install with noinput options #---------------------------------------------------------------------------------------------------------------------- __tdnf_install_noinput() { + ## DGM Debugging + set -v + set -x tdnf -y install "${@}" || return $? } # ---------- end of function __tdnf_install_noinput ---------- @@ -2630,17 +2639,17 @@ __install_pip_pkgs() { ${_pip_cmd} install ${_pip_pkgs} || return 1 } -#--- FUNCTION ------------------------------------------------------------------------------------------------------- -# NAME: __install_tornado_pip -# PARAMETERS: python executable -# DESCRIPTION: Return 0 or 1 if successfully able to install tornado<5.0 -#---------------------------------------------------------------------------------------------------------------------- -__install_tornado_pip() { - # OS needs tornado <5.0 from pip - __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt on Python 3" - ## install pip if its not installed and install tornado - __install_pip_pkgs "tornado<5.0" "${1}" || return 1 -} +## DGM #--- FUNCTION ------------------------------------------------------------------------------------------------------- +## DGM # NAME: __install_tornado_pip +## DGM # PARAMETERS: python executable +## DGM # DESCRIPTION: Return 0 or 1 if successfully able to install tornado<5.0 +## DGM #---------------------------------------------------------------------------------------------------------------------- +## DGM __install_tornado_pip() { +## DGM # OS needs tornado <5.0 from pip +## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt on Python 3" +## DGM ## install pip if its not installed and install tornado +## DGM __install_pip_pkgs "tornado<5.0" "${1}" || return 1 +## DGM } #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __install_pip_deps @@ -2950,6 +2959,9 @@ __install_saltstack_ubuntu_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -2959,7 +2971,7 @@ __install_saltstack_ubuntu_repository() { fi # SaltStack's stable Ubuntu repository: - SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" + SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 @@ -2993,6 +3005,9 @@ __install_saltstack_ubuntu_onedir_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3047,6 +3062,9 @@ install_ubuntu_deps() { # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 __PACKAGES="${__PACKAGES} procps pciutils" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3118,6 +3136,10 @@ install_ubuntu_git_deps() { if [ "$DISTRO_MAJOR_VERSION" -ge 22 ]; then __PACKAGES="${__PACKAGES} g++" fi + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3182,6 +3204,9 @@ install_ubuntu_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3242,6 +3267,9 @@ install_ubuntu_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3439,11 +3467,14 @@ __install_saltstack_debian_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086,SC2090 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 - SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" + SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 @@ -3473,6 +3504,9 @@ __install_saltstack_debian_onedir_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086,SC2090 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3524,6 +3558,9 @@ install_debian_deps() { # YAML module is used for generating custom master/minion configs __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3581,6 +3618,9 @@ install_debian_onedir_deps() { # YAML module is used for generating custom master/minion configs __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3629,6 +3669,10 @@ install_debian_git_deps() { __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" echodebug "install_debian_git_deps() Installing ${__PACKAGES}" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3652,6 +3696,9 @@ install_debian_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3731,6 +3778,9 @@ install_debian_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3919,6 +3969,9 @@ install_fedora_deps() { echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 @@ -3954,6 +4007,9 @@ install_fedora_stable() { __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} || return 1 @@ -4014,6 +4070,9 @@ install_fedora_git_deps() { __PACKAGES="${__PACKAGES} git" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 @@ -4159,6 +4218,9 @@ install_fedora_onedir_deps() { __PACKAGES="dnf-utils chkconfig procps-ng" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4194,6 +4256,9 @@ install_fedora_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4319,6 +4384,9 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig procps-ng findutils" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4349,6 +4417,9 @@ install_centos_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4429,6 +4500,10 @@ install_centos_git_deps() { fi __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4551,6 +4626,9 @@ install_centos_onedir_deps() { __PACKAGES="yum-utils chkconfig procps-ng findutils" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4581,6 +4659,9 @@ install_centos_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -5438,6 +5519,9 @@ install_alpine_linux_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 apk -U add "${__PACKAGES}" || return 1 return 0 @@ -5575,6 +5659,10 @@ install_amazon_linux_ami_2_git_deps() { __git_clone_and_checkout || return 1 __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -5616,7 +5704,7 @@ install_amazon_linux_ami_2_deps() { repo_label="saltstack-py3-repo" repo_name="SaltStack Python 3 repo for Amazon Linux 2" - base_url="$HTTP_VAL://${_REPO_URL}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" + base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/$repo_rev/" gpg_key="${base_url}SALT-PROJECT-GPG-PUBKEY-2023.gpg" # This should prob be refactored to use __install_saltstack_rhel_onedir_repository() @@ -5778,6 +5866,10 @@ install_amazon_linux_ami_2023_git_deps() { __git_clone_and_checkout || return 1 __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -5963,6 +6055,10 @@ install_arch_linux_git_deps() { fi __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" pacman -Su --noconfirm --needed ${__PACKAGES} @@ -6209,6 +6305,9 @@ install_photon_deps() { echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 @@ -6258,6 +6357,10 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 @@ -6389,6 +6492,9 @@ install_photon_onedir_deps() { __PACKAGES="procps-ng" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 @@ -6423,6 +6529,9 @@ install_photon_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 @@ -6554,7 +6663,10 @@ install_opensuse_stable_deps() { # YAML module is used for generating custom master/minion configs # requests is still used by many salt modules # Salt needs python-zypp installed in order to use the zypper module - __PACKAGES="python-PyYAML python-requests python-zypp" + __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests python${PY_PKG_VER}-zypp" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 @@ -6590,6 +6702,9 @@ install_opensuse_git_deps() { __PACKAGES="python3-pip python3-setuptools gcc" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 @@ -6623,6 +6738,9 @@ install_opensuse_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __zypper_install "$__PACKAGES" || return 1 __zypper_install $__PACKAGES || return 1 @@ -6784,6 +6902,9 @@ install_opensuse_15_stable_deps() { # requests is still used by many salt modules __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 @@ -6815,6 +6936,9 @@ install_opensuse_15_git_deps() { PY_PKG_VER=3 __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 @@ -7329,19 +7453,19 @@ daemons_running_voidlinux() { # OS X / Darwin Install Functions # -__macosx_get_packagesite() { - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python 2 is no longer supported, only Python 3" - return 1 - fi - - # TBD DGM need to update for arch and 3006+ repo locations - - DARWIN_ARCH="x86_64" - PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg" - SALTPKGCONFURL="https://${_REPO_URL}/osx/${PKG}" -} +## DGM __macosx_get_packagesite() { +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python 2 is no longer supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM # TBD DGM need to update for arch and 3006+ repo locations +## DGM +## DGM DARWIN_ARCH="x86_64" +## DGM PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg" +## DGM SALTPKGCONFURL="https://${_REPO_URL}/osx/${PKG}" +## DGM } __parse_repo_json_python() { @@ -7383,10 +7507,11 @@ __macosx_get_packagesite_onedir() { } # Using a separate conf step to head for idempotent install... -__configure_macosx_pkg_details() { - __macosx_get_packagesite || return 1 - return 0 -} +## DGM __configure_macosx_pkg_details() { +## DGM ## DGM __macosx_get_packagesite || return 1 +## DGM __macosx_get_packagesite_onedir || return 1 +## DGM return 0 +## DGM } __configure_macosx_pkg_details_onedir() { __macosx_get_packagesite_onedir || return 1 @@ -7394,7 +7519,8 @@ __configure_macosx_pkg_details_onedir() { } install_macosx_stable_deps() { - __configure_macosx_pkg_details || return 1 + ## DGM __configure_macosx_pkg_details || return 1 + __configure_macosx_pkg_details_onedir || return 1 return 0 } diff --git a/kitchen.yml b/kitchen.yml index 4d4b099..06bae01 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -46,7 +46,8 @@ platforms: - name: amazon-2023 driver: image: amazonlinux:2023 - platform: fedora + ## platform: fedora + platform: rhel provision_command: - yum -y install procps-ng - name: arch @@ -113,6 +114,7 @@ platforms: - *opensuse_provision_command_02 - *opensuse_provision_command_03 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: oraclelinux-8 - name: rockylinux-9 driver: platform: centosstream From 02bf0e33c14d11d029070c4ce4e35f3e7a871f68 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 13:45:45 -0600 Subject: [PATCH 39/80] Updates --- bootstrap-salt.sh | 119 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 16 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 37e912c..b45c6ef 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -24,7 +24,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.06.26" +__ScriptVersion="2024.07.01" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -602,6 +602,10 @@ if [ "$#" -gt 0 ];then shift fi +## DGM Debugging +set -v +set -x + # Check installation type if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." @@ -1748,6 +1752,10 @@ __check_end_of_life_versions() { esac } +## DGM Debugging +set -v +set -x + __gather_system_info @@ -2935,6 +2943,12 @@ __enable_universe_repository() { __install_saltstack_ubuntu_repository() { # Workaround for latest non-LTS Ubuntu + ## DGM Debugging + set -v + set -x + + echodebug "DGM Ubuntu A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then @@ -2973,7 +2987,6 @@ __install_saltstack_ubuntu_repository() { # SaltStack's stable Ubuntu repository: SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 @@ -2992,6 +3005,8 @@ __install_saltstack_ubuntu_onedir_repository() { UBUNTU_CODENAME=${DISTRO_CODENAME} fi + echodebug "DGM Ubuntu B checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3018,7 +3033,7 @@ __install_saltstack_ubuntu_onedir_repository() { fi echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 + __apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -3446,6 +3461,10 @@ install_ubuntu_check_services() { # Debian Install Functions # __install_saltstack_debian_repository() { + ## DGM Debugging + set -v + set -x + DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" @@ -3454,6 +3473,8 @@ __install_saltstack_debian_repository() { return 1 fi + echodebug "DGM Debian A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3483,9 +3504,15 @@ __install_saltstack_debian_repository() { } __install_saltstack_debian_onedir_repository() { + ## DGM Debugging + set -v + set -x + DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" + echodebug "DGM Debian B checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -3719,6 +3746,10 @@ install_debian_12_git_deps() { } install_debian_git() { + ## DGM Debugging + set -v + set -x + if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} else @@ -3824,23 +3855,24 @@ install_debian_git_post() { /bin/systemctl enable "salt-${fname}.service" SYSTEMD_RELOAD=$BS_TRUE - # Install initscripts for Debian 7 "Wheezy" - elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then - __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}" - __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}" + ## DGM # Install initscripts for Debian 7 "Wheezy" + ## DGM elif [ ! -f "/etc/init.d/salt-$fname" ] || \ + ## DGM { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then + ## DGM __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}" + ## DGM __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}" - if [ ! -f "/etc/init.d/salt-${fname}" ]; then - echowarn "The init script for salt-${fname} was not found, skipping it..." - continue - fi + ## DGM if [ ! -f "/etc/init.d/salt-${fname}" ]; then + ## DGM echowarn "The init script for salt-${fname} was not found, skipping it..." + ## DGM continue + ## DGM fi - chmod +x "/etc/init.d/salt-${fname}" + ## DGM chmod +x "/etc/init.d/salt-${fname}" - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ "$fname" = "api" ] && continue + ## DGM # Skip salt-api since the service should be opt-in and not necessarily started on boot + ## DGM [ "$fname" = "api" ] && continue + + ## DGM update-rc.d "salt-${fname}" defaults - update-rc.d "salt-${fname}" defaults fi done } @@ -3909,6 +3941,10 @@ install_debian_check_services() { # __install_saltstack_fedora_onedir_repository() { + ## DGM Debugging + set -v + set -x + if [ "$ITYPE" = "stable" ]; then REPO_REV="$ONEDIR_REV" else @@ -3929,6 +3965,7 @@ __install_saltstack_fedora_onedir_repository() { if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then + ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" fi @@ -3980,6 +4017,10 @@ install_fedora_deps() { } install_fedora_stable() { + ## DGM Debugging + set -v + set -x + if [ "$STABLE_REV" = "latest" ]; then __SALT_VERSION="" else @@ -4238,6 +4279,10 @@ install_fedora_onedir_deps() { install_fedora_onedir() { + ## DGM Debugging + set -v + set -x + STABLE_REV=$ONEDIR_REV #install_fedora_stable || return 1 @@ -4267,6 +4312,10 @@ install_fedora_onedir() { } install_fedora_onedir_post() { + ## DGM Debugging + set -v + set -x + STABLE_REV=$ONEDIR_REV install_fedora_stable_post || return 1 @@ -4282,6 +4331,10 @@ install_fedora_onedir_post() { # CentOS Install Functions # __install_saltstack_rhel_onedir_repository() { + ## DGM Debugging + set -v + set -x + if [ "$ITYPE" = "stable" ]; then repo_rev="$ONEDIR_REV" else @@ -4337,7 +4390,12 @@ _eof return 0 } + install_centos_stable_deps() { + ## DGM Debugging + set -v + set -x + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -4519,6 +4577,10 @@ install_centos_git_deps() { } install_centos_git() { + ## DGM Debugging + set -v + set -x + if [ "${_PY_EXE}" != "" ]; then _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" @@ -4534,6 +4596,10 @@ install_centos_git() { } install_centos_git_post() { + ## DGM Debugging + set -v + set -x + SYSTEMD_RELOAD=$BS_FALSE for fname in api master minion syndic; do @@ -4577,6 +4643,7 @@ install_centos_onedir_deps() { ## DGM Debugging set -v set -x + if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -5677,6 +5744,10 @@ install_amazon_linux_ami_2_git_deps() { } install_amazon_linux_ami_2_deps() { + ## DGM Debugging + set -v + set -x + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -6512,6 +6583,10 @@ install_photon_onedir_deps() { install_photon_onedir() { + ## DGM Debugging + set -v + set -x + STABLE_REV=$ONEDIR_REV __PACKAGES="" @@ -6540,6 +6615,10 @@ install_photon_onedir() { } install_photon_onedir_post() { + ## DGM Debugging + set -v + set -x + STABLE_REV=$ONEDIR_REV install_photon_stable_post || return 1 @@ -7187,6 +7266,10 @@ install_gentoo_git_deps() { } install_gentoo_stable() { + ## DGM Debugging + set -v + set -x + GENTOO_SALT_PACKAGE="app-admin/salt" STABLE_REV_WITHOUT_PREFIX=$(echo "${STABLE_REV}" | sed 's#archive/##') @@ -7214,6 +7297,10 @@ install_gentoo_git() { } install_gentoo_onedir() { + ## DGM Debugging + set -v + set -x + STABLE_REV=${ONEDIR_REV} install_gentoo_stable || return 1 } From b178397b186f059827a34a9266f9909aa7549927 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 13:56:05 -0600 Subject: [PATCH 40/80] Added transport field for docker --- kitchen.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kitchen.yml b/kitchen.yml index 06bae01..d789d47 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -285,3 +285,6 @@ verifier: name: shell remote_exec: false command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ + +transport: + name: docker From 4cb4fc8c2f5341967114b66a2128974fb1c755e4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 14:37:39 -0600 Subject: [PATCH 41/80] added transport docker for MacOS and Windows --- kitchen.macos.yml | 3 +++ kitchen.windows.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 616a489..38ead84 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -40,3 +40,6 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ + +transport: + name: docker diff --git a/kitchen.windows.yml b/kitchen.windows.yml index a2b88e2..2c793e2 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -40,3 +40,6 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ + +transport: + name: docker From 7aad81c0a83af90636ecee26b69682172d57e97b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 14:39:14 -0600 Subject: [PATCH 42/80] Disabled transport docker --- kitchen.macos.yml | 4 ++-- kitchen.windows.yml | 4 ++-- kitchen.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 38ead84..b17b3ca 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -41,5 +41,5 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ -transport: - name: docker +## DGM transport: +## DGM name: docker diff --git a/kitchen.windows.yml b/kitchen.windows.yml index 2c793e2..008223c 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -41,5 +41,5 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ -transport: - name: docker +## DGM transport: +## DGM name: docker diff --git a/kitchen.yml b/kitchen.yml index d789d47..92aa8b8 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -286,5 +286,5 @@ verifier: remote_exec: false command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ -transport: - name: docker +## DGM transport: +## DGM name: docker From af44d56373ad755132c604b6d2e7724b950a44d4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 1 Jul 2024 16:29:40 -0600 Subject: [PATCH 43/80] Updates some more --- .github/workflows/ci.yml | 12 ++-- .github/workflows/templates/generate.py | 6 ++ bootstrap-salt.sh | 90 +++++++++++-------------- 3 files changed, 53 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bb9da6..21181a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,7 +313,7 @@ jobs: distro-slug: debian-12 display-name: Debian 12 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' fedora-39: @@ -327,7 +327,7 @@ jobs: distro-slug: fedora-39 display-name: Fedora 39 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' fedora-40: @@ -341,7 +341,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' gentoo: @@ -439,7 +439,7 @@ jobs: distro-slug: photon-4 display-name: Photon OS 4 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' photon-5: @@ -453,7 +453,7 @@ jobs: distro-slug: photon-5 display-name: Photon OS 5 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' rockylinux-8: @@ -523,7 +523,7 @@ jobs: distro-slug: ubuntu-2404 display-name: Ubuntu 24.04 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' set-pipeline-exit-status: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 51e55dc..dd8fdf9 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -105,10 +105,14 @@ ONEDIR_RC_DISTROS = [ BLACKLIST_3006 = [ "arch", + "debian-12", + "fedora-39", + "fedora-40", "gentoo", "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", + "ubuntu-2404", ] BLACKLIST_3007 = [ @@ -117,6 +121,8 @@ BLACKLIST_3007 = [ "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", + "photon-4", + "photon-5", ] BLACKLIST_GIT_3006 = [ diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index b45c6ef..41216c2 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -602,10 +602,6 @@ if [ "$#" -gt 0 ];then shift fi -## DGM Debugging -set -v -set -x - # Check installation type if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." @@ -1752,11 +1748,6 @@ __check_end_of_life_versions() { esac } -## DGM Debugging -set -v -set -x - - __gather_system_info echo @@ -2974,7 +2965,7 @@ __install_saltstack_ubuntu_repository() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3005,7 +2996,7 @@ __install_saltstack_ubuntu_onedir_repository() { UBUNTU_CODENAME=${DISTRO_CODENAME} fi - echodebug "DGM Ubuntu B checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + echodebug "DGM Ubuntu B checking ONEDIR_REV ,$ONEDIR_REV," # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3021,7 +3012,7 @@ __install_saltstack_ubuntu_onedir_repository() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3078,7 +3069,7 @@ install_ubuntu_deps() { __PACKAGES="${__PACKAGES} procps pciutils" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3153,7 +3144,7 @@ install_ubuntu_git_deps() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3220,7 +3211,7 @@ install_ubuntu_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3283,7 +3274,7 @@ install_ubuntu_onedir() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3473,8 +3464,6 @@ __install_saltstack_debian_repository() { return 1 fi - echodebug "DGM Debian A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," - # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3489,7 +3478,7 @@ __install_saltstack_debian_repository() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086,SC2090 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3511,7 +3500,7 @@ __install_saltstack_debian_onedir_repository() { DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" - echodebug "DGM Debian B checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + echodebug "DGM Debian B checking, ONEDIR_REV ,$ONEDIR_REV," if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" @@ -3532,7 +3521,7 @@ __install_saltstack_debian_onedir_repository() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086,SC2090 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3586,7 +3575,7 @@ install_debian_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3646,7 +3635,7 @@ install_debian_onedir_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3698,7 +3687,7 @@ install_debian_git_deps() { echodebug "install_debian_git_deps() Installing ${__PACKAGES}" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3724,7 +3713,7 @@ install_debian_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -3810,7 +3799,7 @@ install_debian_onedir() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## __apt_get_install_noinput "${__PACKAGES}" || return 1 @@ -4007,7 +3996,7 @@ install_fedora_deps() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 @@ -4049,7 +4038,7 @@ install_fedora_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 @@ -4112,7 +4101,7 @@ install_fedora_git_deps() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 @@ -4260,7 +4249,7 @@ install_fedora_onedir_deps() { __PACKAGES="dnf-utils chkconfig procps-ng" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4302,7 +4291,7 @@ install_fedora_onedir() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4443,7 +4432,7 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig procps-ng findutils" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4476,7 +4465,7 @@ install_centos_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4560,7 +4549,7 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4694,7 +4683,7 @@ install_centos_onedir_deps() { __PACKAGES="yum-utils chkconfig procps-ng findutils" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -4727,7 +4716,7 @@ install_centos_onedir() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -5587,7 +5576,7 @@ install_alpine_linux_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 apk -U add "${__PACKAGES}" || return 1 @@ -5728,7 +5717,7 @@ install_amazon_linux_ami_2_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -5939,7 +5928,7 @@ install_amazon_linux_ami_2023_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 @@ -6095,6 +6084,9 @@ install_arch_linux_stable_deps() { # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-yaml + ## DGM tornado appears to be missing in 3006.x pkg requirements + pacman -Su --noconfirm --needed python${PY_PKG_VER}-tornado + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-apache-libcloud || return 1 @@ -6128,7 +6120,7 @@ install_arch_linux_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" @@ -6377,7 +6369,7 @@ install_photon_deps() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 @@ -6430,7 +6422,7 @@ install_photon_git_deps() { __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 @@ -6564,7 +6556,7 @@ install_photon_onedir_deps() { __PACKAGES="procps-ng" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 @@ -6605,7 +6597,7 @@ install_photon_onedir() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 @@ -6745,7 +6737,7 @@ install_opensuse_stable_deps() { __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests python${PY_PKG_VER}-zypp" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 @@ -6782,7 +6774,7 @@ install_opensuse_git_deps() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 @@ -6818,7 +6810,7 @@ install_opensuse_stable() { fi ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "$__PACKAGES" || return 1 @@ -6982,7 +6974,7 @@ install_opensuse_15_stable_deps() { __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 @@ -7016,7 +7008,7 @@ install_opensuse_15_git_deps() { __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" ## DGM tornado appears to be missing in 3006.x pkg requirements - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" # shellcheck disable=SC2086 ## DGM __zypper_install "${__PACKAGES}" || return 1 From 5d9f9f89f05d7c7539dd8baa4fd5af558c049b7d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 2 Jul 2024 13:57:12 -0600 Subject: [PATCH 44/80] Updates to bootstrap etc --- .github/workflows/ci.yml | 6 +- .github/workflows/templates/generate.py | 6 +- bootstrap-salt.sh | 571 +++++++++++++----------- 3 files changed, 312 insertions(+), 271 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21181a8..a684581 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,7 +327,7 @@ jobs: distro-slug: fedora-39 display-name: Fedora 39 timeout: 20 - instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' fedora-40: @@ -341,7 +341,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 20 - instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' gentoo: @@ -425,7 +425,7 @@ jobs: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' photon-4: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index dd8fdf9..b41f63d 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -106,7 +106,6 @@ ONEDIR_RC_DISTROS = [ BLACKLIST_3006 = [ "arch", "debian-12", - "fedora-39", "fedora-40", "gentoo", "gentoo-systemd", @@ -117,6 +116,7 @@ BLACKLIST_3006 = [ BLACKLIST_3007 = [ "arch", + "fedora-39", "gentoo", "gentoo-systemd", "opensuse-15", @@ -132,7 +132,6 @@ BLACKLIST_GIT_3006 = [ "centos-stream9", "debian-11", "debian-12", - "fedora-39", "fedora-40", "gentoo", "gentoo-systemd", @@ -154,7 +153,6 @@ BLACKLIST_GIT_3007 = [ "debian-11", "debian-12", "fedora-39", - "fedora-40", "gentoo", "gentoo-systemd", "opensuse-15", @@ -228,10 +226,8 @@ GIT_DISTRO_BLACKLIST = [ "almalinux-8", "centos-stream8", "fedora-39", - "fedora-40", "opensuse-15", "oraclelinux-8", - "oraclelinux-9", "rockylinux-8", ] diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 41216c2..f746086 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1939,7 +1939,9 @@ __wait_for_apt(){ WAIT_TIMEOUT=900 ## DGM see if sync'ing the clocks helps - hwclock -s + if [ -f /usr/sbin/hwclock ]; then + /usr/sbin/hwclock -s + fi # Run our passed in apt command "${@}" 2>"$APT_ERR" @@ -2932,56 +2934,61 @@ __enable_universe_repository() { return 0 } -__install_saltstack_ubuntu_repository() { - # Workaround for latest non-LTS Ubuntu - ## DGM Debugging - set -v - set -x - - echodebug "DGM Ubuntu A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," - - if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ - [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then - echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." - UBUNTU_VERSION=24.04 - UBUNTU_CODENAME="noble" - else - UBUNTU_VERSION=${DISTRO_VERSION} - UBUNTU_CODENAME=${DISTRO_CODENAME} - fi - - # Install downloader backend for GPG keys fetching - __PACKAGES='wget' - - # Required as it is not installed by default on Ubuntu 18+ - if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then - __PACKAGES="${__PACKAGES} gnupg" - fi - - # Make sure https transport is available - if [ "$HTTP_VAL" = "https" ] ; then - __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" - fi - - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - # shellcheck disable=SC2086,SC2090 - __apt_get_install_noinput ${__PACKAGES} || return 1 - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python version is not supported, only Python 3" - return 1 - fi - - # SaltStack's stable Ubuntu repository: - SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" - echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list - __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - - __wait_for_apt apt-get update || return 1 -} +## DGM __install_saltstack_ubuntu_repository() { +## DGM # Workaround for latest non-LTS Ubuntu +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM echodebug "DGM Ubuntu A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," +## DGM +## DGM if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ +## DGM { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ +## DGM [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then +## DGM echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." +## DGM UBUNTU_VERSION=24.04 +## DGM UBUNTU_CODENAME="noble" +## DGM else +## DGM UBUNTU_VERSION=${DISTRO_VERSION} +## DGM UBUNTU_CODENAME=${DISTRO_CODENAME} +## DGM fi +## DGM +## DGM # Install downloader backend for GPG keys fetching +## DGM __PACKAGES='wget' +## DGM +## DGM # Required as it is not installed by default on Ubuntu 18+ +## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then +## DGM __PACKAGES="${__PACKAGES} gnupg" +## DGM fi +## DGM +## DGM # Make sure https transport is available +## DGM if [ "$HTTP_VAL" = "https" ] ; then +## DGM __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" +## DGM fi +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM ## DGM include hwclock if not part of base OS (23.10 and up) +## DGM if [ ! -f /usr/sbin/hwclock ]; then +## DGM __PACKAGES="${__PACKAGES} util-linux-extra" +## DGM fi +## DGM +## DGM # shellcheck disable=SC2086,SC2090 +## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python version is not supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM # SaltStack's stable Ubuntu repository: +## DGM SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" +## DGM echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list +## DGM __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 +## DGM +## DGM __wait_for_apt apt-get update || return 1 +## DGM } __install_saltstack_ubuntu_onedir_repository() { # Workaround for latest non-LTS Ubuntu @@ -3014,6 +3021,11 @@ __install_saltstack_ubuntu_onedir_repository() { ## DGM tornado appears to be missing in 3006.x pkg requirements ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM include hwclock if not part of base OS (23.10 and up) + if [ ! -f /usr/sbin/hwclock ]; then + __PACKAGES="${__PACKAGES} util-linux-extra" + fi + # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3071,6 +3083,11 @@ install_ubuntu_deps() { ## DGM tornado appears to be missing in 3006.x pkg requirements ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM include hwclock if not part of base OS (23.10 and up) + if [ ! -f /usr/sbin/hwclock ]; then + __PACKAGES="${__PACKAGES} util-linux-extra" + fi + # shellcheck disable=SC2086,SC2090 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3083,38 +3100,38 @@ install_ubuntu_deps() { return 0 } -install_ubuntu_stable_deps() { - if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then - echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." - fi - - # No user interaction, libc6 restart services for example - export DEBIAN_FRONTEND=noninteractive - - __wait_for_apt apt-get update || return 1 - - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style - ## also apt-key is deprecated - if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 - else - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && - apt-key update && apt-get update || return 1 - fi - fi - - __apt_get_upgrade_noinput || return 1 - fi - - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then - __check_dpkg_architecture || return 1 - __install_saltstack_ubuntu_repository || return 1 - fi - - install_ubuntu_deps || return 1 -} +## DGM install_ubuntu_stable_deps() { +## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then +## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." +## DGM fi +## DGM +## DGM # No user interaction, libc6 restart services for example +## DGM export DEBIAN_FRONTEND=noninteractive +## DGM +## DGM __wait_for_apt apt-get update || return 1 +## DGM +## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then +## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then +## DGM ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style +## DGM ## also apt-key is deprecated +## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 +## DGM else +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && +## DGM apt-key update && apt-get update || return 1 +## DGM fi +## DGM fi +## DGM +## DGM __apt_get_upgrade_noinput || return 1 +## DGM fi +## DGM +## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then +## DGM __check_dpkg_architecture || return 1 +## DGM __install_saltstack_ubuntu_repository || return 1 +## DGM fi +## DGM +## DGM install_ubuntu_deps || return 1 +## DGM } install_ubuntu_git_deps() { ## DGM Debugging @@ -3146,6 +3163,11 @@ install_ubuntu_git_deps() { ## DGM tornado appears to be missing in 3006.x pkg requirements ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM include hwclock if not part of base OS (23.10 and up) + if [ ! -f /usr/sbin/hwclock ]; then + __PACKAGES="${__PACKAGES} util-linux-extra" + fi + # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -3451,46 +3473,46 @@ install_ubuntu_check_services() { # # Debian Install Functions # -__install_saltstack_debian_repository() { - ## DGM Debugging - set -v - set -x - - DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" - DEBIAN_CODENAME="$DISTRO_CODENAME" - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python version is no longer supported, only Python 3" - return 1 - fi - - # Install downloader backend for GPG keys fetching - __PACKAGES='wget' - - # Required as it is not installed by default on Debian 9+ - if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then - __PACKAGES="${__PACKAGES} gnupg2" - fi - - # Make sure https transport is available - if [ "$HTTP_VAL" = "https" ] ; then - __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" - fi - - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - # shellcheck disable=SC2086,SC2090 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - __apt_get_install_noinput ${__PACKAGES} || return 1 - - SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" - echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" - - __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 - - __wait_for_apt apt-get update || return 1 -} +## DGM __install_saltstack_debian_repository() { +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" +## DGM DEBIAN_CODENAME="$DISTRO_CODENAME" +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python version is no longer supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM # Install downloader backend for GPG keys fetching +## DGM __PACKAGES='wget' +## DGM +## DGM # Required as it is not installed by default on Debian 9+ +## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then +## DGM __PACKAGES="${__PACKAGES} gnupg2" +## DGM fi +## DGM +## DGM # Make sure https transport is available +## DGM if [ "$HTTP_VAL" = "https" ] ; then +## DGM __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" +## DGM fi +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM # shellcheck disable=SC2086,SC2090 +## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${STABLE_REV}" +## DGM echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" +## DGM +## DGM __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 +## DGM +## DGM __wait_for_apt apt-get update || return 1 +## DGM } __install_saltstack_debian_onedir_repository() { ## DGM Debugging @@ -3528,73 +3550,73 @@ __install_saltstack_debian_onedir_repository() { __apt_get_install_noinput ${__PACKAGES} || return 1 # amd64 is just a part of repository URI - SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${ONEDIR_REV}/" + SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then - SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/" + SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}" fi echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" - __apt_key_fetch "${SALTSTACK_DEBIAN_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 + __apt_key_fetch "${SALTSTACK_DEBIAN_URL}/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 __wait_for_apt apt-get update || return 1 } -install_debian_deps() { - if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then - echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." - fi - - # No user interaction, libc6 restart services for example - export DEBIAN_FRONTEND=noninteractive - - __wait_for_apt apt-get update || return 1 - - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then - # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 - else - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && - apt-key update && apt-get update || return 1 - fi - fi - - __apt_get_upgrade_noinput || return 1 - fi - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python version is no longer supported, only Python 3" - return 1 - fi - - # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 - __PACKAGES='procps pciutils' - - # YAML module is used for generating custom master/minion configs - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" - - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - __apt_get_install_noinput ${__PACKAGES} || return 1 - - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then - __check_dpkg_architecture || return 1 - __install_saltstack_debian_repository || return 1 - fi - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 - __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 - fi - - return 0 -} +## DGM install_debian_deps() { +## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then +## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." +## DGM fi +## DGM +## DGM # No user interaction, libc6 restart services for example +## DGM export DEBIAN_FRONTEND=noninteractive +## DGM +## DGM __wait_for_apt apt-get update || return 1 +## DGM +## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then +## DGM # Try to update GPG keys first if allowed +## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then +## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 +## DGM else +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && +## DGM apt-key update && apt-get update || return 1 +## DGM fi +## DGM fi +## DGM +## DGM __apt_get_upgrade_noinput || return 1 +## DGM fi +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python version is no longer supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 +## DGM __PACKAGES='procps pciutils' +## DGM +## DGM # YAML module is used for generating custom master/minion configs +## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then +## DGM __check_dpkg_architecture || return 1 +## DGM __install_saltstack_debian_repository || return 1 +## DGM fi +## DGM +## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then +## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 +## DGM fi +## DGM +## DGM return 0 +## DGM } install_debian_onedir_deps() { ## DGM Debugging @@ -3675,7 +3697,7 @@ install_debian_git_pre() { } install_debian_git_deps() { - install_debian_deps || return 1 + install_debian_onedir_deps || return 1 install_debian_git_pre || return 1 if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then @@ -4005,86 +4027,86 @@ install_fedora_deps() { return 0 } -install_fedora_stable() { - ## DGM Debugging - set -v - set -x - - if [ "$STABLE_REV" = "latest" ]; then - __SALT_VERSION="" - else - __SALT_VERSION="$(dnf list --showduplicates salt | grep "$STABLE_REV" | head -n 1 | awk '{print $2}')" - # shellcheck disable=SC2268 - if [ "x${__SALT_VERSION}" = "x" ]; then - echoerror "Could not find a stable install for Salt ${STABLE_REV}" - exit 1 - fi - echoinfo "Installing Stable Package Version ${__SALT_VERSION}" - __SALT_VERSION="-${__SALT_VERSION}" - fi - __PACKAGES="" - - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then - __PACKAGES="${__PACKAGES} salt-cloud${__SALT_VERSION}" - fi - if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then - __PACKAGES="${__PACKAGES} salt-master${__SALT_VERSION}" - fi - if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then - __PACKAGES="${__PACKAGES} salt-minion${__SALT_VERSION}" - fi - if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then - __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" - fi - - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - # shellcheck disable=SC2086 - ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 - __dnf_install_noinput ${__PACKAGES} || return 1 - - ## DGM __python="python3" - if ! __check_command_exists python3; then - echoerror "Could not find a python3 binary?!" - return 1 - fi - -## DGM if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then -## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" -## DGM __installed_tornado_rpm=$(rpm -qa | grep python${PY_PKG_VER}-tornado) -## DGM if [ -n "${__installed_tornado_rpm}" ]; then -## DGM echodebug "Removing system package ${__installed_tornado_rpm}" -## DGM rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 +## DGM install_fedora_stable() { +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM if [ "$STABLE_REV" = "latest" ]; then +## DGM __SALT_VERSION="" +## DGM else +## DGM __SALT_VERSION="$(dnf list --showduplicates salt | grep "$STABLE_REV" | head -n 1 | awk '{print $2}')" +## DGM # shellcheck disable=SC2268 +## DGM if [ "x${__SALT_VERSION}" = "x" ]; then +## DGM echoerror "Could not find a stable install for Salt ${STABLE_REV}" +## DGM exit 1 ## DGM fi -## DGM __get_site_packages_dir_code=$(cat << EOM -## DGM import site -## DGM print([d for d in site.getsitepackages() if d.startswith('/usr/lib/python')][0]) -## DGM EOM -## DGM ) -## DGM __target_path=$(${__python} -c "${__get_site_packages_dir_code}") -## DGM echodebug "Running '${__python}' -m pip install --target ${__target_path} 'tornado<5.0'" -## DGM "${__python}" -m pip install --target "${__target_path}" "tornado<5" || return 1 +## DGM echoinfo "Installing Stable Package Version ${__SALT_VERSION}" +## DGM __SALT_VERSION="-${__SALT_VERSION}" ## DGM fi +## DGM __PACKAGES="" +## DGM +## DGM if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then +## DGM __PACKAGES="${__PACKAGES} salt-cloud${__SALT_VERSION}" +## DGM fi +## DGM if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then +## DGM __PACKAGES="${__PACKAGES} salt-master${__SALT_VERSION}" +## DGM fi +## DGM if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then +## DGM __PACKAGES="${__PACKAGES} salt-minion${__SALT_VERSION}" +## DGM fi +## DGM if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then +## DGM __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" +## DGM fi +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 +## DGM __dnf_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM ## DGM __python="python3" +## DGM if ! __check_command_exists python3; then +## DGM echoerror "Could not find a python3 binary?!" +## DGM return 1 +## DGM fi +## DGM +## DGM ## DGM if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then +## DGM ## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" +## DGM ## DGM __installed_tornado_rpm=$(rpm -qa | grep python${PY_PKG_VER}-tornado) +## DGM ## DGM if [ -n "${__installed_tornado_rpm}" ]; then +## DGM ## DGM echodebug "Removing system package ${__installed_tornado_rpm}" +## DGM ## DGM rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 +## DGM ## DGM fi +## DGM ## DGM __get_site_packages_dir_code=$(cat << EOM +## DGM ## DGM import site +## DGM ## DGM print([d for d in site.getsitepackages() if d.startswith('/usr/lib/python')][0]) +## DGM ## DGM EOM +## DGM ## DGM ) +## DGM ## DGM __target_path=$(${__python} -c "${__get_site_packages_dir_code}") +## DGM ## DGM echodebug "Running '${__python}' -m pip install --target ${__target_path} 'tornado<5.0'" +## DGM ## DGM "${__python}" -m pip install --target "${__target_path}" "tornado<5" || return 1 +## DGM ## DGM fi +## DGM +## DGM return 0 +## DGM } - return 0 -} - -install_fedora_stable_post() { - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue - - # Skip if not meant to be installed - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - - systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) - sleep 1 - systemctl daemon-reload - done -} +## DGM install_fedora_stable_post() { +## DGM for fname in api master minion syndic; do +## DGM # Skip salt-api since the service should be opt-in and not necessarily started on boot +## DGM [ $fname = "api" ] && continue +## DGM +## DGM # Skip if not meant to be installed +## DGM [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue +## DGM [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue +## DGM [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue +## DGM +## DGM systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) +## DGM sleep 1 +## DGM systemctl daemon-reload +## DGM done +## DGM } install_fedora_git_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then @@ -4306,10 +4328,27 @@ install_fedora_onedir_post() { set -x STABLE_REV=$ONEDIR_REV - install_fedora_stable_post || return 1 + + ## DGM install_fedora_stable_post || return 1 + ## DGM this was the only caller to install_fedora_stable_post, so moved it here + + for fname in api master minion syndic; do + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + # Skip if not meant to be installed + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + sleep 1 + systemctl daemon-reload + done return 0 } + # # Ended Fedora Install Functions # @@ -6326,9 +6365,15 @@ __install_saltstack_photon_onedir_repository() { REPO_FILE="/etc/yum.repos.d/salt.repo" if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then - FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" + ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" + ## DGM if [ "${ONEDIR_REV}" = "nightly" ] ; then + ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" + ## DGM fi + + ## DGM the salt repo has issues, need the Major version dot Zero, eg: 4.0, 5.0 + FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}.0/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then - FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" + FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}.0/${CPU_ARCH_L}/" fi __fetch_url "${REPO_FILE}" "${FETCH_URL}.repo" From 0cc3cc57ac53391caccce7e5eb8936bd56e884f0 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 2 Jul 2024 14:54:14 -0600 Subject: [PATCH 45/80] Updates some more --- bootstrap-salt.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f746086..82dc913 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2772,7 +2772,9 @@ EOM echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" - ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" + + ### DGM ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" + ${_pip_cmd} install --break-system-packages --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" echoinfo "Installing salt using ${_py_exe}" cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -2786,7 +2788,8 @@ EOM echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 - ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 + ## DGM ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 + ${_pip_cmd} install --break-system-packages --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 rm -f /tmp/git/deps/* echoinfo "Building Salt Python Wheel" @@ -3243,6 +3246,10 @@ install_ubuntu_stable() { } install_ubuntu_git() { + ## DGM Debugging + set -v + set -x + # Activate virtualenv before install if [ "${_VIRTUALENV_DIR}" != "null" ]; then __activate_virtualenv || return 1 @@ -6464,11 +6471,18 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" + ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" + __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64 cython${PY_PKG_VER}" ## DGM tornado appears to be missing in 3006.x pkg requirements ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + ## DGM Photon 5 container is missing systemd on default installation + if [ "${DISTRO_MAJOR_VERSION}" -ge 5 ]; then + # Photon 5 container is missing systemd on default installation + __PACKAGES="${__PACKAGES} systemd" + fi + # shellcheck disable=SC2086 ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 From 91e7e8922fa6051f4b2b0c4deaf3ad93885d343c Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 2 Jul 2024 15:27:05 -0600 Subject: [PATCH 46/80] Adjust code for 'break-system-packages' on pip install and fix missing oraclelinux-9 --- bootstrap-salt.sh | 13 +++++++++++-- kitchen.yml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 82dc913..5a78d96 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2770,11 +2770,20 @@ EOM return 1 fi + _USE_BREAK_SYSTEM_PACKAGES="" + _PIP_VERSION=$(${_pip_cmd} --version | awk '{print $2}') + + # shellcheck disable=SC2086,SC2090 + if [ ${_PIP_VERSION} -ge 24 ]; then + _USE_BREAK_SYSTEM_PACKAGES="--break-system-packages" + echodebug "pip command is greater than / equal 24, using ${_USE_BREAK_SYSTEM_PACKAGES}" + fi + echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" ### DGM ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" - ${_pip_cmd} install --break-system-packages --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" + ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" echoinfo "Installing salt using ${_py_exe}" cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -2789,7 +2798,7 @@ EOM echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 ## DGM ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 - ${_pip_cmd} install --break-system-packages --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 + ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 rm -f /tmp/git/deps/* echoinfo "Building Salt Python Wheel" diff --git a/kitchen.yml b/kitchen.yml index 92aa8b8..6e97072 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -114,7 +114,7 @@ platforms: - *opensuse_provision_command_02 - *opensuse_provision_command_03 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: oraclelinux-8 + - name: oraclelinux-9 - name: rockylinux-9 driver: platform: centosstream From c43d47000aef9df8a1bdc19aed8b0b9e2ac2af7b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 10:00:22 -0600 Subject: [PATCH 47/80] Added debugging for Debian git-master --- bootstrap-salt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5a78d96..f8d8914 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -619,6 +619,7 @@ if [ "$ITYPE" = "git" ]; then # Disable shell warning about unbound variable during git install STABLE_REV="latest" + ONEDIR_REV="latest" # If doing stable install, check if version specified elif [ "$ITYPE" = "stable" ]; then @@ -3534,6 +3535,7 @@ __install_saltstack_debian_onedir_repository() { ## DGM Debugging set -v set -x + echodebug "__install_saltstack_debian_onedir_repository() entry" DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" @@ -3638,6 +3640,11 @@ install_debian_onedir_deps() { ## DGM Debugging set -v set -x + + echodebug "install_debian_onedir_git_deps() entry" + + echodebug "DGM Debian A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi From bbd6498cd80e7fd70107c4acbe0e8cd247ccdd39 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 11:36:05 -0600 Subject: [PATCH 48/80] Removed support for Centos Stream 8, EOL 2024-05-31, and added more debug, and revisited git for Debian and Ubuntu --- .github/workflows/ci.yml | 15 - .github/workflows/templates/generate.py | 10 +- bootstrap-salt.sh | 399 +++++++++++++----------- kitchen.yml | 6 +- 4 files changed, 222 insertions(+), 208 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a684581..b0ea9d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -260,20 +260,6 @@ jobs: instances: '["git-master", "latest", "default"]' - centos-stream8: - name: CentOS Stream 8 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: centos-stream8 - display-name: CentOS Stream 8 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - - centos-stream9: name: CentOS Stream 9 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -543,7 +529,6 @@ jobs: - amazon-2 - amazon-2023 - arch - - centos-stream8 - centos-stream9 - debian-11 - debian-12 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index b41f63d..72c0c10 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -6,13 +6,13 @@ import pathlib os.chdir(os.path.abspath(os.path.dirname(__file__))) +## DGM "centos-stream8", LINUX_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", "amazon-2023", "arch", - "centos-stream8", "centos-stream9", "debian-11", "debian-12", @@ -43,13 +43,13 @@ OSX = [ ] +## DGM "centos-stream8", STABLE_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", "amazon-2023", "arch", - "centos-stream8", "centos-stream9", "debian-11", "debian-12", @@ -68,12 +68,12 @@ STABLE_DISTROS = [ "ubuntu-2404", ] +## DGM "centos-stream8", ONEDIR_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", "amazon-2023", - "centos-stream8", "centos-stream9", "debian-11", "debian-12", @@ -222,9 +222,9 @@ GIT_VERSION_BLACKLIST = [ # SetuptoolsDeprecationWarning: setup.py install is deprecated. # Use build and pip and other standards-based tools. # +## DGM "centos-stream8", GIT_DISTRO_BLACKLIST = [ "almalinux-8", - "centos-stream8", "fedora-39", "opensuse-15", "oraclelinux-8", @@ -236,13 +236,13 @@ LATEST_PKG_BLACKLIST = [ "gentoo-systemd", ] +## DGM "centos-stream8": "CentOS Stream 8", DISTRO_DISPLAY_NAMES = { "almalinux-8": "AlmaLinux 8", "almalinux-9": "AlmaLinux 9", "amazon-2": "Amazon 2", "amazon-2023": "Amazon 2023", "arch": "Arch", - "centos-stream8": "CentOS Stream 8", "centos-stream9": "CentOS Stream 9", "debian-11": "Debian 11", "debian-12": "Debian 12", diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f8d8914..e1cca97 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -619,7 +619,6 @@ if [ "$ITYPE" = "git" ]; then # Disable shell warning about unbound variable during git install STABLE_REV="latest" - ONEDIR_REV="latest" # If doing stable install, check if version specified elif [ "$ITYPE" = "stable" ]; then @@ -2107,6 +2106,9 @@ __tdnf_install_noinput() { # specific revision. #---------------------------------------------------------------------------------------------------------------------- __git_clone_and_checkout() { + ## DGM Debugging + set -v + set -x echodebug "Installed git version: $(git --version | awk '{ print $3 }')" # Turn off SSL verification if -I flag was set for insecure downloads @@ -2947,61 +2949,63 @@ __enable_universe_repository() { return 0 } -## DGM __install_saltstack_ubuntu_repository() { -## DGM # Workaround for latest non-LTS Ubuntu -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM echodebug "DGM Ubuntu A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," -## DGM -## DGM if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ -## DGM { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ -## DGM [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then -## DGM echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." -## DGM UBUNTU_VERSION=24.04 -## DGM UBUNTU_CODENAME="noble" -## DGM else -## DGM UBUNTU_VERSION=${DISTRO_VERSION} -## DGM UBUNTU_CODENAME=${DISTRO_CODENAME} -## DGM fi -## DGM -## DGM # Install downloader backend for GPG keys fetching -## DGM __PACKAGES='wget' -## DGM -## DGM # Required as it is not installed by default on Ubuntu 18+ -## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then -## DGM __PACKAGES="${__PACKAGES} gnupg" -## DGM fi -## DGM -## DGM # Make sure https transport is available -## DGM if [ "$HTTP_VAL" = "https" ] ; then -## DGM __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" -## DGM fi -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM ## DGM include hwclock if not part of base OS (23.10 and up) -## DGM if [ ! -f /usr/sbin/hwclock ]; then -## DGM __PACKAGES="${__PACKAGES} util-linux-extra" -## DGM fi -## DGM -## DGM # shellcheck disable=SC2086,SC2090 -## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python version is not supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM # SaltStack's stable Ubuntu repository: -## DGM SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" -## DGM echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list -## DGM __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 -## DGM -## DGM __wait_for_apt apt-get update || return 1 -## DGM } +__install_saltstack_ubuntu_repository() { + # Workaround for latest non-LTS Ubuntu + ## DGM Debugging + set -v + set -x + + echodebug "__install_saltstack_ubuntu_repository() entry" + + echodebug "DGM Ubuntu D checking STABLE_REV ,${STABLE_REV}," + + if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ + [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then + echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." + UBUNTU_VERSION=24.04 + UBUNTU_CODENAME="noble" + else + UBUNTU_VERSION=${DISTRO_VERSION} + UBUNTU_CODENAME=${DISTRO_CODENAME} + fi + + # Install downloader backend for GPG keys fetching + __PACKAGES='wget' + + # Required as it is not installed by default on Ubuntu 18+ + if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then + __PACKAGES="${__PACKAGES} gnupg" + fi + + # Make sure https transport is available + if [ "$HTTP_VAL" = "https" ] ; then + __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" + fi + + ## DGM tornado appears to be missing in 3006.x pkg requirements + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + + ## DGM include hwclock if not part of base OS (23.10 and up) + if [ ! -f /usr/sbin/hwclock ]; then + __PACKAGES="${__PACKAGES} util-linux-extra" + fi + + # shellcheck disable=SC2086,SC2090 + __apt_get_install_noinput ${__PACKAGES} || return 1 + + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is not supported, only Python 3" + return 1 + fi + + # SaltStack's stable Ubuntu repository: + SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}" + echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list + __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 + + __wait_for_apt apt-get update || return 1 +} __install_saltstack_ubuntu_onedir_repository() { # Workaround for latest non-LTS Ubuntu @@ -3113,44 +3117,52 @@ install_ubuntu_deps() { return 0 } -## DGM install_ubuntu_stable_deps() { -## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then -## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." -## DGM fi -## DGM -## DGM # No user interaction, libc6 restart services for example -## DGM export DEBIAN_FRONTEND=noninteractive -## DGM -## DGM __wait_for_apt apt-get update || return 1 -## DGM -## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then -## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then -## DGM ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style -## DGM ## also apt-key is deprecated -## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 -## DGM else -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && -## DGM apt-key update && apt-get update || return 1 -## DGM fi -## DGM fi -## DGM -## DGM __apt_get_upgrade_noinput || return 1 -## DGM fi -## DGM -## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then -## DGM __check_dpkg_architecture || return 1 -## DGM __install_saltstack_ubuntu_repository || return 1 -## DGM fi -## DGM -## DGM install_ubuntu_deps || return 1 -## DGM } +install_ubuntu_stable_deps() { + ## DGM Debugging + set -v + set -x + + echodebug "install_ubuntu_stable_deps() entry" + + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then + echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." + fi + + # No user interaction, libc6 restart services for example + export DEBIAN_FRONTEND=noninteractive + + __wait_for_apt apt-get update || return 1 + + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style + ## also apt-key is deprecated + if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then + __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 + else + __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && + apt-key update && apt-get update || return 1 + fi + fi + + __apt_get_upgrade_noinput || return 1 + fi + + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + __check_dpkg_architecture || return 1 + __install_saltstack_ubuntu_repository || return 1 + fi + + install_ubuntu_deps || return 1 +} install_ubuntu_git_deps() { ## DGM Debugging set -v set -x + echodebug "install_ubuntu_git_deps() entry" + __wait_for_apt apt-get update || return 1 if ! __check_command_exists git; then @@ -3184,6 +3196,8 @@ install_ubuntu_git_deps() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 + install_ubuntu_stable_deps || return 1 + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" @@ -3490,46 +3504,49 @@ install_ubuntu_check_services() { # # Debian Install Functions # -## DGM __install_saltstack_debian_repository() { -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" -## DGM DEBIAN_CODENAME="$DISTRO_CODENAME" -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python version is no longer supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM # Install downloader backend for GPG keys fetching -## DGM __PACKAGES='wget' -## DGM -## DGM # Required as it is not installed by default on Debian 9+ -## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then -## DGM __PACKAGES="${__PACKAGES} gnupg2" -## DGM fi -## DGM -## DGM # Make sure https transport is available -## DGM if [ "$HTTP_VAL" = "https" ] ; then -## DGM __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" -## DGM fi -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM # shellcheck disable=SC2086,SC2090 -## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${STABLE_REV}" -## DGM echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" -## DGM -## DGM __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 -## DGM -## DGM __wait_for_apt apt-get update || return 1 -## DGM } +__install_saltstack_debian_repository() { + ## DGM Debugging + set -v + set -x + echodebug "__install_saltstack_debian_repository() entry" + + echodebug "DGM Debian C checking STABLE_REV ,${STABLE_REV}," + + DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" + DEBIAN_CODENAME="$DISTRO_CODENAME" + + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi + + # Install downloader backend for GPG keys fetching + __PACKAGES='wget' + + # Required as it is not installed by default on Debian 9+ + if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then + __PACKAGES="${__PACKAGES} gnupg2" + fi + + # Make sure https transport is available + if [ "$HTTP_VAL" = "https" ] ; then + __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" + fi + + ## DGM tornado appears to be missing in 3006.x pkg requirements + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + + # shellcheck disable=SC2086,SC2090 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 + + SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${STABLE_REV}" + echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list" + + __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1 + + __wait_for_apt apt-get update || return 1 +} __install_saltstack_debian_onedir_repository() { ## DGM Debugging @@ -3579,62 +3596,68 @@ __install_saltstack_debian_onedir_repository() { __wait_for_apt apt-get update || return 1 } -## DGM install_debian_deps() { -## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then -## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." -## DGM fi -## DGM -## DGM # No user interaction, libc6 restart services for example -## DGM export DEBIAN_FRONTEND=noninteractive -## DGM -## DGM __wait_for_apt apt-get update || return 1 -## DGM -## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then -## DGM # Try to update GPG keys first if allowed -## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then -## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 -## DGM else -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && -## DGM apt-key update && apt-get update || return 1 -## DGM fi -## DGM fi -## DGM -## DGM __apt_get_upgrade_noinput || return 1 -## DGM fi -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python version is no longer supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 -## DGM __PACKAGES='procps pciutils' -## DGM -## DGM # YAML module is used for generating custom master/minion configs -## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then -## DGM __check_dpkg_architecture || return 1 -## DGM __install_saltstack_debian_repository || return 1 -## DGM fi -## DGM -## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then -## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 -## DGM fi -## DGM -## DGM return 0 -## DGM } +install_debian_deps() { + ## DGM Debugging + set -v + set -x + + echodebug "install_debian_deps() entry" + + if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then + echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." + fi + + # No user interaction, libc6 restart services for example + export DEBIAN_FRONTEND=noninteractive + + __wait_for_apt apt-get update || return 1 + + if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then + # Try to update GPG keys first if allowed + if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then + __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 + else + __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && + apt-key update && apt-get update || return 1 + fi + fi + + __apt_get_upgrade_noinput || return 1 + fi + + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then + echoerror "Python version is no longer supported, only Python 3" + return 1 + fi + + # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 + __PACKAGES='procps pciutils' + + # YAML module is used for generating custom master/minion configs + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" + + ## DGM tornado appears to be missing in 3006.x pkg requirements + ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" + + # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 + __apt_get_install_noinput ${__PACKAGES} || return 1 + + if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then + __check_dpkg_architecture || return 1 + __install_saltstack_debian_repository || return 1 + fi + + if [ "${_EXTRA_PACKAGES}" != "" ]; then + echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" + # shellcheck disable=SC2086 + ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 + __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 + fi + + return 0 +} install_debian_onedir_deps() { ## DGM Debugging @@ -3720,7 +3743,13 @@ install_debian_git_pre() { } install_debian_git_deps() { - install_debian_onedir_deps || return 1 + ## DGM Debugging + set -v + set -x + + echodebug "install_debian_git_deps() entry" + + install_debian_deps || return 1 install_debian_git_pre || return 1 if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then diff --git a/kitchen.yml b/kitchen.yml index 6e97072..ee6c8eb 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -66,9 +66,9 @@ platforms: - update-crypto-policies --set DEFAULT:SHA1 ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream8 - driver: - image: quay.io/centos/centos:stream8 + ## DGM - name: centos-stream8 + ## DGM driver: + ## DGM image: quay.io/centos/centos:stream8 - name: debian-11 driver: image: debian:bullseye From 97afdfbce5d83a4068f86651192cb346d53f7f8d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 13:54:30 -0600 Subject: [PATCH 49/80] Updated git install for Ubuntu and Debian --- bootstrap-salt.sh | 220 +++++++++++++++++++++++++++++----------------- 1 file changed, 137 insertions(+), 83 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e1cca97..87e642d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3196,7 +3196,7 @@ install_ubuntu_git_deps() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - install_ubuntu_stable_deps || return 1 + ## DGM install_ubuntu_stable_deps || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -3596,68 +3596,68 @@ __install_saltstack_debian_onedir_repository() { __wait_for_apt apt-get update || return 1 } -install_debian_deps() { - ## DGM Debugging - set -v - set -x - - echodebug "install_debian_deps() entry" - - if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then - echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." - fi - - # No user interaction, libc6 restart services for example - export DEBIAN_FRONTEND=noninteractive - - __wait_for_apt apt-get update || return 1 - - if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then - # Try to update GPG keys first if allowed - if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 - else - __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && - apt-key update && apt-get update || return 1 - fi - fi - - __apt_get_upgrade_noinput || return 1 - fi - - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then - echoerror "Python version is no longer supported, only Python 3" - return 1 - fi - - # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 - __PACKAGES='procps pciutils' - - # YAML module is used for generating custom master/minion configs - __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" - - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 - __apt_get_install_noinput ${__PACKAGES} || return 1 - - if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then - __check_dpkg_architecture || return 1 - __install_saltstack_debian_repository || return 1 - fi - - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 - __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 - fi - - return 0 -} +## DGM install_debian_deps() { +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM echodebug "install_debian_deps() entry" +## DGM +## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then +## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." +## DGM fi +## DGM +## DGM # No user interaction, libc6 restart services for example +## DGM export DEBIAN_FRONTEND=noninteractive +## DGM +## DGM __wait_for_apt apt-get update || return 1 +## DGM +## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then +## DGM # Try to update GPG keys first if allowed +## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then +## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 +## DGM else +## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && +## DGM apt-key update && apt-get update || return 1 +## DGM fi +## DGM fi +## DGM +## DGM __apt_get_upgrade_noinput || return 1 +## DGM fi +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python version is no longer supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 +## DGM __PACKAGES='procps pciutils' +## DGM +## DGM # YAML module is used for generating custom master/minion configs +## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then +## DGM __check_dpkg_architecture || return 1 +## DGM __install_saltstack_debian_repository || return 1 +## DGM fi +## DGM +## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then +## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 +## DGM fi +## DGM +## DGM return 0 +## DGM } install_debian_onedir_deps() { ## DGM Debugging @@ -3666,7 +3666,7 @@ install_debian_onedir_deps() { echodebug "install_debian_onedir_git_deps() entry" - echodebug "DGM Debian A checking STABLE_REV ,${STABLE_REV}, ONEDIR_REV ,$ONEDIR_REV," + echodebug "DGM Debian A checking ONEDIR_REV ,$ONEDIR_REV," if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." @@ -3724,23 +3724,29 @@ install_debian_onedir_deps() { return 0 } -install_debian_git_pre() { - if ! __check_command_exists git; then - __apt_get_install_noinput git || return 1 - fi - - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - __apt_get_install_noinput ca-certificates - fi - - __git_clone_and_checkout || return 1 - - # Let's trigger config_salt() - if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" - fi -} +## DGM install_debian_git_pre() { +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM echodebug "install_debian_git_pre() entry" +## DGM +## DGM if ! __check_command_exists git; then +## DGM __apt_get_install_noinput git || return 1 +## DGM fi +## DGM +## DGM if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then +## DGM __apt_get_install_noinput ca-certificates +## DGM fi +## DGM +## DGM __git_clone_and_checkout || return 1 +## DGM +## DGM # Let's trigger config_salt() +## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then +## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" +## DGM CONFIG_SALT_FUNC="config_salt" +## DGM fi +## DGM } install_debian_git_deps() { ## DGM Debugging @@ -3749,8 +3755,21 @@ install_debian_git_deps() { echodebug "install_debian_git_deps() entry" - install_debian_deps || return 1 - install_debian_git_pre || return 1 + __wait_for_apt apt-get update || return 1 + + ## DGM ? if ! __check_command_exists git; then + ## DGM ? __apt_get_install_noinput git || return 1 + ## DGM ? fi + + if ! __check_command_exists git; then + __apt_get_install_noinput git-core || return 1 + fi + + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + __apt_get_install_noinput ca-certificates + fi + + __git_clone_and_checkout || return 1 if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" @@ -3767,9 +3786,44 @@ install_debian_git_deps() { ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 + # Let's trigger config_salt() + if [ "$_TEMP_CONFIG_DIR" = "null" ]; then + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + CONFIG_SALT_FUNC="config_salt" + fi + return 0 } +## DGM DGM ------------------------------------- +## DGM ## DGM Debugging +## DGM set -v +## DGM set -x +## DGM +## DGM echodebug "install_debian_git_deps() entry" +## DGM +## DGM install_debian_deps || return 1 +## DGM install_debian_git_pre || return 1 +## DGM +## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then +## DGM echoerror "Python version is no longer supported, only Python 3" +## DGM return 1 +## DGM fi +## DGM +## DGM __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" +## DGM echodebug "install_debian_git_deps() Installing ${__PACKAGES}" +## DGM +## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements +## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" +## DGM +## DGM # shellcheck disable=SC2086 +## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 +## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 +## DGM +## DGM return 0 +## DGM +## DGM } + install_debian_stable() { __PACKAGES="" From 69d2645f70a8a7bb0a8f8362d03814ae6d11f04e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 14:42:52 -0600 Subject: [PATCH 50/80] Added debugging and fix Photon git --- bootstrap-salt.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 87e642d..d1741da 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6456,6 +6456,11 @@ install_arch_linux_onedir_post() { # __install_saltstack_photon_onedir_repository() { + ## DGM Debugging + set -v + set -x + echodebug "__install_saltstack_photon_onedir_repository() entry" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -6498,6 +6503,11 @@ __install_saltstack_photon_onedir_repository() { } install_photon_deps() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_deps() entry" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -6530,6 +6540,11 @@ install_photon_deps() { } install_photon_stable_post() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_stable_post() entry" + for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue @@ -6546,6 +6561,11 @@ install_photon_stable_post() { } install_photon_git_deps() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_git_deps() entry" + if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -6603,6 +6623,13 @@ install_photon_git_deps() { } install_photon_git() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_git() entry" + + install_photon_git_deps || return 1 + if [ "${_PY_EXE}" != "" ]; then _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" @@ -6620,6 +6647,11 @@ install_photon_git() { } install_photon_git_post() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_git_post() entry" + for fname in api master minion syndic; do # Skip if not meant to be installed [ $fname = "api" ] && \ @@ -6652,6 +6684,11 @@ install_photon_git_post() { install_photon_restart_daemons() { [ "$_START_DAEMONS" -eq $BS_FALSE ] && return + ## DGM Debugging + set -v + set -x + echodebug "install_photon_restart_daemons() entry" + for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot @@ -6673,6 +6710,11 @@ install_photon_restart_daemons() { } install_photon_check_services() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_check_services() entry" + for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue @@ -6689,6 +6731,11 @@ install_photon_check_services() { } install_photon_onedir_deps() { + ## DGM Debugging + set -v + set -x + echodebug "install_photon_onedir_deps() entry" + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then tdnf -y update || return 1 @@ -6736,6 +6783,7 @@ install_photon_onedir() { ## DGM Debugging set -v set -x + echodebug "install_photon_onedir() entry" STABLE_REV=$ONEDIR_REV From fdd6b3240bf52e47893a0cd07c57f0ee97597501 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 15:23:26 -0600 Subject: [PATCH 51/80] Adjust Photon git install, and corrected check for break-system-packages using pip3 --- bootstrap-salt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index d1741da..5d0e387 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2774,10 +2774,10 @@ EOM fi _USE_BREAK_SYSTEM_PACKAGES="" - _PIP_VERSION=$(${_pip_cmd} --version | awk '{print $2}') + _PIP_MAJOR_VERSION=$(${_pip_cmd} --version | awk '{print $2}' | awk -F '.' '{print $1}') # shellcheck disable=SC2086,SC2090 - if [ ${_PIP_VERSION} -ge 24 ]; then + if [ ${_PIP_MAJOR_VERSION} -ge 24 ]; then _USE_BREAK_SYSTEM_PACKAGES="--break-system-packages" echodebug "pip command is greater than / equal 24, using ${_USE_BREAK_SYSTEM_PACKAGES}" fi @@ -6628,7 +6628,7 @@ install_photon_git() { set -x echodebug "install_photon_git() entry" - install_photon_git_deps || return 1 + ## DGM install_photon_git_deps || return 1 if [ "${_PY_EXE}" != "" ]; then _PYEXE=${_PY_EXE} From 1ca3e432aeb2d43d27f3bcb332b8c766c5998274 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 3 Jul 2024 15:58:48 -0600 Subject: [PATCH 52/80] Updated some more pip3 install to utilize --break-system-packages if sufficient pip3 version --- bootstrap-salt.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5d0e387..dd55f36 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2782,10 +2782,9 @@ EOM echodebug "pip command is greater than / equal 24, using ${_USE_BREAK_SYSTEM_PACKAGES}" fi - echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'" ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" - ### DGM ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" + echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel ${_setuptools_dep}" ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" echoinfo "Installing salt using ${_py_exe}" @@ -2798,7 +2797,7 @@ EOM ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) echoinfo "Installing Downloaded Salt Dependencies" - echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" + echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 ## DGM ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 @@ -2817,11 +2816,12 @@ EOM cd "${__SALT_GIT_CHECKOUT_PARENT_DIR}" || return 1 echoinfo "Installing Built Salt Wheel" - ${_pip_cmd} uninstall --yes salt 2>/dev/null || true - echodebug "Running '${_pip_cmd} install --no-deps --force-reinstall ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'" + ${_pip_cmd} uninstall --yes ${_USE_BREAK_SYSTEM_PACKAGES} salt 2>/dev/null || true + echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'" ## DGM "${_POST_NEON_PIP_INSTALL_ARGS}" \ - ${_pip_cmd} install --no-deps --force-reinstall \ + ## DGM ${_pip_cmd} install --no-deps --force-reinstall \ + ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall \ ${_POST_NEON_PIP_INSTALL_ARGS} \ --global-option="--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" \ /tmp/git/deps/salt*.whl || return 1 From a79bffeb2021dcd28b2c67e8b397c0e91074413e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 09:41:21 -0600 Subject: [PATCH 53/80] Added tornado for Photon 4 git, and systemd for Photon 5 --- bootstrap-salt.sh | 8 +++----- kitchen.yml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index dd55f36..37120da 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6593,13 +6593,11 @@ install_photon_git_deps() { ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64 cython${PY_PKG_VER}" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" ## DGM Photon 5 container is missing systemd on default installation - if [ "${DISTRO_MAJOR_VERSION}" -ge 5 ]; then - # Photon 5 container is missing systemd on default installation - __PACKAGES="${__PACKAGES} systemd" + if [ "${DISTRO_MAJOR_VERSION}" -lt 5 ]; then + ## DGM tornado appears to be missing in 3006.x pkg requirements + __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" fi # shellcheck disable=SC2086 diff --git a/kitchen.yml b/kitchen.yml index ee6c8eb..4172435 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -148,7 +148,7 @@ platforms: driver: image: photon:5.0 provision_command: - - tdnf -y install rpm procps-ng coreutils gawk + - tdnf -y install rpm procps-ng coreutils gawk systemd - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - systemctl enable sshd.service From bb51f9fd634aeff603afc06ed7e285323d5238ad Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 10:28:27 -0600 Subject: [PATCH 54/80] Resolve lint error --- bootstrap-salt.sh | 1 + kitchen.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 37120da..4c9f83b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6593,6 +6593,7 @@ install_photon_git_deps() { ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64 cython${PY_PKG_VER}" + echodebug "install_photon_git_deps() distro major version, ${DISTRO_MAJOR_VERSION}" ## DGM Photon 5 container is missing systemd on default installation if [ "${DISTRO_MAJOR_VERSION}" -lt 5 ]; then diff --git a/kitchen.yml b/kitchen.yml index 4172435..4bca539 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -140,7 +140,7 @@ platforms: driver: image: photon:4.0 provision_command: - - tdnf -y install rpm procps-ng coreutils gawk + - tdnf -y install rpm procps-ng coreutils gawk systemd - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - systemctl enable sshd.service From f8cfdc5f07888318cafa08bf3b55c0147f99ac59 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 11:22:55 -0600 Subject: [PATCH 55/80] Trying to resolve Lint issue that suddenly arose --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- .github/workflows/templates/ci.yml | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0ea9d7..5147ac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - ## DGM uses: tj-actions/changed-files@v42 - uses: tj-actions/changed-files@v25 + uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,8 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 ## DGM - name: Set up Python 3.9 ## DGM uses: actions/setup-python@v4 @@ -93,8 +93,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -106,8 +106,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -120,8 +120,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 03504c2..6dde828 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - ## DGM uses: tj-actions/changed-files@v42 - uses: tj-actions/changed-files@v25 + uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,8 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 ## DGM - name: Set up Python 3.9 ## DGM uses: actions/setup-python@v4 @@ -93,8 +93,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -106,8 +106,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -120,8 +120,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus From 2ba74d33bcdf9e7431cdd6b46e8c0988fb78f219 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 11:56:15 -0600 Subject: [PATCH 56/80] Revert actions versions to what worked last week --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- .github/workflows/templates/ci.yml | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5147ac7..b0ea9d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - uses: tj-actions/changed-files@v42 - ## DGM uses: tj-actions/changed-files@v25 + ## DGM uses: tj-actions/changed-files@v42 + uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,8 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 ## DGM - name: Set up Python 3.9 ## DGM uses: actions/setup-python@v4 @@ -93,8 +93,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -106,8 +106,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -120,8 +120,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 6dde828..03504c2 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - uses: tj-actions/changed-files@v42 - ## DGM uses: tj-actions/changed-files@v25 + ## DGM uses: tj-actions/changed-files@v42 + uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,8 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 ## DGM - name: Set up Python 3.9 ## DGM uses: actions/setup-python@v4 @@ -93,8 +93,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -106,8 +106,8 @@ jobs: container: koalaman/shellcheck-alpine:v0.7.0 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 + ## DGM - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -120,8 +120,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus From 4351f20a3442bed89ffc0c129123dbc682215856 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 13:10:58 -0600 Subject: [PATCH 57/80] Trying koalaman/shellcheck-alpine:latest to see if Lint error is resolved for secure_getenv: symbol not found --- .github/workflows/ci.yml | 3 ++- .github/workflows/templates/ci.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0ea9d7..74f2be6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,8 @@ jobs: name: Lint runs-on: ubuntu-latest needs: collect-changed-files - container: koalaman/shellcheck-alpine:v0.7.0 + ## DGM container: koalaman/shellcheck-alpine:v0.7.0 + container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: ## DGM - uses: actions/checkout@v4 diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 03504c2..054b9be 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -103,7 +103,8 @@ jobs: name: Lint runs-on: ubuntu-latest needs: collect-changed-files - container: koalaman/shellcheck-alpine:v0.7.0 + ## DGM container: koalaman/shellcheck-alpine:v0.7.0 + container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: ## DGM - uses: actions/checkout@v4 From 7881998765a80bf68126cecbed99de4b5d170279 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 13:17:01 -0600 Subject: [PATCH 58/80] Disable Shell Check SC2086, Double quote to prevent globbing and word splitting --- bootstrap-salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4c9f83b..9cb3926 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4,7 +4,8 @@ # Please submit pull requests against the salt-bootstrap repo: # https://github.com/saltstack/salt-bootstrap # shellcheck disable=SC2317 - +# shellcheck disable=SC2086 +# #====================================================================================================================== # vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en cc=120 #====================================================================================================================== @@ -24,7 +25,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.07.01" +__ScriptVersion="2024.07.09" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" From 16ad6a8d0c6139be72a28b856b0c100d0225694e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 13:40:02 -0600 Subject: [PATCH 59/80] Disable Shell Check SC2329 - Warnings for functions not invoked --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9cb3926..2ff8d8e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5,6 +5,7 @@ # https://github.com/saltstack/salt-bootstrap # shellcheck disable=SC2317 # shellcheck disable=SC2086 +# shellcheck disable=SC2329 # #====================================================================================================================== # vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en cc=120 From 138b4ec78b8f656d140142239a3a5561215e344c Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 14:00:54 -0600 Subject: [PATCH 60/80] Further shell check disabling --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2ff8d8e..1b21f57 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1098,6 +1098,7 @@ __gather_linux_system_info() { DISTRO_VERSION="" # Let's test if the lsb_release binary is available + # shellcheck disable=SC2327,SC2328 rv=$(lsb_release >/dev/null 2>&1) # shellcheck disable=SC2181 From 8ee4de5ca4ae411acc7f268a2f4b3011412f702b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 15:00:36 -0600 Subject: [PATCH 61/80] Added gcc for Photon git deps --- bootstrap-salt.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1b21f57..1d1bce5 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6581,10 +6581,15 @@ install_photon_git_deps() { if ! __check_command_exists ps; then __PACKAGES="${__PACKAGES} procps-ng" fi + if ! __check_command_exists git; then __PACKAGES="${__PACKAGES} git" fi + if ! __check_command_exists gcc; then + __PACKAGES="${__PACKAGES} gcc" + fi + if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 __tdnf_install_noinput ${__PACKAGES} || return 1 From ca1d8d679f0e1580ca2b174627a2c093c05a72fe Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 15:34:01 -0600 Subject: [PATCH 62/80] Increased tiemout to 40, updated to Ubuntu 24.04 --- .github/workflows/ci.yml | 50 ++++++++++++------------- .github/workflows/templates/generate.py | 3 +- Dockerfile | 4 +- Vagrantfile | 2 +- kitchen.yml | 10 ++--- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74f2be6..f246bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,7 +139,7 @@ jobs: with: distro-slug: macos-12 display-name: macOS 12 - timeout: 20 + timeout: 40 runs-on: macos-12 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -154,7 +154,7 @@ jobs: with: distro-slug: macos-13 display-name: macOS 13 - timeout: 20 + timeout: 40 runs-on: macos-13 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -170,7 +170,7 @@ jobs: with: distro-slug: windows-2019 display-name: Windows 2019 - timeout: 20 + timeout: 40 runs-on: windows-2019 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -185,7 +185,7 @@ jobs: with: distro-slug: windows-2022 display-name: Windows 2022 - timeout: 20 + timeout: 40 runs-on: windows-2022 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -201,7 +201,7 @@ jobs: with: distro-slug: almalinux-8 display-name: AlmaLinux 8 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -215,7 +215,7 @@ jobs: with: distro-slug: almalinux-9 display-name: AlmaLinux 9 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -229,7 +229,7 @@ jobs: with: distro-slug: amazon-2 display-name: Amazon 2 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -243,7 +243,7 @@ jobs: with: distro-slug: amazon-2023 display-name: Amazon 2023 - timeout: 20 + timeout: 40 instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -257,7 +257,7 @@ jobs: with: distro-slug: arch display-name: Arch - timeout: 20 + timeout: 40 instances: '["git-master", "latest", "default"]' @@ -271,7 +271,7 @@ jobs: with: distro-slug: centos-stream9 display-name: CentOS Stream 9 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -285,7 +285,7 @@ jobs: with: distro-slug: debian-11 display-name: Debian 11 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -299,7 +299,7 @@ jobs: with: distro-slug: debian-12 display-name: Debian 12 - timeout: 20 + timeout: 40 instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -313,7 +313,7 @@ jobs: with: distro-slug: fedora-39 display-name: Fedora 39 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' @@ -327,7 +327,7 @@ jobs: with: distro-slug: fedora-40 display-name: Fedora 40 - timeout: 20 + timeout: 40 instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -369,7 +369,7 @@ jobs: with: distro-slug: opensuse-15 display-name: Opensuse 15 - timeout: 20 + timeout: 40 instances: '["latest", "default"]' @@ -383,7 +383,7 @@ jobs: with: distro-slug: opensuse-tumbleweed display-name: Opensuse Tumbleweed - timeout: 20 + timeout: 40 instances: '["git-master", "latest", "default"]' @@ -397,7 +397,7 @@ jobs: with: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -411,7 +411,7 @@ jobs: with: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 - timeout: 20 + timeout: 40 instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -425,7 +425,7 @@ jobs: with: distro-slug: photon-4 display-name: Photon OS 4 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' @@ -439,7 +439,7 @@ jobs: with: distro-slug: photon-5 display-name: Photon OS 5 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' @@ -453,7 +453,7 @@ jobs: with: distro-slug: rockylinux-8 display-name: Rocky Linux 8 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -467,7 +467,7 @@ jobs: with: distro-slug: rockylinux-9 display-name: Rocky Linux 9 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -481,7 +481,7 @@ jobs: with: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -495,7 +495,7 @@ jobs: with: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 - timeout: 20 + timeout: 40 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -509,7 +509,7 @@ jobs: with: distro-slug: ubuntu-2404 display-name: Ubuntu 24.04 - timeout: 20 + timeout: 40 instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 72c0c10..c28c98b 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -267,7 +267,8 @@ DISTRO_DISPLAY_NAMES = { "windows-2022": "Windows 2022", } -TIMEOUT_DEFAULT = 20 +## DGM TIMEOUT_DEFAULT = 20 +TIMEOUT_DEFAULT = 40 TIMEOUT_OVERRIDES = { "gentoo": 90, "gentoo-systemd": 90, diff --git a/Dockerfile b/Dockerfile index 4508764..e823445 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ubuntu:20.04 +FROM ubuntu:24.04 MAINTAINER "SaltStack Team" # Bootstrap script options: install Salt Master by default -ENV BOOTSTRAP_OPTS='-M' +ENV BOOTSTRAP_OPTS='-M -x python3' # Version of salt to install: stable or git ENV SALT_VERSION=stable diff --git a/Vagrantfile b/Vagrantfile index 4a8a57f..e14fd19 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/focal64" + config.vm.box = "ubuntu/noble64" # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user's system. diff --git a/kitchen.yml b/kitchen.yml index 4bca539..fee3eda 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -46,10 +46,11 @@ platforms: - name: amazon-2023 driver: image: amazonlinux:2023 - ## platform: fedora - platform: rhel + platform: fedora + ## DGM platform: rhel provision_command: - - yum -y install procps-ng + ## DGM - yum -y install procps-ng + - yum -y install --allowerasing procps-ng curl - name: arch driver: image: archlinux/archlinux @@ -285,6 +286,3 @@ verifier: name: shell remote_exec: false command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ - -## DGM transport: -## DGM name: docker From a8dba0748adf0f9590aba49e61d1544da533f48e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 16:23:48 -0600 Subject: [PATCH 63/80] Disable Git Master for Phonton 4 & 5 due to setup.py gcc failures --- .github/workflows/ci.yml | 4 ++-- .github/workflows/templates/generate.py | 2 ++ bootstrap-salt.sh | 28 +++++++++++-------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f246bcd..db37e8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -426,7 +426,7 @@ jobs: distro-slug: photon-4 display-name: Photon OS 4 timeout: 40 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' photon-5: @@ -440,7 +440,7 @@ jobs: distro-slug: photon-5 display-name: Photon OS 5 timeout: 40 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' rockylinux-8: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index c28c98b..83032fa 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -167,6 +167,8 @@ BLACKLIST_GIT_3007 = [ BLACKLIST_GIT_MASTER = [ "amazon-2", + "photon-4", + "photon-5", ] SALT_VERSIONS = [ diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1d1bce5..8feaeeb 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3203,7 +3203,7 @@ install_ubuntu_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -3746,7 +3746,7 @@ install_debian_onedir_deps() { ## DGM ## DGM # Let's trigger config_salt() ## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then -## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" +## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" <----- trailing slash ???? ## DGM CONFIG_SALT_FUNC="config_salt" ## DGM fi ## DGM } @@ -3791,7 +3791,7 @@ install_debian_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -4250,7 +4250,7 @@ install_fedora_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -4706,7 +4706,7 @@ install_centos_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -5873,7 +5873,7 @@ install_amazon_linux_ami_2_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -6084,7 +6084,7 @@ install_amazon_linux_ami_2023_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -6276,7 +6276,7 @@ install_arch_linux_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -6586,10 +6586,6 @@ install_photon_git_deps() { __PACKAGES="${__PACKAGES} git" fi - if ! __check_command_exists gcc; then - __PACKAGES="${__PACKAGES} gcc" - fi - if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 __tdnf_install_noinput ${__PACKAGES} || return 1 @@ -6616,13 +6612,13 @@ install_photon_git_deps() { if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then # Need newer version of setuptools on Photon _setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}" - echodebug "Running '${_PY_EXE} -m pip --upgrade install ${_setuptools_dep}'" + echodebug "Running '${_PY_EXE} -m pip install --upgrade ${_setuptools_dep}'" ${_PY_EXE} -m pip install --upgrade "${_setuptools_dep}" fi # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -6995,7 +6991,7 @@ install_opensuse_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi @@ -7229,7 +7225,7 @@ install_opensuse_15_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then - _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" + _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" CONFIG_SALT_FUNC="config_salt" fi From e221fff82c1ee318cfe9fc1a3fbaf38f2d7091fd Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 16:58:09 -0600 Subject: [PATCH 64/80] Reverting to building on Ubuntu 20.04 --- .github/workflows/test-linux.yml | 2 +- Dockerfile | 2 +- Vagrantfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 83192eb..919f17a 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -26,7 +26,7 @@ on: jobs: Test: name: ${{ matrix.instance }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-20.04 timeout-minutes: ${{ inputs.timeout }} strategy: max-parallel: 2 diff --git a/Dockerfile b/Dockerfile index e823445..cd08a40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:20.04 MAINTAINER "SaltStack Team" # Bootstrap script options: install Salt Master by default diff --git a/Vagrantfile b/Vagrantfile index e14fd19..4a8a57f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/noble64" + config.vm.box = "ubuntu/focal64" # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user's system. From 210db17a78d784ff22f36560d0a7cc7bd71f094e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 9 Jul 2024 17:18:36 -0600 Subject: [PATCH 65/80] Adjusted GIT 3006 & 3007 blacklists --- .github/workflows/ci.yml | 6 +++--- .github/workflows/templates/generate.py | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db37e8a..1e4672d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,7 +244,7 @@ jobs: distro-slug: amazon-2023 display-name: Amazon 2023 timeout: 40 - instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' arch: @@ -328,7 +328,7 @@ jobs: distro-slug: fedora-40 display-name: Fedora 40 timeout: 40 - instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' gentoo: @@ -412,7 +412,7 @@ jobs: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 timeout: 40 - instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' photon-4: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 83032fa..7e3706e 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -128,6 +128,7 @@ BLACKLIST_3007 = [ BLACKLIST_GIT_3006 = [ "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-stream9", "debian-11", @@ -137,6 +138,7 @@ BLACKLIST_GIT_3006 = [ "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-9", @@ -148,15 +150,18 @@ BLACKLIST_GIT_3006 = [ BLACKLIST_GIT_3007 = [ "almalinux-9", "amazon-2", + "amazon-2023", "arch", "centos-stream9", "debian-11", "debian-12", "fedora-39", + "fedora-40", "gentoo", "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", + "oraclelinux-9", "photon-4", "photon-5", "rockylinux-9", @@ -167,6 +172,7 @@ BLACKLIST_GIT_3007 = [ BLACKLIST_GIT_MASTER = [ "amazon-2", + "fedora-39", "photon-4", "photon-5", ] From 1c244ea427494b2e4fca284d66ae81bbdbaee4e6 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 09:41:40 -0600 Subject: [PATCH 66/80] Debugging Oracle Linux 9 --- kitchen.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kitchen.yml b/kitchen.yml index fee3eda..a47bd6a 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -115,7 +115,6 @@ platforms: - *opensuse_provision_command_02 - *opensuse_provision_command_03 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: oraclelinux-9 - name: rockylinux-9 driver: platform: centosstream @@ -126,6 +125,16 @@ platforms: ### DGM - yum -y install crypto-policies-scripts procps-ng ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: oraclelinux-9 + driver: + ## DGM platform: centosstream + run_command: /usr/lib/systemd/systemd + provision_command: + - dnf -y install crypto-policies-scripts procps-ng + - update-crypto-policies --set DEFAULT:SHA1 + ### DGM - yum -y install crypto-policies-scripts procps-ng + ### DGM - update-crypto-policies --set DEFAULT:SHA256 + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - name: oraclelinux-8 - name: ubuntu-22.04 From b1d1ec6b26a18fc2fb3ebe6c34ad6552329366e9 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 10:17:46 -0600 Subject: [PATCH 67/80] Debugging Amazon-2023 and Ubuntu 22.04 --- kitchen.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index a47bd6a..8dce979 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -46,8 +46,8 @@ platforms: - name: amazon-2023 driver: image: amazonlinux:2023 - platform: fedora - ## DGM platform: rhel + ## DGM platform: fedora + platform: rhel provision_command: ## DGM - yum -y install procps-ng - yum -y install --allowerasing procps-ng curl @@ -137,12 +137,16 @@ platforms: - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - name: oraclelinux-8 - - name: ubuntu-22.04 - name: ubuntu-24.04 driver: run_command: /lib/systemd/systemd provision_command: - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + - name: ubuntu-22.04 + driver: + run_command: /lib/systemd/systemd + provision_command: + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: ubuntu-20.04 driver: run_command: /lib/systemd/systemd From 9afa614e2a0899ad637b81b002d7d77880cc1ad5 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 11:27:04 -0600 Subject: [PATCH 68/80] Debugging Debina 12 and Ubutnu 22.054 git-master --- bootstrap-salt.sh | 3 +++ kitchen.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8feaeeb..ccfa6a8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2799,6 +2799,9 @@ EOM ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) + echodebug "DGM checking salt deps downloaded" + ls -alrth /tmp/git/deps/* + echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 diff --git a/kitchen.yml b/kitchen.yml index 8dce979..1736cd1 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -78,6 +78,8 @@ platforms: driver: image: debian:bookworm run_command: /lib/systemd/systemd + provision_command: + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: fedora-39 driver: provision_command: &fedora_provision_command @@ -176,6 +178,7 @@ suites: - opensuse-15 - opensuse-tumbleweed - debian-11 + - debian-12 - arch - gentoo - gentoo-systemd @@ -187,6 +190,7 @@ suites: - opensuse-15 - opensuse-tumbleweed - debian-11 + - debian-12 - arch - gentoo - gentoo-systemd From 41563ad1ded6eb740c1faafcc292a388afeb8131 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 12:03:36 -0600 Subject: [PATCH 69/80] Debugging --- bootstrap-salt.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ccfa6a8..0406e6f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -26,7 +26,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.07.09" +__ScriptVersion="2024.07.10" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -2777,12 +2777,13 @@ EOM fi _USE_BREAK_SYSTEM_PACKAGES="" - _PIP_MAJOR_VERSION=$(${_pip_cmd} --version | awk '{print $2}' | awk -F '.' '{print $1}') + ## DGM _PIP_MAJOR_VERSION=$(${_pip_cmd} --version | awk '{print $2}' | awk -F '.' '{print $1}') # shellcheck disable=SC2086,SC2090 - if [ ${_PIP_MAJOR_VERSION} -ge 24 ]; then + if { [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; } || \ + [ ${DISTRO_NAME_L} = "debian" ] && [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then _USE_BREAK_SYSTEM_PACKAGES="--break-system-packages" - echodebug "pip command is greater than / equal 24, using ${_USE_BREAK_SYSTEM_PACKAGES}" + echodebug "OS is greater than / equal Debian 12 or Ubuntu 24.04, using ${_USE_BREAK_SYSTEM_PACKAGES}" fi ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" @@ -2797,7 +2798,9 @@ EOM echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) - ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) + + ## DGM ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) + ${_pip_cmd} download -d /tmp/git/deps echodebug "DGM checking salt deps downloaded" ls -alrth /tmp/git/deps/* From c2f0375167bb9df70a1451ebbae039378f54638b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 13:18:06 -0600 Subject: [PATCH 70/80] Debugging more --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 0406e6f..fec330e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2800,7 +2800,7 @@ EOM ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) ## DGM ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) - ${_pip_cmd} download -d /tmp/git/deps + ${_pip_cmd} download -vvv -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) echodebug "DGM checking salt deps downloaded" ls -alrth /tmp/git/deps/* From 02aa3bbdfc739d373895af4c349437dbd9af0e06 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 14:04:11 -0600 Subject: [PATCH 71/80] Debugging Ubuntu 22.04 git-master, default pip not recognizing sys_platform == 'win32' --- bootstrap-salt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index fec330e..458d540 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2795,6 +2795,13 @@ EOM cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 mkdir /tmp/git/deps + + if [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -eq 22 ]; then + echodebug "DGM Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', trying upgrading pip" + echodebug "${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip" + ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip || (echo "Failed to upgrade pip" && return 1) + fi + echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) From 26f92489f3e6f17e7998a34469f6ed859c9bdf02 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 14:26:14 -0600 Subject: [PATCH 72/80] Debugging Amazon 2023 --- bootstrap-salt.sh | 9 +- btstrap-build.linux.yml | 275 -------------------------------------- btstrap-build.macos.yml | 34 ----- btstrap-build.windows.yml | 34 ----- kitchen.yml | 3 +- 5 files changed, 4 insertions(+), 351 deletions(-) delete mode 100644 btstrap-build.linux.yml delete mode 100644 btstrap-build.macos.yml delete mode 100644 btstrap-build.windows.yml diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 458d540..0e38895 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2797,7 +2797,7 @@ EOM mkdir /tmp/git/deps if [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -eq 22 ]; then - echodebug "DGM Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', trying upgrading pip" + echodebug "Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', upgrading from default pip works" echodebug "${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip" ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip || (echo "Failed to upgrade pip" && return 1) fi @@ -2805,12 +2805,7 @@ EOM echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) - - ## DGM ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) - ${_pip_cmd} download -vvv -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) - - echodebug "DGM checking salt deps downloaded" - ls -alrth /tmp/git/deps/* + ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" diff --git a/btstrap-build.linux.yml b/btstrap-build.linux.yml deleted file mode 100644 index 6c9a7f4..0000000 --- a/btstrap-build.linux.yml +++ /dev/null @@ -1,275 +0,0 @@ ---- -## DGM this was the ruby file used with kitchen-salt to provide the instances to test on using docker. -## DGM Need to duplicate this creation of docker containers process. - -driver: - name: docker - use_sudo: false - hostname: salt - privileged: true - username: root - cap_add: - - sys_admin - disable_upstart: false - use_internal_docker_network: false - run_command: /usr/lib/systemd/systemd - -provisioner: - name: salt_solo - salt_install: bootstrap - salt_bootstrap_url: bootstrap-salt.sh - salt_bootstrap_options: -MPfq git %s - install_after_init_environment: true - log_level: info - sudo: false - require_chef: false - formula: tests - run_salt_call: false - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - mkdir -p /etc/salt/master.d - mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -platforms: - - name: almalinux-9 - driver: - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: almalinux-8 - - name: amazon-2 - driver: - image: amazonlinux:2 - platform: rhel - provision_command: - - yum -y install procps-ng - - name: amazon-2023 - driver: - image: amazonlinux:2023 - platform: fedora - provision_command: - - yum -y install procps-ng - - name: arch - driver: - image: archlinux/archlinux - provision_command: - - pacman -Syu --noconfirm --needed systemd grep awk procps which - - systemctl enable sshd - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream9 - driver: - platform: centosstream - image: quay.io/centos/centos:stream9 - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream8 - driver: - image: quay.io/centos/centos:stream8 - - name: debian-11 - driver: - image: debian:bullseye - run_command: /lib/systemd/systemd - - name: debian-12 - driver: - image: debian:bullseye - run_command: /lib/systemd/systemd - - name: fedora-39 - - name: fedora-40 - driver: - provision_command: &fedora_provision_command - - dnf -y install procps-ng crypto-policies-scripts - - update-crypto-policies - - name: gentoo - driver: - image: gentoo/stage3:latest - run_command: /sbin/init - provision_command: - - rc-update add sshd default - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: gentoo-systemd - driver: - image: gentoo/stage3:systemd - run_command: /lib/systemd/systemd - provision_command: - - systemctl enable sshd.service - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: opensuse-15 - driver: - image: opensuse/leap:15.4 - provision_command: - - &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1 - - &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd - - &opensuse_provision_command_03 systemctl enable sshd.service - - name: opensuse-tumbleweed - driver: - image: opensuse/tumbleweed:latest - provision_command: - - *opensuse_provision_command_01 - - *opensuse_provision_command_02 - - *opensuse_provision_command_03 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-9 - driver: - platform: centosstream - run_command: /usr/lib/systemd/systemd - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-8 - - name: oraclelinux-8 - - name: rockylinux-8 - - name: ubuntu-22.04 - - name: ubuntu-23.10 - - name: ubuntu-24.04 - driver: - run_command: /lib/systemd/systemd - provision_command: - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: ubuntu-20.04 - driver: - run_command: /lib/systemd/systemd - - name: photon-4 - driver: - image: photon:4.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service - - name: photon-5 - driver: - image: photon:5.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service - -suites: - - name: git-3006 - provisioner: - salt_version: v3006 - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - debian-11 - - arch - - gentoo - - gentoo-systemd - - name: git-3006x - provisioner: - salt_version: 3006.x - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - gentoo - - gentoo-systemd - - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - - name: git-3007 - provisioner: - salt_version: v3007 - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - debian-11 - - arch - - gentoo - - gentoo-systemd - - name: git-3007x - provisioner: - salt_version: 3007.x - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - gentoo - - gentoo-systemd - - name: stable-3007-1 - provisioner: - salt_version: 3007.1 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - arch - - name: git-master - provisioner: - salt_version: master - salt_bootstrap_options: -x python3 -MPfq -D git %s - - - name: latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP stable %s - - - name: default - provisioner: - salt_version: latest - salt_bootstrap_options: -MP - - - name: onedir-nightly - provisioner: - salt_version: nightly - salt_bootstrap_options: -MP onedir %s - - - name: onedir-latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3007 - provisioner: - salt_version: 3007 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-rc-3008-0rc1 - provisioner: - salt_version: 3008.0rc1 - salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s - excludes: - - arch - - gentoo - - opensuse-15 - - opensuse-tumbleweed - - - name: quickstart - provisioner: - salt_bootstrap_options: -Q - -verifier: - name: shell - remote_exec: false - command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ diff --git a/btstrap-build.macos.yml b/btstrap-build.macos.yml deleted file mode 100644 index a0d8921..0000000 --- a/btstrap-build.macos.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -driver: - name: exec - -provisioner: - sudo: true - salt_bootstrap_options: -MP stable %s - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - sudo mkdir -p /etc/salt/master.d - sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - brew install coreutils - sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -platforms: - - name: macos-12 - - name: macos-13 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_call_command: /opt/salt/salt-call - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: /opt/salt/salt-call - - name: latest - provisioner: - salt_version: latest - salt_call_command: /opt/salt/salt-call - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/btstrap-build.windows.yml b/btstrap-build.windows.yml deleted file mode 100644 index 951f703..0000000 --- a/btstrap-build.windows.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -driver: - name: proxy - host: localhost - reset_command: "exit 0" - port: 5985 - username: kitchen - password: Password1 - -provisioner: - salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1 - salt_bootstrap_options: -Version %s -Verbose - init_environment: '' - -platforms: - - name: windows-2022 - - name: windows-2019 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006.8 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: latest - provisioner: - salt_version: latest - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.yml b/kitchen.yml index 1736cd1..bf03a68 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -47,10 +47,11 @@ platforms: driver: image: amazonlinux:2023 ## DGM platform: fedora - platform: rhel + ## DGM platform: rhel provision_command: ## DGM - yum -y install procps-ng - yum -y install --allowerasing procps-ng curl + - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: arch driver: image: archlinux/archlinux From 4029e24d74866d10938f50c717558cbf6f86adb4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 15:59:53 -0600 Subject: [PATCH 73/80] Testing current stable version of Ruby 3.3.4 --- .github/workflows/test-linux.yml | 3 ++- .github/workflows/test-macos.yml | 3 ++- .github/workflows/test-windows.yml | 3 ++- CHANGELOG.md | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 919f17a..60dac6d 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -41,8 +41,9 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: + ## DGM ruby-version: 2.6.10 ## DGM ruby-version: 3.2.3 - ruby-version: 2.6.10 + ruby-version: 3.3.4 bundler-cache: true ## DGM - name: Set up Python 3.9 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 0ff92c8..bbcb27a 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -50,8 +50,9 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: + ## DGM ruby-version: 2.6.10 ## DGM ruby-version: 3.2.3 - ruby-version: 2.6.10 + ruby-version: 3.3.4 bundler-cache: true ## DGM - name: Set up Python 3.9 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7f2050e..fa87e93 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -53,8 +53,9 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: + ## DGM ruby-version: 2.6.10 ## DGM ruby-version: 3.2.3 - ruby-version: 2.6.10 + ruby-version: 3.3.4 bundler-cache: true - name: Install Chef diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a4994..618349a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v2024.06.XX +# v2024.07.XX ## What's Changed @@ -9,9 +9,11 @@ - Removed support for FreeBSD and OpenBSD - Removed support for Solaris and it's derivatives - Removed support for EOL Salt releases, pre-3006 -- Added support for new OS's, for example: Ubuntu 24.04, Debian 12 +- Added support for new OS's, for example: Ubuntu 24.04, Debian 12, Amazon 2023 - Updated to minimum Python 3.10 version from 3.9 - Removed '-y' option which was experimental and only on RHEL 7 or less which are now EOL +- Updated to current stable version of Ruby v3.3.4 +- Removed git-master support for Photon 4 & 5 due to gcc errors building salt. **Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.06.XX From 06702a81aab073d32558e91afdfe8ba77830c9c4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jul 2024 16:43:17 -0600 Subject: [PATCH 74/80] Trying Ruby version 3.2.3 since exception with 3.3.4 for Amazon 2023 --- .github/workflows/test-linux.yml | 4 ++-- .github/workflows/test-macos.yml | 4 ++-- .github/workflows/test-windows.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 60dac6d..8b316f2 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -42,8 +42,8 @@ jobs: uses: ruby/setup-ruby@v1 with: ## DGM ruby-version: 2.6.10 - ## DGM ruby-version: 3.2.3 - ruby-version: 3.3.4 + ruby-version: 3.2.3 + ## DGM ruby-version: 3.3.4 bundler-cache: true ## DGM - name: Set up Python 3.9 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index bbcb27a..0dfbe35 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -51,8 +51,8 @@ jobs: uses: ruby/setup-ruby@v1 with: ## DGM ruby-version: 2.6.10 - ## DGM ruby-version: 3.2.3 - ruby-version: 3.3.4 + ruby-version: 3.2.3 + ## DGM ruby-version: 3.3.4 bundler-cache: true ## DGM - name: Set up Python 3.9 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index fa87e93..a00547a 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -54,8 +54,8 @@ jobs: uses: ruby/setup-ruby@v1 with: ## DGM ruby-version: 2.6.10 - ## DGM ruby-version: 3.2.3 - ruby-version: 3.3.4 + ruby-version: 3.2.3 + ## DGM ruby-version: 3.3.4 bundler-cache: true - name: Install Chef From 0cc372f66b838d0505d839dc5278099e0590a3fc Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 11 Jul 2024 08:47:00 -0600 Subject: [PATCH 75/80] Reverted to using original Ruby 2.6.10 since 3.3.4 has exceptions creating Amazon 2023 Test Instance --- .github/workflows/ci.yml | 33 +++++++++++++----------------- .github/workflows/nightly.yml | 1 - .github/workflows/release.yml | 3 --- .github/workflows/templates/ci.yml | 33 +++++++++++++----------------- .github/workflows/test-linux.yml | 14 ++----------- .github/workflows/test-macos.yml | 13 ++---------- .github/workflows/test-windows.yml | 13 ++---------- 7 files changed, 34 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e4672d..4fd3ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - ## DGM uses: tj-actions/changed-files@v42 - uses: tj-actions/changed-files@v25 + uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,13 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 - - ## DGM - name: Set up Python 3.9 - ## DGM uses: actions/setup-python@v4 - ## DGM with: - ## DGM python-version: 3.9 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v4 @@ -93,8 +88,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -107,8 +102,8 @@ jobs: container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -121,8 +116,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c16b46d..d043786 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -46,7 +46,6 @@ jobs: name: Update S3 Bucket if: ${{ fromJSON(needs.workflow-requirements.outputs.requirements-met) }} runs-on: - ## DGM wonder about these - self-hosted - linux - repo-release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7b25f4..8a18b48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,6 @@ jobs: update-develop: name: Update CHANGELOG.md and bootstrap-salt.sh runs-on: - ## DGM wonder about these - self-hosted - linux - repo-release @@ -296,7 +295,6 @@ jobs: update-s3-bucket: name: Update S3 Bucket runs-on: - ## DGM wonder about these - self-hosted - linux - repo-release @@ -358,7 +356,6 @@ jobs: update-develop-checksums: name: Update Release Checksums on Develop runs-on: - ## DGM wonder about these - self-hosted - linux - repo-release diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 054b9be..8890a91 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -16,15 +16,15 @@ jobs: outputs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files - ## DGM uses: tj-actions/changed-files@v42 - uses: tj-actions/changed-files@v25 + uses: tj-actions/changed-files@v42 + ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -62,13 +62,8 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 - - ## DGM - name: Set up Python 3.9 - ## DGM uses: actions/setup-python@v4 - ## DGM with: - ## DGM python-version: 3.9 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v4 @@ -93,8 +88,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -107,8 +102,8 @@ jobs: container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - ## DGM - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -121,8 +116,8 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + ## DGM uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 8b316f2..dca430a 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -37,20 +37,13 @@ jobs: steps: - uses: actions/checkout@v3 - ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ## DGM ruby-version: 2.6.10 - ruby-version: 3.2.3 - ## DGM ruby-version: 3.3.4 + ruby-version: 2.6.10 + ## ruby-version: 3.3.4 bundler-cache: true - ## DGM - name: Set up Python 3.9 - ## DGM uses: actions/setup-python@v4 - ## DGM with: - ## DGM python-version: 3.9 - - name: Set up Python 3.10 uses: actions/setup-python@v4 with: @@ -63,20 +56,17 @@ jobs: - name: Create Test Instance run: | - ## DGM Need to replace this (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) sleep 2 - name: Test Bootstrap run: | - ## DGM Need to replace this bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 - name: Destroy Test Instance if: always() run: | - ## DGM Need to replace this bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} sleep 2 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 0dfbe35..425b158 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -31,8 +31,6 @@ on: env: KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' -## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ? - jobs: Test: name: ${{ matrix.instance }} @@ -46,20 +44,13 @@ jobs: steps: - uses: actions/checkout@v3 - ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ## DGM ruby-version: 2.6.10 - ruby-version: 3.2.3 - ## DGM ruby-version: 3.3.4 + ruby-version: 2.6.10 + ## ruby-version: 3.3.4 bundler-cache: true - ## DGM - name: Set up Python 3.9 - ## DGM uses: actions/setup-python@v4 - ## DGM with: - ## DGM python-version: 3.9 - - name: Set up Python 3.10 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a00547a..09eda40 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -34,8 +34,6 @@ env: machine_port: 5985 KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' -## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ? - jobs: Test: name: ${{ matrix.instance }} @@ -49,13 +47,11 @@ jobs: steps: - uses: actions/checkout@v3 - ## DGM Need to replace this - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ## DGM ruby-version: 2.6.10 - ruby-version: 3.2.3 - ## DGM ruby-version: 3.3.4 + ruby-version: 2.6.10 + ## ruby-version: 3.3.4 bundler-cache: true - name: Install Chef @@ -84,11 +80,6 @@ jobs: winrm set winrm/config/service '@{AllowUnencrypted="True"}' env - ## DGM - name: Set up Python 3.9 - ## DGM uses: actions/setup-python@v4 - ## DGM with: - ## DGM python-version: 3.9 - - name: Set up Python 3.10 uses: actions/setup-python@v4 with: From a5124f90e5426edaf996ba0a7e14d016d5c3011b Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 11 Jul 2024 09:39:46 -0600 Subject: [PATCH 76/80] Cleaned up code and removed Amazon 2023 for now, till it's container curl issue is resolved --- .github/workflows/ci.yml | 63 ++- .github/workflows/templates/generate.py | 21 +- bootstrap-salt.sh | 535 +----------------------- kitchen.yml | 27 +- 4 files changed, 52 insertions(+), 594 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fd3ec5..704b6b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,7 +134,7 @@ jobs: with: distro-slug: macos-12 display-name: macOS 12 - timeout: 40 + timeout: 20 runs-on: macos-12 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -149,7 +149,7 @@ jobs: with: distro-slug: macos-13 display-name: macOS 13 - timeout: 40 + timeout: 20 runs-on: macos-13 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -165,7 +165,7 @@ jobs: with: distro-slug: windows-2019 display-name: Windows 2019 - timeout: 40 + timeout: 20 runs-on: windows-2019 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -180,7 +180,7 @@ jobs: with: distro-slug: windows-2022 display-name: Windows 2022 - timeout: 40 + timeout: 20 runs-on: windows-2022 instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' @@ -196,7 +196,7 @@ jobs: with: distro-slug: almalinux-8 display-name: AlmaLinux 8 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -210,7 +210,7 @@ jobs: with: distro-slug: almalinux-9 display-name: AlmaLinux 9 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -224,24 +224,10 @@ jobs: with: distro-slug: amazon-2 display-name: Amazon 2 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - amazon-2023: - name: Amazon 2023 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: amazon-2023 - display-name: Amazon 2023 - timeout: 40 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - arch: name: Arch if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -252,7 +238,7 @@ jobs: with: distro-slug: arch display-name: Arch - timeout: 40 + timeout: 20 instances: '["git-master", "latest", "default"]' @@ -266,7 +252,7 @@ jobs: with: distro-slug: centos-stream9 display-name: CentOS Stream 9 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -280,7 +266,7 @@ jobs: with: distro-slug: debian-11 display-name: Debian 11 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -294,7 +280,7 @@ jobs: with: distro-slug: debian-12 display-name: Debian 12 - timeout: 40 + timeout: 20 instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -308,7 +294,7 @@ jobs: with: distro-slug: fedora-39 display-name: Fedora 39 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' @@ -322,7 +308,7 @@ jobs: with: distro-slug: fedora-40 display-name: Fedora 40 - timeout: 40 + timeout: 20 instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -364,7 +350,7 @@ jobs: with: distro-slug: opensuse-15 display-name: Opensuse 15 - timeout: 40 + timeout: 20 instances: '["latest", "default"]' @@ -378,7 +364,7 @@ jobs: with: distro-slug: opensuse-tumbleweed display-name: Opensuse Tumbleweed - timeout: 40 + timeout: 20 instances: '["git-master", "latest", "default"]' @@ -392,7 +378,7 @@ jobs: with: distro-slug: oraclelinux-8 display-name: Oracle Linux 8 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -406,7 +392,7 @@ jobs: with: distro-slug: oraclelinux-9 display-name: Oracle Linux 9 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -420,7 +406,7 @@ jobs: with: distro-slug: photon-4 display-name: Photon OS 4 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' @@ -434,7 +420,7 @@ jobs: with: distro-slug: photon-5 display-name: Photon OS 5 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' @@ -448,7 +434,7 @@ jobs: with: distro-slug: rockylinux-8 display-name: Rocky Linux 8 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' @@ -462,7 +448,7 @@ jobs: with: distro-slug: rockylinux-9 display-name: Rocky Linux 9 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -476,7 +462,7 @@ jobs: with: distro-slug: ubuntu-2004 display-name: Ubuntu 20.04 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -490,7 +476,7 @@ jobs: with: distro-slug: ubuntu-2204 display-name: Ubuntu 22.04 - timeout: 40 + timeout: 20 instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -504,7 +490,7 @@ jobs: with: distro-slug: ubuntu-2404 display-name: Ubuntu 24.04 - timeout: 40 + timeout: 20 instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' @@ -523,7 +509,6 @@ jobs: - almalinux-8 - almalinux-9 - amazon-2 - - amazon-2023 - arch - centos-stream9 - debian-11 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 7e3706e..a1cd887 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -6,12 +6,11 @@ import pathlib os.chdir(os.path.abspath(os.path.dirname(__file__))) -## DGM "centos-stream8", +## "amazon-2023", LINUX_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", - "amazon-2023", "arch", "centos-stream9", "debian-11", @@ -43,12 +42,11 @@ OSX = [ ] -## DGM "centos-stream8", +## "amazon-2023", STABLE_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", - "amazon-2023", "arch", "centos-stream9", "debian-11", @@ -68,12 +66,11 @@ STABLE_DISTROS = [ "ubuntu-2404", ] -## DGM "centos-stream8", +## "amazon-2023", ONEDIR_DISTROS = [ "almalinux-8", "almalinux-9", "amazon-2", - "amazon-2023", "centos-stream9", "debian-11", "debian-12", @@ -93,7 +90,6 @@ ONEDIR_DISTROS = [ ONEDIR_RC_DISTROS = [ "almalinux-9", "amazon-2", - "amazon-2023", "centos-stream9", "debian-12", "oraclelinux-9", @@ -125,10 +121,10 @@ BLACKLIST_3007 = [ "photon-5", ] +## "amazon-2023", BLACKLIST_GIT_3006 = [ "almalinux-9", "amazon-2", - "amazon-2023", "arch", "centos-stream9", "debian-11", @@ -147,10 +143,10 @@ BLACKLIST_GIT_3006 = [ "ubuntu-2404", ] +## "amazon-2023", BLACKLIST_GIT_3007 = [ "almalinux-9", "amazon-2", - "amazon-2023", "arch", "centos-stream9", "debian-11", @@ -230,7 +226,6 @@ GIT_VERSION_BLACKLIST = [ # SetuptoolsDeprecationWarning: setup.py install is deprecated. # Use build and pip and other standards-based tools. # -## DGM "centos-stream8", GIT_DISTRO_BLACKLIST = [ "almalinux-8", "fedora-39", @@ -244,12 +239,11 @@ LATEST_PKG_BLACKLIST = [ "gentoo-systemd", ] -## DGM "centos-stream8": "CentOS Stream 8", +## "amazon-2023": "Amazon 2023", DISTRO_DISPLAY_NAMES = { "almalinux-8": "AlmaLinux 8", "almalinux-9": "AlmaLinux 9", "amazon-2": "Amazon 2", - "amazon-2023": "Amazon 2023", "arch": "Arch", "centos-stream9": "CentOS Stream 9", "debian-11": "Debian 11", @@ -275,8 +269,7 @@ DISTRO_DISPLAY_NAMES = { "windows-2022": "Windows 2022", } -## DGM TIMEOUT_DEFAULT = 20 -TIMEOUT_DEFAULT = 40 +TIMEOUT_DEFAULT = 20 TIMEOUT_OVERRIDES = { "gentoo": 90, "gentoo-systemd": 90, diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 0e38895..9313bf1 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -26,7 +26,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.07.10" +__ScriptVersion="2024.07.11" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -129,12 +129,6 @@ __check_command_exists() { # DESCRIPTION: Simple function to let the users know that -P needs to be used. #---------------------------------------------------------------------------------------------------------------------- __check_pip_allowed() { - ## DGM __install_tornado_pip supplied an error msg, but no longer used, now shellcheck complains about unused parameter - ## DGM if [ $# -eq 1 ]; then - ## DGM _PIP_ALLOWED_ERROR_MSG=$1 - ## DGM else - ## DGM _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" - ## DGM fi _PIP_ALLOWED_ERROR_MSG="pip based installations were not allowed. Retry using '-P'" @@ -276,8 +270,6 @@ _REPO_URL="repo.saltproject.io" _ONEDIR_DIR="salt" _ONEDIR_NIGHTLY_DIR="salt-dev/${_ONEDIR_DIR}" _PY_EXE="python3" -## DGM _INSTALL_PY="$BS_FALSE" -## DGM _TORNADO_MAX_PY3_VERSION="5.0" _MINIMUM_PIP_VERSION="9.0.1" _MINIMUM_SETUPTOOLS_VERSION="9.1" _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr" @@ -420,15 +412,6 @@ __usage() { EOT } # ---------- end of function __usage ---------- -## DGM -y Installs a different python version on host. Currently this has only been -## DGM tested with CentOS 7 and is considered experimental. This will install the -## DGM ius repo on the box if disable repo is false. This must be used in conjunction -## DGM with -x . For example: -## DGM sh bootstrap.sh -P -y -x python3.8 git v3006.3 -## DGM The above will install python38 and install the git version of salt using the -## DGM python3.8 executable. This only works for git and pip installations. - -## DGM while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt while getopts ':hvnDc:g:Gx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt do case "${opt}" in @@ -486,8 +469,6 @@ do done shift $((OPTIND-1)) -## DGM y ) _INSTALL_PY="$BS_TRUE" ;; - # Define our logging file and pipe paths LOGFILE="/tmp/$( echo "$__ScriptName" | sed s/.sh/.log/g )" LOGPIPE="/tmp/$( echo "$__ScriptName" | sed s/.sh/.logpipe/g )" @@ -1394,7 +1375,6 @@ __check_dpkg_architecture() { fi __REPO_ARCH="$DPKG_ARCHITECTURE" - ## DGM __REPO_ARCH_DEB='deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg]' __REPO_ARCH_DEB='deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg]' __return_code=0 @@ -1609,7 +1589,6 @@ __check_end_of_life_versions() { case "${DISTRO_NAME_L}" in debian) # Debian versions below 11 are not supported - ## DGM if [ "$DISTRO_MAJOR_VERSION" -lt 9 ]; then if [ "$DISTRO_MAJOR_VERSION" -lt 11 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" @@ -1977,8 +1956,7 @@ __wait_for_apt(){ # PARAMETERS: packages #---------------------------------------------------------------------------------------------------------------------- __apt_get_install_noinput() { - ## DGM __wait_for_apt apt-get install -y -o DPkg::Options::=--force-confold "${@}"; return $? - __wait_for_apt apt-get install -V -y -o DPkg::Options::=--force-confold "${@}"; return $? + __wait_for_apt apt-get install -y -o DPkg::Options::=--force-confold "${@}"; return $? } # ---------- end of function __apt_get_install_noinput ---------- @@ -1987,8 +1965,7 @@ __apt_get_install_noinput() { # DESCRIPTION: (DRY) apt-get upgrade with noinput options #---------------------------------------------------------------------------------------------------------------------- __apt_get_upgrade_noinput() { - ## DGM __wait_for_apt apt-get upgrade -y -o DPkg::Options::=--force-confold; return $? - __wait_for_apt apt-get upgrade -V -y -o DPkg::Options::=--force-confold; return $? + __wait_for_apt apt-get upgrade -y -o DPkg::Options::=--force-confold; return $? } # ---------- end of function __apt_get_upgrade_noinput ---------- @@ -2027,8 +2004,6 @@ __apt_key_fetch() { tempfile="$(__temp_gpg_pub)" __fetch_url "$tempfile" "$url" || return 1 - ## DGM mkdir -p /etc/apt/keyrings || return 1 - ## DGM cp -f "$tempfile" /etc/apt/keyrings/salt-archive-keyring-2023.gpg && chmod 644 /etc/apt/keyrings/salt-archive-keyring-2023.gpg || return 1 cp -f "$tempfile" /usr/share/keyrings/salt-archive-keyring.gpg && chmod 644 /usr/share/keyrings/salt-archive-keyring.gpg || return 1 rm -f "$tempfile" @@ -2646,17 +2621,6 @@ __install_pip_pkgs() { ${_pip_cmd} install ${_pip_pkgs} || return 1 } -## DGM #--- FUNCTION ------------------------------------------------------------------------------------------------------- -## DGM # NAME: __install_tornado_pip -## DGM # PARAMETERS: python executable -## DGM # DESCRIPTION: Return 0 or 1 if successfully able to install tornado<5.0 -## DGM #---------------------------------------------------------------------------------------------------------------------- -## DGM __install_tornado_pip() { -## DGM # OS needs tornado <5.0 from pip -## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt on Python 3" -## DGM ## install pip if its not installed and install tornado -## DGM __install_pip_pkgs "tornado<5.0" "${1}" || return 1 -## DGM } #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __install_pip_deps @@ -2750,7 +2714,6 @@ EOM if ! ${_py_exe} -c "$CHECK_PIP_VERSION_SCRIPT"; then # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip" echodebug "Running '${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION}'" - ## DGM ${_pip_cmd} install "${_POST_NEON_PIP_INSTALL_ARGS}" -v "pip>=${_MINIMUM_PIP_VERSION}" ${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} -v "pip>=${_MINIMUM_PIP_VERSION}" sleep 1 echodebug "PATH: ${PATH}" @@ -2777,8 +2740,6 @@ EOM fi _USE_BREAK_SYSTEM_PACKAGES="" - ## DGM _PIP_MAJOR_VERSION=$(${_pip_cmd} --version | awk '{print $2}' | awk -F '.' '{print $1}') - # shellcheck disable=SC2086,SC2090 if { [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; } || \ [ ${DISTRO_NAME_L} = "debian" ] && [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then @@ -2786,8 +2747,6 @@ EOM echodebug "OS is greater than / equal Debian 12 or Ubuntu 24.04, using ${_USE_BREAK_SYSTEM_PACKAGES}" fi - ## DGM ${_pip_cmd} install --upgrade "${_POST_NEON_PIP_INSTALL_ARGS}" wheel "${_setuptools_dep}" - ### DGM ${_pip_cmd} install --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel ${_setuptools_dep}" ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}" @@ -2804,13 +2763,10 @@ EOM echoinfo "Downloading Salt Dependencies from PyPi" echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'" - ## DGM ${_pip_cmd} download -d /tmp/git/deps "${_PIP_DOWNLOAD_ARGS}" . || (echo "Failed to download salt dependencies" && return 1) ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1) echoinfo "Installing Downloaded Salt Dependencies" echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'" - ## ${_pip_cmd} install --ignore-installed "${_POST_NEON_PIP_INSTALL_ARGS}" /tmp/git/deps/* || return 1 - ## DGM ${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1 rm -f /tmp/git/deps/* @@ -2830,8 +2786,6 @@ EOM ${_pip_cmd} uninstall --yes ${_USE_BREAK_SYSTEM_PACKAGES} salt 2>/dev/null || true echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'" - ## DGM "${_POST_NEON_PIP_INSTALL_ARGS}" \ - ## DGM ${_pip_cmd} install --no-deps --force-reinstall \ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall \ ${_POST_NEON_PIP_INSTALL_ARGS} \ --global-option="--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" \ @@ -2968,8 +2922,6 @@ __install_saltstack_ubuntu_repository() { echodebug "__install_saltstack_ubuntu_repository() entry" - echodebug "DGM Ubuntu D checking STABLE_REV ,${STABLE_REV}," - if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ { [ "$DISTRO_MAJOR_VERSION" -eq 22 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ [ "$DISTRO_MAJOR_VERSION" -eq 21 ] || [ "$DISTRO_MAJOR_VERSION" -eq 23 ]; then @@ -2994,10 +2946,7 @@ __install_saltstack_ubuntu_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - ## DGM include hwclock if not part of base OS (23.10 and up) + ## include hwclock if not part of base OS (23.10 and up) if [ ! -f /usr/sbin/hwclock ]; then __PACKAGES="${__PACKAGES} util-linux-extra" fi @@ -3031,8 +2980,6 @@ __install_saltstack_ubuntu_onedir_repository() { UBUNTU_CODENAME=${DISTRO_CODENAME} fi - echodebug "DGM Ubuntu B checking ONEDIR_REV ,$ONEDIR_REV," - # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3046,10 +2993,7 @@ __install_saltstack_ubuntu_onedir_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - ## DGM include hwclock if not part of base OS (23.10 and up) + ## include hwclock if not part of base OS (23.10 and up) if [ ! -f /usr/sbin/hwclock ]; then __PACKAGES="${__PACKAGES} util-linux-extra" fi @@ -3108,10 +3052,7 @@ install_ubuntu_deps() { # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 __PACKAGES="${__PACKAGES} procps pciutils" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - ## DGM include hwclock if not part of base OS (23.10 and up) + ## include hwclock if not part of base OS (23.10 and up) if [ ! -f /usr/sbin/hwclock ]; then __PACKAGES="${__PACKAGES} util-linux-extra" fi @@ -3146,8 +3087,7 @@ install_ubuntu_stable_deps() { if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc., added 23 & 24 to continue style - ## also apt-key is deprecated + ## apt-key is deprecated if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3196,10 +3136,7 @@ install_ubuntu_git_deps() { __PACKAGES="${__PACKAGES} g++" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - - ## DGM include hwclock if not part of base OS (23.10 and up) + ## include hwclock if not part of base OS (23.10 and up) if [ ! -f /usr/sbin/hwclock ]; then __PACKAGES="${__PACKAGES} util-linux-extra" fi @@ -3207,8 +3144,6 @@ install_ubuntu_git_deps() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - ## DGM install_ubuntu_stable_deps || return 1 - # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf" @@ -3233,8 +3168,7 @@ install_ubuntu_onedir_deps() { if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - ## TBD DGM Need to understand what this code is doing, since '-ge 20' already covers '-ge 21' etc. - ## also apt-key is deprecated + ## apt-key is deprecated if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ] || [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || [ "$DISTRO_MAJOR_VERSION" -ge 23 ] || [ "$DISTRO_MAJOR_VERSION" -ge 24 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else @@ -3270,11 +3204,7 @@ install_ubuntu_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 @@ -3297,14 +3227,6 @@ install_ubuntu_git() { return 1 fi - ## DGM this original code was then negated to "" originally, why was it not removed ? - ## DGM # We can use --prefix on debian based ditributions - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM else - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM fi - _POST_NEON_PIP_INSTALL_ARGS="" __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1 cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1 @@ -3337,11 +3259,7 @@ install_ubuntu_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 @@ -3521,8 +3439,6 @@ __install_saltstack_debian_repository() { set -x echodebug "__install_saltstack_debian_repository() entry" - echodebug "DGM Debian C checking STABLE_REV ,${STABLE_REV}," - DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" @@ -3544,11 +3460,7 @@ __install_saltstack_debian_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086,SC2090 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${STABLE_REV}" @@ -3568,8 +3480,6 @@ __install_saltstack_debian_onedir_repository() { DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" - echodebug "DGM Debian B checking, ONEDIR_REV ,$ONEDIR_REV," - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -3588,11 +3498,7 @@ __install_saltstack_debian_onedir_repository() { __PACKAGES="${__PACKAGES} apt-transport-https ca-certificates" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086,SC2090 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 # amd64 is just a part of repository URI @@ -3607,69 +3513,6 @@ __install_saltstack_debian_onedir_repository() { __wait_for_apt apt-get update || return 1 } -## DGM install_debian_deps() { -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM echodebug "install_debian_deps() entry" -## DGM -## DGM if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then -## DGM echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." -## DGM fi -## DGM -## DGM # No user interaction, libc6 restart services for example -## DGM export DEBIAN_FRONTEND=noninteractive -## DGM -## DGM __wait_for_apt apt-get update || return 1 -## DGM -## DGM if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then -## DGM # Try to update GPG keys first if allowed -## DGM if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then -## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 10 ]; then -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 -## DGM else -## DGM __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && -## DGM apt-key update && apt-get update || return 1 -## DGM fi -## DGM fi -## DGM -## DGM __apt_get_upgrade_noinput || return 1 -## DGM fi -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python version is no longer supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 -## DGM __PACKAGES='procps pciutils' -## DGM -## DGM # YAML module is used for generating custom master/minion configs -## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then -## DGM __check_dpkg_architecture || return 1 -## DGM __install_saltstack_debian_repository || return 1 -## DGM fi -## DGM -## DGM if [ "${_EXTRA_PACKAGES}" != "" ]; then -## DGM echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 -## DGM fi -## DGM -## DGM return 0 -## DGM } - install_debian_onedir_deps() { ## DGM Debugging set -v @@ -3677,8 +3520,6 @@ install_debian_onedir_deps() { echodebug "install_debian_onedir_git_deps() entry" - echodebug "DGM Debian A checking ONEDIR_REV ,$ONEDIR_REV," - if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3713,11 +3554,7 @@ install_debian_onedir_deps() { # YAML module is used for generating custom master/minion configs __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then @@ -3728,37 +3565,12 @@ install_debian_onedir_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${_EXTRA_PACKAGES}" || return 1 __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 } -## DGM install_debian_git_pre() { -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM echodebug "install_debian_git_pre() entry" -## DGM -## DGM if ! __check_command_exists git; then -## DGM __apt_get_install_noinput git || return 1 -## DGM fi -## DGM -## DGM if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then -## DGM __apt_get_install_noinput ca-certificates -## DGM fi -## DGM -## DGM __git_clone_and_checkout || return 1 -## DGM -## DGM # Let's trigger config_salt() -## DGM if [ "$_TEMP_CONFIG_DIR" = "null" ]; then -## DGM _TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/" <----- trailing slash ???? -## DGM CONFIG_SALT_FUNC="config_salt" -## DGM fi -## DGM } - install_debian_git_deps() { ## DGM Debugging set -v @@ -3768,10 +3580,6 @@ install_debian_git_deps() { __wait_for_apt apt-get update || return 1 - ## DGM ? if ! __check_command_exists git; then - ## DGM ? __apt_get_install_noinput git || return 1 - ## DGM ? fi - if ! __check_command_exists git; then __apt_get_install_noinput git-core || return 1 fi @@ -3790,11 +3598,7 @@ install_debian_git_deps() { __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" echodebug "install_debian_git_deps() Installing ${__PACKAGES}" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -3806,35 +3610,6 @@ install_debian_git_deps() { return 0 } -## DGM DGM ------------------------------------- -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM echodebug "install_debian_git_deps() entry" -## DGM -## DGM install_debian_deps || return 1 -## DGM install_debian_git_pre || return 1 -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python version is no longer supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM __PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" -## DGM echodebug "install_debian_git_deps() Installing ${__PACKAGES}" -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 -## DGM __apt_get_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM return 0 -## DGM -## DGM } - install_debian_stable() { __PACKAGES="" @@ -3851,11 +3626,7 @@ install_debian_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 @@ -3887,13 +3658,6 @@ install_debian_git() { fi # We can use --prefix on debian based ditributions - ## DGM this original code was then negated to "" originally, why was it not removed ? - ## DGM # We can use --prefix on debian based ditributions - ## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python3/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM else - ## DGM _POST_NEON_PIP_INSTALL_ARGS="--target=/usr/lib/python2.7/dist-packages --install-option=--install-scripts=/usr/bin" - ## DGM fi _POST_NEON_PIP_INSTALL_ARGS="" @@ -3937,11 +3701,7 @@ install_debian_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## __apt_get_install_noinput "${__PACKAGES}" || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1 return 0 @@ -3982,25 +3742,6 @@ install_debian_git_post() { /bin/systemctl enable "salt-${fname}.service" SYSTEMD_RELOAD=$BS_TRUE - - ## DGM # Install initscripts for Debian 7 "Wheezy" - ## DGM elif [ ! -f "/etc/init.d/salt-$fname" ] || \ - ## DGM { [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then - ## DGM __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}" - ## DGM __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}" - - ## DGM if [ ! -f "/etc/init.d/salt-${fname}" ]; then - ## DGM echowarn "The init script for salt-${fname} was not found, skipping it..." - ## DGM continue - ## DGM fi - - ## DGM chmod +x "/etc/init.d/salt-${fname}" - - ## DGM # Skip salt-api since the service should be opt-in and not necessarily started on boot - ## DGM [ "$fname" = "api" ] && continue - - ## DGM update-rc.d "salt-${fname}" defaults - fi done } @@ -4093,7 +3834,6 @@ __install_saltstack_fedora_onedir_repository() { if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then - ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/fedora/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" fi @@ -4124,8 +3864,8 @@ install_fedora_deps() { # Salt on Fedora is Py3 PY_PKG_VER=3 - ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream + ## find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after + ## but find it on 8 and 9 Centos Stream __PACKAGES="${__PACKAGES} dnf-utils libyaml procps-ng python${PY_PKG_VER}-crypto python${PY_PKG_VER}-jinja2" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-msgpack python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq" __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-pip python${PY_PKG_VER}-m2crypto python${PY_PKG_VER}-pyyaml" @@ -4134,97 +3874,12 @@ install_fedora_deps() { echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __dnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 return 0 } -## DGM install_fedora_stable() { -## DGM ## DGM Debugging -## DGM set -v -## DGM set -x -## DGM -## DGM if [ "$STABLE_REV" = "latest" ]; then -## DGM __SALT_VERSION="" -## DGM else -## DGM __SALT_VERSION="$(dnf list --showduplicates salt | grep "$STABLE_REV" | head -n 1 | awk '{print $2}')" -## DGM # shellcheck disable=SC2268 -## DGM if [ "x${__SALT_VERSION}" = "x" ]; then -## DGM echoerror "Could not find a stable install for Salt ${STABLE_REV}" -## DGM exit 1 -## DGM fi -## DGM echoinfo "Installing Stable Package Version ${__SALT_VERSION}" -## DGM __SALT_VERSION="-${__SALT_VERSION}" -## DGM fi -## DGM __PACKAGES="" -## DGM -## DGM if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then -## DGM __PACKAGES="${__PACKAGES} salt-cloud${__SALT_VERSION}" -## DGM fi -## DGM if [ "$_INSTALL_MASTER" -eq $BS_TRUE ]; then -## DGM __PACKAGES="${__PACKAGES} salt-master${__SALT_VERSION}" -## DGM fi -## DGM if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then -## DGM __PACKAGES="${__PACKAGES} salt-minion${__SALT_VERSION}" -## DGM fi -## DGM if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ]; then -## DGM __PACKAGES="${__PACKAGES} salt-syndic${__SALT_VERSION}" -## DGM fi -## DGM -## DGM ## DGM tornado appears to be missing in 3006.x pkg requirements -## DGM ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" -## DGM -## DGM # shellcheck disable=SC2086 -## DGM ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 -## DGM __dnf_install_noinput ${__PACKAGES} || return 1 -## DGM -## DGM ## DGM __python="python3" -## DGM if ! __check_command_exists python3; then -## DGM echoerror "Could not find a python3 binary?!" -## DGM return 1 -## DGM fi -## DGM -## DGM ## DGM if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then -## DGM ## DGM __check_pip_allowed "You need to allow pip based installations (-P) for Tornado <5.0 in order to install Salt" -## DGM ## DGM __installed_tornado_rpm=$(rpm -qa | grep python${PY_PKG_VER}-tornado) -## DGM ## DGM if [ -n "${__installed_tornado_rpm}" ]; then -## DGM ## DGM echodebug "Removing system package ${__installed_tornado_rpm}" -## DGM ## DGM rpm -e --nodeps "${__installed_tornado_rpm}" || return 1 -## DGM ## DGM fi -## DGM ## DGM __get_site_packages_dir_code=$(cat << EOM -## DGM ## DGM import site -## DGM ## DGM print([d for d in site.getsitepackages() if d.startswith('/usr/lib/python')][0]) -## DGM ## DGM EOM -## DGM ## DGM ) -## DGM ## DGM __target_path=$(${__python} -c "${__get_site_packages_dir_code}") -## DGM ## DGM echodebug "Running '${__python}' -m pip install --target ${__target_path} 'tornado<5.0'" -## DGM ## DGM "${__python}" -m pip install --target "${__target_path}" "tornado<5" || return 1 -## DGM ## DGM fi -## DGM -## DGM return 0 -## DGM } - -## DGM install_fedora_stable_post() { -## DGM for fname in api master minion syndic; do -## DGM # Skip salt-api since the service should be opt-in and not necessarily started on boot -## DGM [ $fname = "api" ] && continue -## DGM -## DGM # Skip if not meant to be installed -## DGM [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue -## DGM [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue -## DGM [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue -## DGM -## DGM systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) -## DGM sleep 1 -## DGM systemctl daemon-reload -## DGM done -## DGM } - install_fedora_git_deps() { if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" @@ -4239,12 +3894,8 @@ install_fedora_git_deps() { __PACKAGES="${__PACKAGES} git" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - if [ -n "${__PACKAGES}" ]; then # shellcheck disable=SC2086 - ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} || return 1 __PACKAGES="" fi @@ -4429,11 +4080,7 @@ install_fedora_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 return 0 @@ -4446,9 +4093,6 @@ install_fedora_onedir_post() { STABLE_REV=$ONEDIR_REV - ## DGM install_fedora_stable_post || return 1 - ## DGM this was the only caller to install_fedora_stable_post, so moved it here - for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue @@ -4563,41 +4207,14 @@ install_centos_stable_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - ## DGM ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - ## DGM ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM ## DGM else - ## DGM ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM ## DGM fi - - ## DGM ## DGM __PACKAGES="${__PACKAGES} procps" - - ## DGM __PACKAGES="yum-utils chkconfig procps-ng" - - ## DGM Trying original - ### if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ### __PACKAGES="dnf-utils chkconfig" - ### else - ### __PACKAGES="yum-utils chkconfig" - ### fi - - ### __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng findutils" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi @@ -4620,11 +4237,7 @@ install_centos_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 # Workaround for 3.11 broken on CentOS Stream 8.x @@ -4704,11 +4317,7 @@ install_centos_git_deps() { __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4810,45 +4419,14 @@ install_centos_onedir_deps() { __install_saltstack_rhel_onedir_repository || return 1 fi - ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} procps" - - ## DGM __PACKAGES="yum-utils chkconfig procps-ng" - - ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream, and Alma 8 & 9 but versions we are using doesn't have them - ## DGM also EL9 doesn't have propcs and probably don't need these packages since using onedir - - ## DGM trying original - ## if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## __PACKAGES="dnf-utils chkconfig" - ## else - ## __PACKAGES="yum-utils chkconfig" - ## fi - - ## __PACKAGES="${__PACKAGES} procps" - __PACKAGES="yum-utils chkconfig procps-ng findutils" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi @@ -4871,11 +4449,7 @@ install_centos_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 return 0 @@ -5298,7 +4872,6 @@ install_oracle_linux_stable_deps() { _EPEL_REPO=oracle-epel-release-el${DISTRO_MAJOR_VERSION} if ! rpm -q "${_EPEL_REPO}" > /dev/null; then # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EPEL_REPO}" __yum_install_noinput ${_EPEL_REPO} fi _EPEL_REPOS_INSTALLED=$BS_TRUE @@ -5731,9 +5304,6 @@ install_alpine_linux_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 apk -U add "${__PACKAGES}" || return 1 return 0 @@ -5860,7 +5430,6 @@ install_amazon_linux_ami_2_git_deps() { if ! __check_command_exists "${PIP_EXE}"; then # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 fi @@ -5872,11 +5441,7 @@ install_amazon_linux_ami_2_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -5943,7 +5508,6 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -6001,7 +5565,6 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -6071,7 +5634,6 @@ install_amazon_linux_ami_2023_git_deps() { if ! __check_command_exists "${PIP_EXE}"; then # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 fi @@ -6083,11 +5645,7 @@ install_amazon_linux_ami_2023_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -6148,7 +5706,6 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi } @@ -6239,8 +5796,6 @@ install_arch_linux_stable_deps() { # YAML module is used for generating custom master/minion configs # shellcheck disable=SC2086 pacman -Su --noconfirm --needed python${PY_PKG_VER}-yaml - - ## DGM tornado appears to be missing in 3006.x pkg requirements pacman -Su --noconfirm --needed python${PY_PKG_VER}-tornado if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then @@ -6251,7 +5806,6 @@ install_arch_linux_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM pacman -Su --noconfirm --needed "${_EXTRA_PACKAGES}" || return 1 pacman -Su --noconfirm --needed ${_EXTRA_PACKAGES} || return 1 fi } @@ -6275,11 +5829,7 @@ install_arch_linux_git_deps() { __PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM pacman -Su --noconfirm --needed "${__PACKAGES}" pacman -Su --noconfirm --needed ${__PACKAGES} # Let's trigger config_salt() @@ -6487,12 +6037,7 @@ __install_saltstack_photon_onedir_repository() { REPO_FILE="/etc/yum.repos.d/salt.repo" if [ ! -s "$REPO_FILE" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then - ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${ONEDIR_REV}" - ## DGM if [ "${ONEDIR_REV}" = "nightly" ] ; then - ## DGM FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" - ## DGM fi - - ## DGM the salt repo has issues, need the Major version dot Zero, eg: 4.0, 5.0 + ## salt repo 4 & 5 have issues, need the Major version dot Zero, eg: 4.0, 5.0 FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}.0/${CPU_ARCH_L}/${ONEDIR_REV}" if [ "${ONEDIR_REV}" = "nightly" ] ; then FETCH_URL="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/photon/${DISTRO_MAJOR_VERSION}.0/${CPU_ARCH_L}/" @@ -6540,11 +6085,7 @@ install_photon_deps() { echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${__PACKAGES}" "${_EXTRA_PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} ${_EXTRA_PACKAGES} || return 1 return 0 @@ -6602,19 +6143,16 @@ install_photon_git_deps() { __git_clone_and_checkout || return 1 - ## DGM __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64" __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64 cython${PY_PKG_VER}" echodebug "install_photon_git_deps() distro major version, ${DISTRO_MAJOR_VERSION}" - ## DGM Photon 5 container is missing systemd on default installation + ## Photon 5 container is missing systemd on default installation if [ "${DISTRO_MAJOR_VERSION}" -lt 5 ]; then - ## DGM tornado appears to be missing in 3006.x pkg requirements __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" fi # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then @@ -6639,8 +6177,6 @@ install_photon_git() { set -x echodebug "install_photon_git() entry" - ## DGM install_photon_git_deps || return 1 - if [ "${_PY_EXE}" != "" ]; then _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" @@ -6771,17 +6307,12 @@ install_photon_onedir_deps() { __PACKAGES="procps-ng" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${_EXTRA_PACKAGES}" || return 1 __tdnf_install_noinput ${_EXTRA_PACKAGES} || return 1 fi @@ -6813,11 +6344,7 @@ install_photon_onedir() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __tdnf_install_noinput "${__PACKAGES}" || return 1 __tdnf_install_noinput ${__PACKAGES} || return 1 return 0 @@ -6953,17 +6480,12 @@ install_opensuse_stable_deps() { # Salt needs python-zypp installed in order to use the zypper module __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests python${PY_PKG_VER}-zypp" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __zypper_install "${_EXTRA_PACKAGES}" || return 1 __zypper_install ${_EXTRA_PACKAGES} || return 1 fi @@ -6990,11 +6512,7 @@ install_opensuse_git_deps() { __PACKAGES="python3-pip python3-setuptools gcc" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -7026,11 +6544,7 @@ install_opensuse_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __zypper_install "$__PACKAGES" || return 1 __zypper_install $__PACKAGES || return 1 return 0 @@ -7190,17 +6704,12 @@ install_opensuse_15_stable_deps() { # requests is still used by many salt modules __PACKAGES="python${PY_PKG_VER}-PyYAML python${PY_PKG_VER}-requests" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __zypper_install "${_EXTRA_PACKAGES}" || return 1 __zypper_install ${_EXTRA_PACKAGES} || return 1 fi @@ -7224,11 +6733,7 @@ install_opensuse_15_git_deps() { PY_PKG_VER=3 __PACKAGES="python${PY_PKG_VER}-xml python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __zypper_install "${__PACKAGES}" || return 1 __zypper_install ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -7408,10 +6913,7 @@ __gentoo_post_dep() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __autounmask "${_EXTRA_PACKAGES}" || return 1 __autounmask ${_EXTRA_PACKAGES} || return 1 - # shellcheck disable=SC2086 - ## DGM __emerge "${_EXTRA_PACKAGES}" || return 1 __emerge ${_EXTRA_PACKAGES} || return 1 fi @@ -7487,10 +6989,7 @@ install_gentoo_stable() { fi # shellcheck disable=SC2086 - ## DGM __autounmask "${GENTOO_SALT_PACKAGE}" || return 1 __autounmask ${GENTOO_SALT_PACKAGE} || return 1 - # shellcheck disable=SC2086 - ## DGM __emerge "${GENTOO_SALT_PACKAGE}" || return 1 __emerge ${GENTOO_SALT_PACKAGE} || return 1 } @@ -7802,20 +7301,12 @@ __macosx_get_packagesite_onedir() { SALTPKGCONFURL="https://${_REPO_URL}/${_ONEDIR_DIR}/${__PY_VERSION_REPO}/macos/${ONEDIR_REV}/${PKG}" } -# Using a separate conf step to head for idempotent install... -## DGM __configure_macosx_pkg_details() { -## DGM ## DGM __macosx_get_packagesite || return 1 -## DGM __macosx_get_packagesite_onedir || return 1 -## DGM return 0 -## DGM } - __configure_macosx_pkg_details_onedir() { __macosx_get_packagesite_onedir || return 1 return 0 } install_macosx_stable_deps() { - ## DGM __configure_macosx_pkg_details || return 1 __configure_macosx_pkg_details_onedir || return 1 return 0 } diff --git a/kitchen.yml b/kitchen.yml index bf03a68..4fe49f6 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -28,13 +28,20 @@ provisioner: mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' + +## - name: amazon-2023 +## driver: +## image: amazonlinux:2023 +## provision_command: +## - yum -y install --allowerasing procps-ng curl +## - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config + platforms: - name: almalinux-9 driver: provision_command: - dnf -y install crypto-policies-scripts procps-ng - update-crypto-policies --set DEFAULT:SHA1 - ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: almalinux-8 - name: amazon-2 @@ -43,15 +50,6 @@ platforms: platform: rhel provision_command: - yum -y install procps-ng - - name: amazon-2023 - driver: - image: amazonlinux:2023 - ## DGM platform: fedora - ## DGM platform: rhel - provision_command: - ## DGM - yum -y install procps-ng - - yum -y install --allowerasing procps-ng curl - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: arch driver: image: archlinux/archlinux @@ -66,11 +64,7 @@ platforms: provision_command: - dnf -y install crypto-policies-scripts procps-ng - update-crypto-policies --set DEFAULT:SHA1 - ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - ## DGM - name: centos-stream8 - ## DGM driver: - ## DGM image: quay.io/centos/centos:stream8 - name: debian-11 driver: image: debian:bullseye @@ -125,18 +119,13 @@ platforms: provision_command: - dnf -y install crypto-policies-scripts procps-ng - update-crypto-policies --set DEFAULT:SHA1 - ### DGM - yum -y install crypto-policies-scripts procps-ng - ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: oraclelinux-9 driver: - ## DGM platform: centosstream run_command: /usr/lib/systemd/systemd provision_command: - dnf -y install crypto-policies-scripts procps-ng - update-crypto-policies --set DEFAULT:SHA1 - ### DGM - yum -y install crypto-policies-scripts procps-ng - ### DGM - update-crypto-policies --set DEFAULT:SHA256 - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - name: rockylinux-8 - name: oraclelinux-8 From de725f809f416aead39c23a59f24e0aed8118e4c Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 11 Jul 2024 10:25:32 -0600 Subject: [PATCH 77/80] Using v3 for upload-artifact --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/templates/ci.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 704b6b2..7c08121 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -88,8 +88,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -116,8 +116,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index 8890a91..f45c9e3 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -49,8 +49,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -88,8 +88,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus @@ -116,8 +116,8 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@v4 - ## DGM uses: actions/upload-artifact@v3 + ## DGM uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: exitstatus path: exitstatus From bc7fa40ed72b5c6c59ea2b11d896da99e1a3cd6d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 11 Jul 2024 10:53:08 -0600 Subject: [PATCH 78/80] Revert uses of geekyeggo delete-artifact to original values for version --- .github/workflows/ci.yml | 4 ++-- .github/workflows/templates/ci-tail.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c08121..1c796fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -541,8 +541,8 @@ jobs: - name: Delete Exit Status Artifacts if: always() - ## DGM uses: geekyeggo/delete-artifact@v4 - uses: geekyeggo/delete-artifact@v3 + ## DGM uses: geekyeggo/delete-artifact@v3 + uses: geekyeggo/delete-artifact@v4 with: name: exitstatus failOnError: false diff --git a/.github/workflows/templates/ci-tail.yml b/.github/workflows/templates/ci-tail.yml index 2314089..e245f99 100644 --- a/.github/workflows/templates/ci-tail.yml +++ b/.github/workflows/templates/ci-tail.yml @@ -19,8 +19,8 @@ - name: Delete Exit Status Artifacts if: always() - ## DGM uses: geekyeggo/delete-artifact@v4 - uses: geekyeggo/delete-artifact@v3 + ## DGM uses: geekyeggo/delete-artifact@v3 + uses: geekyeggo/delete-artifact@v4 with: name: exitstatus failOnError: false From 9a788851ffbd20784f7242b4964d108346a0b100 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 11 Jul 2024 13:50:50 -0600 Subject: [PATCH 79/80] Final cleanup of debugging, and add support for Arm64 for MacOS --- .github/workflows/ci.yml | 10 -- .github/workflows/templates/ci-tail.yml | 2 - .github/workflows/templates/ci.yml | 8 - CHANGELOG.md | 7 +- bootstrap-salt.sh | 192 +----------------------- kitchen.macos.yml | 3 - kitchen.windows.yml | 3 - 7 files changed, 6 insertions(+), 219 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c796fe..9c4e9cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,12 @@ jobs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files uses: tj-actions/changed-files@v42 - ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,7 +47,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus @@ -63,7 +60,6 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v4 @@ -88,7 +84,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus @@ -98,12 +93,10 @@ jobs: name: Lint runs-on: ubuntu-latest needs: collect-changed-files - ## DGM container: koalaman/shellcheck-alpine:v0.7.0 container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -116,7 +109,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus @@ -533,7 +525,6 @@ jobs: - name: Download Exit Status Files if: always() - ## DGM uses: actions/download-artifact@v4 uses: actions/download-artifact@v3 with: name: exitstatus @@ -541,7 +532,6 @@ jobs: - name: Delete Exit Status Artifacts if: always() - ## DGM uses: geekyeggo/delete-artifact@v3 uses: geekyeggo/delete-artifact@v4 with: name: exitstatus diff --git a/.github/workflows/templates/ci-tail.yml b/.github/workflows/templates/ci-tail.yml index e245f99..e811d7f 100644 --- a/.github/workflows/templates/ci-tail.yml +++ b/.github/workflows/templates/ci-tail.yml @@ -11,7 +11,6 @@ - name: Download Exit Status Files if: always() - ## DGM uses: actions/download-artifact@v4 uses: actions/download-artifact@v3 with: name: exitstatus @@ -19,7 +18,6 @@ - name: Delete Exit Status Artifacts if: always() - ## DGM uses: geekyeggo/delete-artifact@v3 uses: geekyeggo/delete-artifact@v4 with: name: exitstatus diff --git a/.github/workflows/templates/ci.yml b/.github/workflows/templates/ci.yml index f45c9e3..0f292d3 100644 --- a/.github/workflows/templates/ci.yml +++ b/.github/workflows/templates/ci.yml @@ -17,14 +17,12 @@ jobs: run-tests: ${{ steps.set-output.outputs.run-tests }} steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get specific changed files id: changed-files uses: tj-actions/changed-files@v42 - ## DGM uses: tj-actions/changed-files@v25 with: separator: "," files: | @@ -49,7 +47,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus @@ -63,7 +60,6 @@ jobs: if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v4 @@ -88,7 +84,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus @@ -98,12 +93,10 @@ jobs: name: Lint runs-on: ubuntu-latest needs: collect-changed-files - ## DGM container: koalaman/shellcheck-alpine:v0.7.0 container: koalaman/shellcheck-alpine:latest if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' steps: - uses: actions/checkout@v4 - ## DGM - uses: actions/checkout@v3 - name: ShellCheck run: | shellcheck -s sh -f tty bootstrap-salt.sh @@ -116,7 +109,6 @@ jobs: - name: Upload Exit Status if: always() - ## DGM uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 with: name: exitstatus diff --git a/CHANGELOG.md b/CHANGELOG.md index 618349a..12028ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,7 @@ -# v2024.07.XX +# v2024.07.11 ## What's Changed -## DGM - Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities - - Migrated to using GitHub Actions - Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7 - Removed support for FreeBSD and OpenBSD @@ -14,8 +12,9 @@ - Removed '-y' option which was experimental and only on RHEL 7 or less which are now EOL - Updated to current stable version of Ruby v3.3.4 - Removed git-master support for Photon 4 & 5 due to gcc errors building salt. +- Add support for Arm64 for MacOS -**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.06.XX +**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.07.11 # v2024.04.03 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9313bf1..3248042 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh # WARNING: Changes to this file in the salt repo will be overwritten! # Please submit pull requests against the salt-bootstrap repo: @@ -1913,14 +1913,10 @@ __function_defined() { # process is finished so the script doesn't exit on a locked proc. #---------------------------------------------------------------------------------------------------------------------- __wait_for_apt(){ - ## DGM Debugging - set -v - set -x - # Timeout set at 15 minutes WAIT_TIMEOUT=900 - ## DGM see if sync'ing the clocks helps + ## see if sync'ing the clocks helps if [ -f /usr/sbin/hwclock ]; then /usr/sbin/hwclock -s fi @@ -1929,8 +1925,6 @@ __wait_for_apt(){ "${@}" 2>"$APT_ERR" APT_RETURN=$? - echoerror"DGM __wait_for_apt APT_ERR: $APT_ERR" - # Make sure we're not waiting on a lock while [ "$APT_RETURN" -ne 0 ] && grep -q '^E: Could not get lock' "$APT_ERR"; do echoinfo "Aware of the lock. Patiently waiting $WAIT_TIMEOUT more seconds..." @@ -1995,9 +1989,6 @@ __temp_gpg_pub() { # PARAMETERS: url #---------------------------------------------------------------------------------------------------------------------- __apt_key_fetch() { - ## DGM Debugging - set -v - set -x url=$1 @@ -2040,10 +2031,6 @@ __rpm_import_gpg() { # DESCRIPTION: (DRY) yum install with noinput options #---------------------------------------------------------------------------------------------------------------------- __yum_install_noinput() { - ## DGM Debugging - set -v - set -x - if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then # We need to install one package at a time because --enablerepo=X disables ALL OTHER REPOS!!!! for package in "${@}"; do @@ -2059,10 +2046,6 @@ __yum_install_noinput() { # DESCRIPTION: (DRY) dnf install with noinput options #---------------------------------------------------------------------------------------------------------------------- __dnf_install_noinput() { - ## DGM Debugging - set -v - set -x - dnf -y install "${@}" || return $? } # ---------- end of function __dnf_install_noinput ---------- @@ -2071,10 +2054,6 @@ __dnf_install_noinput() { # DESCRIPTION: (DRY) tdnf install with noinput options #---------------------------------------------------------------------------------------------------------------------- __tdnf_install_noinput() { - ## DGM Debugging - set -v - set -x - tdnf -y install "${@}" || return $? } # ---------- end of function __tdnf_install_noinput ---------- @@ -2084,10 +2063,6 @@ __tdnf_install_noinput() { # specific revision. #---------------------------------------------------------------------------------------------------------------------- __git_clone_and_checkout() { - ## DGM Debugging - set -v - set -x - echodebug "Installed git version: $(git --version | awk '{ print $3 }')" # Turn off SSL verification if -I flag was set for insecure downloads if [ "$_INSECURE_DL" -eq $BS_TRUE ]; then @@ -2664,10 +2639,6 @@ __install_pip_deps() { # PARAMETERS: py_exe #---------------------------------------------------------------------------------------------------------------------- __install_salt_from_repo_post_neon() { - ## DGM Debugging - set -v - set -x - _py_exe="$1" if [ "${_py_exe}" = "" ]; then @@ -2916,10 +2887,6 @@ __enable_universe_repository() { __install_saltstack_ubuntu_repository() { # Workaround for latest non-LTS Ubuntu - ## DGM Debugging - set -v - set -x - echodebug "__install_saltstack_ubuntu_repository() entry" if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \ @@ -3070,10 +3037,6 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - ## DGM Debugging - set -v - set -x - echodebug "install_ubuntu_stable_deps() entry" if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then @@ -3108,10 +3071,6 @@ install_ubuntu_stable_deps() { } install_ubuntu_git_deps() { - ## DGM Debugging - set -v - set -x - echodebug "install_ubuntu_git_deps() entry" __wait_for_apt apt-get update || return 1 @@ -3154,9 +3113,6 @@ install_ubuntu_git_deps() { } install_ubuntu_onedir_deps() { - ## DGM Debugging - set -v - set -x if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -3211,10 +3167,6 @@ install_ubuntu_stable() { } install_ubuntu_git() { - ## DGM Debugging - set -v - set -x - # Activate virtualenv before install if [ "${_VIRTUALENV_DIR}" != "null" ]; then __activate_virtualenv || return 1 @@ -3434,9 +3386,6 @@ install_ubuntu_check_services() { # Debian Install Functions # __install_saltstack_debian_repository() { - ## DGM Debugging - set -v - set -x echodebug "__install_saltstack_debian_repository() entry" DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" @@ -3472,9 +3421,6 @@ __install_saltstack_debian_repository() { } __install_saltstack_debian_onedir_repository() { - ## DGM Debugging - set -v - set -x echodebug "__install_saltstack_debian_onedir_repository() entry" DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" @@ -3514,10 +3460,6 @@ __install_saltstack_debian_onedir_repository() { } install_debian_onedir_deps() { - ## DGM Debugging - set -v - set -x - echodebug "install_debian_onedir_git_deps() entry" if [ "$_START_DAEMONS" -eq $BS_FALSE ]; then @@ -3572,10 +3514,6 @@ install_debian_onedir_deps() { } install_debian_git_deps() { - ## DGM Debugging - set -v - set -x - echodebug "install_debian_git_deps() entry" __wait_for_apt apt-get update || return 1 @@ -3645,10 +3583,6 @@ install_debian_12_git_deps() { } install_debian_git() { - ## DGM Debugging - set -v - set -x - if [ -n "$_PY_EXE" ]; then _PYEXE=${_PY_EXE} else @@ -3810,10 +3744,6 @@ install_debian_check_services() { # __install_saltstack_fedora_onedir_repository() { - ## DGM Debugging - set -v - set -x - if [ "$ITYPE" = "stable" ]; then REPO_REV="$ONEDIR_REV" else @@ -3904,7 +3834,6 @@ install_fedora_git_deps() { __PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc gcc-c++" # shellcheck disable=SC2086 - ## DGM __dnf_install_noinput "${__PACKAGES}" || return 1 __dnf_install_noinput ${__PACKAGES} || return 1 # Let's trigger config_salt() @@ -3921,7 +3850,6 @@ install_fedora_git() { _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" else - ## DGM _PYEXE='python2' echoerror "Python 2 is no longer supported, only Py3 packages" return 1 fi @@ -4001,10 +3929,6 @@ install_fedora_check_services() { } install_fedora_onedir_deps() { - ## DGM Debugging - set -v - set -x - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -4026,29 +3950,14 @@ install_fedora_onedir_deps() { __install_saltstack_fedora_onedir_repository || return 1 fi - ## DGM can find no dnf-utils in Fedora packaging archives and yum-utils EL7 and F30, none after - ## DGM but find it on 8 and 9 Centos Stream also EL9 doesn't have propcs - ## DGM if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then - ## DGM __PACKAGES="dnf-utils chkconfig" - ## DGM else - ## DGM __PACKAGES="yum-utils chkconfig" - ## DGM fi - - ## DGM __PACKAGES="${__PACKAGES} procps" - __PACKAGES="dnf-utils chkconfig procps-ng" - ## DGM tornado appears to be missing in 3006.x pkg requirements - ## DGM __PACKAGES="${__PACKAGES} python${PY_PKG_VER}-tornado" - # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${__PACKAGES}" || return 1 __yum_install_noinput ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - ## DGM __yum_install_noinput "${_EXTRA_PACKAGES}" || return 1 __yum_install_noinput ${_EXTRA_PACKAGES} || return 1 fi @@ -4058,10 +3967,6 @@ install_fedora_onedir_deps() { install_fedora_onedir() { - ## DGM Debugging - set -v - set -x - STABLE_REV=$ONEDIR_REV #install_fedora_stable || return 1 @@ -4087,10 +3992,6 @@ install_fedora_onedir() { } install_fedora_onedir_post() { - ## DGM Debugging - set -v - set -x - STABLE_REV=$ONEDIR_REV for fname in api master minion syndic; do @@ -4120,10 +4021,6 @@ install_fedora_onedir_post() { # CentOS Install Functions # __install_saltstack_rhel_onedir_repository() { - ## DGM Debugging - set -v - set -x - if [ "$ITYPE" = "stable" ]; then repo_rev="$ONEDIR_REV" else @@ -4181,10 +4078,6 @@ _eof } install_centos_stable_deps() { - ## DGM Debugging - set -v - set -x - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -4282,10 +4175,6 @@ install_centos_stable_post() { } install_centos_git_deps() { - ## DGM Debugging - set -v - set -x - # First try stable deps then fall back to onedir deps if that one fails # if we're installing on a Red Hat based host that doesn't have the classic # package repos available. @@ -4331,10 +4220,6 @@ install_centos_git_deps() { } install_centos_git() { - ## DGM Debugging - set -v - set -x - if [ "${_PY_EXE}" != "" ]; then _PYEXE=${_PY_EXE} echoinfo "Using the following python version: ${_PY_EXE} to install salt" @@ -4350,10 +4235,6 @@ install_centos_git() { } install_centos_git_post() { - ## DGM Debugging - set -v - set -x - SYSTEMD_RELOAD=$BS_FALSE for fname in api master minion syndic; do @@ -4394,10 +4275,6 @@ install_centos_git_post() { } install_centos_onedir_deps() { - ## DGM Debugging - set -v - set -x - if [ "$_UPGRADE_SYS" -eq "$BS_TRUE" ]; then yum -y update || return 1 fi @@ -5454,10 +5331,6 @@ install_amazon_linux_ami_2_git_deps() { } install_amazon_linux_ami_2_deps() { - ## DGM Debugging - set -v - set -x - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 @@ -6017,9 +5890,6 @@ install_arch_linux_onedir_post() { # __install_saltstack_photon_onedir_repository() { - ## DGM Debugging - set -v - set -x echodebug "__install_saltstack_photon_onedir_repository() entry" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then @@ -6059,9 +5929,6 @@ __install_saltstack_photon_onedir_repository() { } install_photon_deps() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_deps() entry" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then @@ -6092,9 +5959,6 @@ install_photon_deps() { } install_photon_stable_post() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_stable_post() entry" for fname in api master minion syndic; do @@ -6113,9 +5977,6 @@ install_photon_stable_post() { } install_photon_git_deps() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_git_deps() entry" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then @@ -6172,9 +6033,6 @@ install_photon_git_deps() { } install_photon_git() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_git() entry" if [ "${_PY_EXE}" != "" ]; then @@ -6194,9 +6052,6 @@ install_photon_git() { } install_photon_git_post() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_git_post() entry" for fname in api master minion syndic; do @@ -6231,9 +6086,6 @@ install_photon_git_post() { install_photon_restart_daemons() { [ "$_START_DAEMONS" -eq $BS_FALSE ] && return - ## DGM Debugging - set -v - set -x echodebug "install_photon_restart_daemons() entry" @@ -6257,9 +6109,6 @@ install_photon_restart_daemons() { } install_photon_check_services() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_check_services() entry" for fname in api master minion syndic; do @@ -6278,9 +6127,6 @@ install_photon_check_services() { } install_photon_onedir_deps() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_onedir_deps() entry" @@ -6322,9 +6168,6 @@ install_photon_onedir_deps() { install_photon_onedir() { - ## DGM Debugging - set -v - set -x echodebug "install_photon_onedir() entry" STABLE_REV=$ONEDIR_REV @@ -6351,10 +6194,6 @@ install_photon_onedir() { } install_photon_onedir_post() { - ## DGM Debugging - set -v - set -x - STABLE_REV=$ONEDIR_REV install_photon_stable_post || return 1 @@ -6977,10 +6816,6 @@ install_gentoo_git_deps() { } install_gentoo_stable() { - ## DGM Debugging - set -v - set -x - GENTOO_SALT_PACKAGE="app-admin/salt" STABLE_REV_WITHOUT_PREFIX=$(echo "${STABLE_REV}" | sed 's#archive/##') @@ -7005,10 +6840,6 @@ install_gentoo_git() { } install_gentoo_onedir() { - ## DGM Debugging - set -v - set -x - STABLE_REV=${ONEDIR_REV} install_gentoo_stable || return 1 } @@ -7248,20 +7079,6 @@ daemons_running_voidlinux() { # OS X / Darwin Install Functions # -## DGM __macosx_get_packagesite() { -## DGM -## DGM if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then -## DGM echoerror "Python 2 is no longer supported, only Python 3" -## DGM return 1 -## DGM fi -## DGM -## DGM # TBD DGM need to update for arch and 3006+ repo locations -## DGM -## DGM DARWIN_ARCH="x86_64" -## DGM PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg" -## DGM SALTPKGCONFURL="https://${_REPO_URL}/osx/${PKG}" -## DGM } - __parse_repo_json_python() { # Using latest, grab the right @@ -7279,15 +7096,12 @@ echo "${_JSON_VERSION}" } __macosx_get_packagesite_onedir() { - # TBD DGM need to update for arch and 3006+ repo locations - if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then echoerror "Python version is no longer supported, only Python 3" return 1 fi - ## DGM TBD need to allow for arm64 arch too - DARWIN_ARCH="x86_64" + DARWIN_ARCH=${CPU_ARCH_L} if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then _PKG_VERSION=$(__parse_repo_json_python) diff --git a/kitchen.macos.yml b/kitchen.macos.yml index b17b3ca..616a489 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -40,6 +40,3 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ - -## DGM transport: -## DGM name: docker diff --git a/kitchen.windows.yml b/kitchen.windows.yml index 008223c..a2b88e2 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -40,6 +40,3 @@ suites: verifier: command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ - -## DGM transport: -## DGM name: docker From aae98dbd9d7419f4d40469b9effaa8f1998f7747 Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Fri, 12 Jul 2024 15:21:52 +0000 Subject: [PATCH 80/80] Update develop branch for the v2024.07.12 release --- CHANGELOG.md | 14 ++++++++++++++ bootstrap-salt.ps1 | 2 +- bootstrap-salt.sh | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12028ef..cf12787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# v2024.07.12 + +## What's Changed + +- Add script version to powershell script by @twangboy in https://github.com/saltstack/salt-bootstrap/pull/1996 +- Add support for mint-21 by @jhubbardnso in https://github.com/saltstack/salt-bootstrap/pull/1997 +- Added support for Amazon 2023, Debian 12, Ubuntu 24.04, removed EOL and BSD OSs and Python 2.7 support by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/1987 + +## New Contributors + +- @jhubbardnso made their first contribution in https://github.com/saltstack/salt-bootstrap/pull/1997 + +**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.04.03...v2024.07.12 + # v2024.07.11 ## What's Changed diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 451c0c0..726723c 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -110,7 +110,7 @@ if ($help) { exit 0 } -$__ScriptVersion = "2024.04.03" +$__ScriptVersion = "2024.07.12" $ScriptName = $myInvocation.MyCommand.Name # We'll check for the Version next, because it also has no requirements diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3248042..23052e9 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -26,7 +26,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.07.11" +__ScriptVersion="2024.07.12" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0"