Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding newer versions of CentOS Stream and AlmaLinux #1890

Merged
merged 31 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
80f6059
Adding newer versions of CentOS Stream, AlmaLinux, and Rocky Linux
garethgreenaway Dec 14, 2022
b9bc07a
Adding entries to kitchen.yml
garethgreenaway Dec 19, 2022
ffef0b1
Need ssh-rsa for RockyLinux 9.
garethgreenaway Dec 20, 2022
7cfca56
need to install and run update-crypto-policies to allow RSA keys to w…
garethgreenaway Dec 20, 2022
2c4d317
fixing YAML.
garethgreenaway Dec 20, 2022
aeb74bc
Need procps-ng on Almalinux 9 and Rockylinux 9
garethgreenaway Dec 20, 2022
b6328e2
fixing typo. procps-ng instead of procps-nf.
garethgreenaway Dec 20, 2022
7e53753
blacklist almalinux-9, rockylinux-9, and centos-stream9 for latest.
garethgreenaway Dec 21, 2022
4779cc9
when installing git_deps, fall back to onedir_deps if stable_deps fai…
garethgreenaway Dec 21, 2022
ca683c6
Set ONEDIR_REV incase we end up calling install_centos_onedir_deps.
garethgreenaway Dec 21, 2022
bfa9bcf
Merge branch 'develop' into adding_more_systems
garethgreenaway Jan 31, 2023
0280cde
bump the version of koalaman/shellcheck-alpine up
garethgreenaway Jan 31, 2023
4eabf0a
account for different paths for the systemd service files in later ve…
garethgreenaway Feb 2, 2023
aea7146
Account for new location for systemd and upstart files on Debian and …
garethgreenaway Feb 2, 2023
84604ae
Account for new location for systemd files on Fedora.
garethgreenaway Feb 2, 2023
59da03a
Account for new location for systemd files on OpenSUSE.
garethgreenaway Feb 2, 2023
465ec9a
Account for new location for systemd files on Arch.
garethgreenaway Feb 2, 2023
db46fb9
Account for new location for systemd files on Gentoo.
garethgreenaway Feb 2, 2023
4358274
Update install_ubuntu_git and install_debian_git to account for diffe…
garethgreenaway Feb 2, 2023
78b9d76
Need to add --use-517 when installing dependencies from PIP when buil…
garethgreenaway Feb 3, 2023
af44e88
fixing typo. --use-pep517 instead of --use-517
garethgreenaway Feb 3, 2023
4d74e81
only use --use-pep517 with Arch.
garethgreenaway Feb 3, 2023
1fc0b89
Swapping ${_POST_NEON_PIP_INSTALL_ARGS} for ${_PIP_DOWNLOAD_ARGS}
garethgreenaway Feb 4, 2023
e301b91
Adding to install_gentoo_git_deps to update setuptools to fix bootstr…
garethgreenaway Feb 4, 2023
123bae7
Adding some logging to be able to find the command.
garethgreenaway Feb 4, 2023
b1f5203
Removing rockylinux:9 until PR into kitchen-docker has been merged.
garethgreenaway Feb 8, 2023
349cd79
Merge branch 'develop' into adding_more_systems
garethgreenaway Feb 8, 2023
3b94398
removing update-crypto-policies --set DEFAULT:SHA1, no longer needed …
garethgreenaway Feb 8, 2023
eeeaddd
removing bits not needed for rockylinux:8, oraclelinux:8, or oracleli…
garethgreenaway Feb 9, 2023
e598199
fixing centos:stream9 docker URL
garethgreenaway Feb 9, 2023
35e3601
Adding platform: centosstraem to centosstream:9
garethgreenaway Feb 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ jobs:
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "stable-3005", "git-3005", "onedir-3005", "git-master", "latest", "onedir-nightly"]'


almalinux-9:
name: AlmaLinux 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: almalinux-9
display-name: AlmaLinux 9
timeout: 20
instances: '["git-3005", "onedir-3005", "git-master", "onedir-nightly"]'


amazon-2:
name: Amazon 2
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
Expand Down Expand Up @@ -308,6 +322,20 @@ jobs:
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "stable-3005", "git-3005", "onedir-3005", "git-master", "latest", "onedir-nightly"]'


centos-stream9:
name: CentOS Stream 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: centos-stream9
display-name: CentOS Stream 9
timeout: 20
instances: '["git-3005", "onedir-3005", "git-master", "onedir-nightly"]'


debian-10:
name: Debian 10
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
Expand Down Expand Up @@ -549,10 +577,12 @@ jobs:
- windows-2019
- windows-2022
- almalinux-8
- almalinux-9
- amazon-2
- arch
- centos-7
- centos-stream8
- centos-stream9
- debian-10
- debian-11
- fedora-35
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/templates/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

