From e44fc45b5d9c32753a8aff8624d4e1fa4a617795 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Sat, 24 Jun 2023 10:30:47 -0700 Subject: [PATCH] SUSE Fixes (#1925) * Updating the bootstrap script with fixes to install properly on SUSE. Since we are not building onedir packages and providing them in the Salt project repo, we fall back to the previous stable installs and use the SUSE repos. Removing _DOWNSTREAM_PKG_REPO as it is no longer used. * Gentoo installs are broken because of the Gentoo ebuild. Remove Mac 10.15 as it is EOL. Update BSD tests tor run on MacOS 11. * If the brew update vagrant fails because it is not installed then install it. * blacklist gentoo from latest packages. * Make sure virtualbox is installed * removing cask argument * swap macos-11 for macos-12 to run BSD tests in vagrant. --- .github/workflows/ci.yml | 26 ++------- .github/workflows/templates/generate.py | 10 ++-- .github/workflows/test-bsd.yml | 2 +- bootstrap-salt.sh | 70 ++++++++++++++++++++----- 4 files changed, 67 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd33983..85f4380 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: distro-slug: freebsd-131 display-name: FreeBSD 13.1 timeout: 20 - runs-on: macos-10.15 + runs-on: macos-12 instances: '["git-master", "latest"]' @@ -141,7 +141,7 @@ jobs: distro-slug: freebsd-123 display-name: FreeBSD 12.3 timeout: 20 - runs-on: macos-10.15 + runs-on: macos-12 instances: '["git-master", "latest"]' @@ -156,26 +156,11 @@ jobs: distro-slug: openbsd-7 display-name: OpenBSD 7 timeout: 20 - runs-on: macos-10.15 + runs-on: macos-12 instances: '["latest"]' - macos-1015: - name: macOS 10.15 - 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-1015 - display-name: macOS 10.15 - timeout: 20 - runs-on: macos-10.15 - instances: '["stable-3003", "stable-3004", "stable-3005", "stable-3006", "latest"]' - - macos-11: name: macOS 11 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -417,7 +402,7 @@ jobs: distro-slug: gentoo display-name: Gentoo timeout: 90 - instances: '["git-master", "latest", "default"]' + instances: '["git-master"]' gentoo-systemd: @@ -431,7 +416,7 @@ jobs: distro-slug: gentoo-systemd display-name: Gentoo (systemd) timeout: 90 - instances: '["git-master", "latest", "default"]' + instances: '["git-master"]' opensuse-15: @@ -585,7 +570,6 @@ jobs: - freebsd-131 - freebsd-123 - openbsd-7 - - macos-1015 - macos-11 - macos-12 - windows-2019 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 38593e9..61cf640 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -38,7 +38,6 @@ WINDOWS = [ ] OSX = [ - "macos-1015", "macos-11", "macos-12", ] @@ -61,8 +60,6 @@ STABLE_DISTROS = [ "fedora-36", "fedora-37", "fedora-38", - "gentoo", - "gentoo-systemd", "opensuse-15", "opensuse-tumbleweed", "oraclelinux-7", @@ -321,7 +318,10 @@ GIT_DISTRO_BLACKLIST = [ "rockylinux-8", ] -LATEST_PKG_BLACKLIST = [] +LATEST_PKG_BLACKLIST = [ + "gentoo", + "gentoo-systemd", +] DISTRO_DISPLAY_NAMES = { "almalinux-8": "AlmaLinux 8", @@ -389,7 +389,7 @@ def generate_test_jobs(): for distro in BSD: test_jobs += "\n" - runs_on = "macos-10.15" + 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" diff --git a/.github/workflows/test-bsd.yml b/.github/workflows/test-bsd.yml index db8fc58..753956d 100644 --- a/.github/workflows/test-bsd.yml +++ b/.github/workflows/test-bsd.yml @@ -54,7 +54,7 @@ jobs: - name: Update Vagrant run: | brew update - brew upgrade vagrant + brew upgrade vagrant || brew install vagrant - name: Setup Vagrant Cache uses: actions/cache@v3 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5a103f3..2b42739 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -224,7 +224,6 @@ _KEEP_TEMP_FILES=${BS_KEEP_TEMP_FILES:-$BS_FALSE} _TEMP_CONFIG_DIR="null" _SALTSTACK_REPO_URL="https://github.com/saltstack/salt.git" _SALT_REPO_URL=${_SALTSTACK_REPO_URL} -_DOWNSTREAM_PKG_REPO=$BS_FALSE _TEMP_KEYS_DIR="null" _SLEEP="${__DEFAULT_SLEEP}" _INSTALL_MASTER=$BS_FALSE @@ -401,9 +400,6 @@ __usage() { -v Display script version -V Install Salt into virtualenv (only available for Ubuntu based distributions) - -w Install packages from downstream package repository rather than - upstream, saltstack package repository. This is currently only - implemented for SUSE. -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. @@ -420,7 +416,7 @@ EOT } # ---------- end of function __usage ---------- -while getopts ':hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt +while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt do case "${opt}" in @@ -436,7 +432,6 @@ do echowarn "No need to provide this option anymore, now it is a default behavior." ;; - w ) _DOWNSTREAM_PKG_REPO=$BS_TRUE ;; k ) _TEMP_KEYS_DIR="$OPTARG" ;; s ) _SLEEP=$OPTARG ;; M ) _INSTALL_MASTER=$BS_TRUE ;; @@ -7699,13 +7694,8 @@ __set_suse_pkg_repo() { DISTRO_REPO="SLE_${DISTRO_MAJOR_VERSION}_SP${SUSE_PATCHLEVEL}" fi - if [ "$_DOWNSTREAM_PKG_REPO" -eq $BS_TRUE ]; then - suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" - else - suse_pkg_url_base="${HTTP_VAL}://repo.saltproject.io/opensuse" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack:products.repo" - fi + suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" + suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" SUSE_PKG_URL="$suse_pkg_url_base/$suse_pkg_url_path" } @@ -7725,7 +7715,7 @@ __version_lte() { zypper --non-interactive install --auto-agree-with-licenses python || return 1 fi - if [ "$(python -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1<=V2' "$1" "$2")" = "True" ]; then + 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} else __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} @@ -8131,6 +8121,11 @@ install_opensuse_15_git() { return 0 } +install_opensuse_15_onedir_deps() { + __opensuse_prep_install || return 1 + return 0 +} + # # End of openSUSE Leap 15 # @@ -8160,6 +8155,13 @@ install_suse_15_git_deps() { return 0 } +install_suse_15_onedir_deps() { + __opensuse_prep_install || return 1 + install_opensuse_15_onedir_deps || return 1 + + return 0 +} + install_suse_15_stable() { install_opensuse_stable || return 1 return 0 @@ -8170,6 +8172,11 @@ install_suse_15_git() { return 0 } +install_suse_15_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_15_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8180,6 +8187,11 @@ install_suse_15_git_post() { return 0 } +install_suse_15_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_15_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 @@ -8262,6 +8274,11 @@ install_suse_12_git_deps() { 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 @@ -8272,6 +8289,11 @@ install_suse_12_git() { 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 @@ -8282,6 +8304,11 @@ install_suse_12_git_post() { 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 @@ -8358,6 +8385,11 @@ install_suse_11_git_deps() { 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 @@ -8368,6 +8400,11 @@ install_suse_11_git() { 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 @@ -8378,6 +8415,11 @@ install_suse_11_git_post() { 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