LINUX_DISTROS = [
"almalinux-8",
"almalinux-9",
"amazon-2",
"arch",
"centos-7",
"centos-stream8",
"centos-stream9",
"debian-10",
"debian-11",
"fedora-35",
Expand Down Expand Up @@ -72,9 +74,11 @@

ONEDIR_DISTROS = [
"almalinux-8",
"almalinux-9",
"amazon-2",
"centos-7",
"centos-stream8",
"centos-stream9",
"debian-10",
"debian-11",
"oraclelinux-7",
Expand All @@ -86,7 +90,9 @@
]

BLACKLIST_3003 = [
"almalinux-9",
"arch",
"centos-stream9",
"debian-11",
"fedora-35",
"fedora-36",
Expand All @@ -101,8 +107,10 @@
]

BLACKLIST_GIT_3003 = [
"almalinux-9",
"amazon-2",
"arch",
"centos-stream9",
"debian-10",
"debian-11",
"fedora-35",
Expand All @@ -120,7 +128,9 @@
]

BLACKLIST_3004 = [
"almalinux-9",
"arch",
"centos-stream9",
"fedora-35",
"fedora-36",
"fedora-37",
Expand All @@ -144,8 +154,10 @@
]

BLACKLIST_GIT_3004 = [
"almalinux-9",
"amazon-2",
"arch",
"centos-stream9",
"debian-10",
"debian-11",
"fedora-35",
Expand Down Expand Up @@ -225,14 +237,19 @@
"fedora-38",
]

LATEST_PKG_BLACKLIST = []
LATEST_PKG_BLACKLIST = [
"almalinux-9",
"centos-stream9",
]

DISTRO_DISPLAY_NAMES = {
"almalinux-8": "AlmaLinux 8",
"almalinux-9": "AlmaLinux 9",
"amazon-2": "Amazon 2",
"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-35": "Fedora 35",
Expand Down
113 changes: 95 additions & 18 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ _POST_NEON_INSTALL=$BS_FALSE
_MINIMUM_PIP_VERSION="9.0.1"
_MINIMUM_SETUPTOOLS_VERSION="9.1"
_POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr"
_PIP_DOWNLOAD_ARGS=""

# Defaults for install arguments
ITYPE="stable"
Expand Down Expand Up @@ -2831,8 +2832,8 @@ EOM

mkdir /tmp/git/deps
echoinfo "Downloading Salt Dependencies from PyPi"
echodebug "Running '${_pip_cmd} download -d /tmp/git/deps .'"
${_pip_cmd} download -d /tmp/git/deps . || (echo "Failed to download salt dependencies" && return 1)
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)

echoinfo "Installing Downloaded Salt Dependencies"
echodebug "Running '${_pip_cmd} install --ignore-installed ${_POST_NEON_PIP_INSTALL_ARGS} /tmp/git/deps/*'"
Expand Down Expand Up @@ -3330,7 +3331,15 @@ install_ubuntu_git() {
_POST_NEON_PIP_INSTALL_ARGS=""
__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' pkg/*.service

# 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
fi

Expand Down Expand Up @@ -3402,8 +3411,15 @@ install_ubuntu_git_post() {
[ $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
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg"
fi

if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
__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
Expand All @@ -3418,8 +3434,8 @@ install_ubuntu_git_post() {
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 ${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-$fname.upstart to $_upstart_conf"
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.upstart" "$_upstart_conf"
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}
Expand Down Expand Up @@ -3955,7 +3971,15 @@ install_debian_git() {
_POST_NEON_PIP_INSTALL_ARGS=""
__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' pkg/*.service

# 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
fi

Expand Down Expand Up @@ -4014,16 +4038,23 @@ install_debian_git_post() {
[ "$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
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg"
fi

# 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 "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" /lib/systemd/system
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.environment" "/etc/default/salt-${fname}"
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 "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" /lib/systemd/system
__copyfile "${_SERVICE_DIR}/salt-${fname}.service" /lib/systemd/system
sed -i -e '/^Type/ s/notify/simple/' /lib/systemd/system/salt-${fname}.service
fi
fi
Expand Down Expand Up @@ -4323,7 +4354,13 @@ install_fedora_git_post() {
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue

__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
# Account for new path for services files in later releases
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm"
fi
__copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"

# Salt executables are located under `/usr/local/bin/` on Fedora 36+
#if [ "${DISTRO_VERSION}" -ge 36 ]; then
Expand Down Expand Up @@ -4623,7 +4660,15 @@ install_centos_stable_post() {
}

install_centos_git_deps() {
install_centos_stable_deps || return 1
# 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.
# Set ONEDIR_REV to STABLE_REV in case we
# end up calling install_centos_onedir_deps
ONEDIR_REV=${STABLE_REV}
install_centos_stable_deps || \
install_centos_onedir_deps || \
return 1

if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
__yum_install_noinput ca-certificates || return 1
Expand Down Expand Up @@ -4783,10 +4828,16 @@ install_centos_git_post() {
[ $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
_SERVICE_FILE="${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service"
else
_SERVICE_FILE="${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service"
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
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" /usr/lib/systemd/system
__copyfile "${_SERVICE_FILE}" /usr/lib/systemd/system
fi

SYSTEMD_RELOAD=$BS_TRUE
Expand Down Expand Up @@ -6465,6 +6516,8 @@ 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
Expand Down Expand Up @@ -6522,8 +6575,15 @@ install_arch_linux_git_post() {
[ $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
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm"
fi

if [ -f /usr/bin/systemctl ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
__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
Expand Down Expand Up @@ -7346,10 +7406,17 @@ install_opensuse_git_post() {
use_usr_lib=$BS_TRUE
fi

# Account for new path for services files in later releases
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/"
fi

if [ "${use_usr_lib}" -eq $BS_TRUE ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service"
__copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service"
else
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
__copyfile "${_SERVICE_DIR}/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
fi

continue
Expand Down Expand Up @@ -7969,6 +8036,9 @@ install_gentoo_git_deps() {
__emerge ${GENTOO_GIT_PACKAGES} || return 1
fi

echoinfo "Running emerge -v1 setuptools"
__emerge -v1 setuptools || return 1

__git_clone_and_checkout || return 1
__gentoo_post_dep || return 1
}
Expand Down Expand Up @@ -8051,8 +8121,15 @@ install_gentoo_git_post() {
[ $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
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg/common"
else
_SERVICE_DIR="${_SALT_GIT_CHECKOUT_DIR}/pkg"
fi

if __check_command_exists systemctl ; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
__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
Expand Down
Loading