Merge pull request #1819 from saltstack/adding_install_from_tiamat

Adding bits to install Salt packages built using Tiamat.
This commit is contained in:
Kirill Ponomarev 2022-07-27 07:21:28 +02:00 committed by GitHub
commit af68de6761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 561 additions and 200 deletions

View file

@ -3313,190 +3313,6 @@ jobs:
bundle exec kitchen destroy latest-ubuntu-2004
py3-stable-3003-ubuntu-2110:
name: Ubuntu 21.10 v3003 Py3 Stable
runs-on: ubuntu-latest
timeout-minutes: 20
needs: lint
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create py3-stable-3003-ubuntu-2110 || bundle exec kitchen create py3-stable-3003-ubuntu-2110
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify py3-stable-3003-ubuntu-2110
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy py3-stable-3003-ubuntu-2110
py3-stable-3004-ubuntu-2110:
name: Ubuntu 21.10 v3004 Py3 Stable
runs-on: ubuntu-latest
timeout-minutes: 20
needs: lint
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create py3-stable-3004-ubuntu-2110 || bundle exec kitchen create py3-stable-3004-ubuntu-2110
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify py3-stable-3004-ubuntu-2110
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy py3-stable-3004-ubuntu-2110
py3-git-master-ubuntu-2110:
name: Ubuntu 21.10 Master Py3 Git
runs-on: ubuntu-latest
timeout-minutes: 20
needs: lint
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create py3-git-master-ubuntu-2110 || bundle exec kitchen create py3-git-master-ubuntu-2110
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify py3-git-master-ubuntu-2110
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy py3-git-master-ubuntu-2110
latest-ubuntu-2110:
name: Ubuntu 21.10 Latest packaged release
runs-on: ubuntu-latest
timeout-minutes: 20
needs: lint
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create latest-ubuntu-2110 || bundle exec kitchen create latest-ubuntu-2110
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify latest-ubuntu-2110
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy latest-ubuntu-2110
py3-stable-3004-ubuntu-2204:
name: Ubuntu 22.04 v3004 Py3 Stable
runs-on: ubuntu-latest

View file

@ -25,7 +25,6 @@ LINUX_DISTROS = [
"rockylinux-8",
"ubuntu-1804",
"ubuntu-2004",
"ubuntu-2110",
"ubuntu-2204",
]
OSX = WINDOWS = []
@ -50,7 +49,6 @@ STABLE_DISTROS = [
"rockylinux-8",
"ubuntu-1804",
"ubuntu-2004",
"ubuntu-2110",
"ubuntu-2204",
]
@ -148,7 +146,6 @@ DISTRO_DISPLAY_NAMES = {
"rockylinux-8": "Rocky Linux 8",
"ubuntu-1804": "Ubuntu 18.04",
"ubuntu-2004": "Ubuntu 20.04",
"ubuntu-2110": "Ubuntu 21.10",
"ubuntu-2204": "Ubuntu 22.04",
}

574
bootstrap-salt.sh Normal file → Executable file
View file

@ -268,6 +268,7 @@ _CUSTOM_MASTER_CONFIG="null"
_CUSTOM_MINION_CONFIG="null"
_QUIET_GIT_INSTALLATION=$BS_FALSE
_REPO_URL="repo.saltproject.io"
_TIAMAT_DIR="salt"
_PY_EXE="python3"
_INSTALL_PY="$BS_FALSE"
_TORNADO_MAX_PY3_VERSION="5.0"
@ -290,17 +291,24 @@ __usage() {
Usage : ${__ScriptName} [options] <install-type> [install-type-args]
Installation types:
- stable Install latest stable release. This is the default
install type
- stable [branch] Install latest version on a branch. Only supported
for packages available at repo.saltproject.io
- 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
- testing RHEL-family specific: configure EPEL testing repo
- git Install from the head of the master branch
- git [ref] Install from any git ref (such as a branch, tag, or
commit)
- stable Install latest stable release. This is the default
install type
- stable [branch] Install latest version on a branch. Only supported
for packages available at repo.saltproject.io
- 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
- testing RHEL-family specific: configure EPEL testing repo
- git Install from the head of the master branch
- git [ref] Install from any git ref (such as a branch, tag, or
commit)
- tiamat Install latest tiamat release.
- tiamat [version] Install a specific version. Only supported for
tiamat packages available at repo.saltproject.io
- tiamat_rc Install latest tiamat RC release.
- tiamat_rc [version] Install a specific version. Only supported for
tiamat RC packages available at repo.saltproject.io
Examples:
- ${__ScriptName}
@ -312,6 +320,10 @@ __usage() {
- ${__ScriptName} git 2017.7
- ${__ScriptName} git v2017.7.2
- ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358
- ${__ScriptName} tiamat
- ${__ScriptName} tiamat 3005
- ${__ScriptName} tiamat_rc
- ${__ScriptName} tiamat_rc 3005
Options:
-a Pip install all Python pkg dependencies for Salt. Requires -V to install
@ -582,7 +594,7 @@ if [ "$#" -gt 0 ];then
fi
# Check installation type
if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git)')" = "" ]; then
if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|tiamat|tiamat_rc)')" = "" ]; then
echoerror "Installation type \"$ITYPE\" is not known..."
exit 1
fi
@ -619,6 +631,48 @@ elif [ "$ITYPE" = "stable" ]; then
exit 1
fi
fi
elif [ "$ITYPE" = "tiamat" ]; then
if [ "$#" -eq 0 ];then
TIAMAT_REV="latest"
else
if [ "$(echo "$1" | grep -E '^(latest)$')" != "" ]; then
TIAMAT_REV="$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)$')" != "" ]; then
# Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix
TIAMAT_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
TIAMAT_REV="minor/$TIAMAT_REV"
shift
else
echo "Unknown stable version: $1 (valid: 3005, latest.)"
exit 1
fi
fi
elif [ "$ITYPE" = "tiamat_rc" ]; then
# Change the _TIAMAT_DIR to be the location for the RC packages
_TIAMAT_DIR="salt_rc/salt"
# Change ITYPE to tiamat so we use the regular Tiamat functions
ITYPE="tiamat"
if [ "$#" -eq 0 ];then
TIAMAT_REV="latest"
else
if [ "$(echo "$1" | grep -E '^(latest)$')" != "" ]; then
TIAMAT_REV="$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][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
#TIAMAT_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
TIAMAT_REV="minor/$1"
shift
else
echo "Unknown stable version: $1 (valid: 3005, latest.)"
exit 1
fi
fi
fi
# Check for any unparsed arguments. Should be an error.
@ -2969,6 +3023,48 @@ __install_saltstack_ubuntu_repository() {
__wait_for_apt apt-get update || return 1
}
__install_saltstack_ubuntu_tiamat_repository() {
# Workaround for latest non-LTS Ubuntu
if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \
[ "$DISTRO_MAJOR_VERSION" -eq 21 ]; 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"
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
# 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
# SaltStack's stable Ubuntu repository:
SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${TIAMAT_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
__wait_for_apt apt-get update || return 1
}
install_ubuntu_deps() {
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
# Install add-apt-repository
@ -3141,6 +3237,44 @@ install_ubuntu_git_deps() {
return 0
}
install_ubuntu_tiamat_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
# 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
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
__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_tiamat_repository || return 1
fi
install_ubuntu_deps || return 1
}
install_ubuntu_stable() {
__PACKAGES=""
@ -3200,6 +3334,28 @@ install_ubuntu_git() {
return 0
}
install_ubuntu_tiamat() {
__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
__apt_get_install_noinput ${__PACKAGES} || return 1
return 0
}
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
@ -3397,6 +3553,40 @@ __install_saltstack_debian_repository() {
__wait_for_apt apt-get update || return 1
}
__install_saltstack_debian_tiamat_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"
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
# 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
SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${TIAMAT_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-archive-keyring.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."
@ -3450,6 +3640,59 @@ install_debian_deps() {
return 0
}
install_debian_tiamat_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" -eq 3 ]; then
PY_PKG_VER=3
else
PY_PKG_VER=""
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"
# shellcheck disable=SC2086
__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_tiamat_repository || return 1
fi
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
fi
return 0
}
install_debian_git_pre() {
if ! __check_command_exists git; then
__apt_get_install_noinput git || return 1
@ -3726,6 +3969,28 @@ install_debian_9_git() {
return 0
}
install_debian_tiamat() {
__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
__apt_get_install_noinput ${__PACKAGES} || return 1
return 0
}
install_debian_git_post() {
for fname in api master minion syndic; do
# Skip if not meant to be installed
@ -4117,9 +4382,13 @@ __install_epel_repository() {
return 0
fi
# Download latest 'epel-next-release' package for the distro version directly
epel_next_repo_url="${HTTP_VAL}://dl.fedoraproject.org/pub/epel/epel-next-release-latest-${DISTRO_MAJOR_VERSION}.noarch.rpm"
# Download latest 'epel-release' package for the distro version directly
epel_repo_url="${HTTP_VAL}://dl.fedoraproject.org/pub/epel/epel-release-latest-${DISTRO_MAJOR_VERSION}.noarch.rpm"
rpm -Uvh --force "$epel_repo_url" || return 1
yum -y install "${epel_next_repo_url}" "${epel_repo_url}"
_EPEL_REPOS_INSTALLED=$BS_TRUE
@ -4180,6 +4449,60 @@ _eof
return 0
}
__install_saltstack_rhel_tiamat_repository() {
if [ "$ITYPE" = "stable" ]; then
repo_rev="$TIAMAT_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}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${TIAMAT_REV}/"
if [ "${DISTRO_MAJOR_VERSION}" -eq 7 ]; then
gpg_key="SALTSTACK-GPG-KEY.pub base/RPM-GPG-KEY-CentOS-7"
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}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/"
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_centos_stable_deps() {
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
yum -y update || return 1
@ -4484,6 +4807,101 @@ install_centos_git_post() {
return 0
}
install_centos_tiamat_deps() {
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
yum -y update || return 1
fi
if [ "$_DISABLE_REPOS" -eq "$BS_TRUE" ] && [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
echowarn "Detected -r or -R option while installing Salt packages for Python 3."
echowarn "Python 3 packages for older Salt releases requires the EPEL repository to be installed."
echowarn "Installing the EPEL repository automatically is disabled when using the -r or -R options."
fi
if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then
__install_epel_repository || return 1
__install_saltstack_rhel_tiamat_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
# its own check in case -r was passed without -R.
if [ "$_CUSTOM_REPO_URL" != "null" ]; then
__install_saltstack_rhel_tiamat_repository || return 1
fi
if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then
__PACKAGES="dnf-utils chkconfig"
else
__PACKAGES="yum-utils chkconfig"
fi
# shellcheck disable=SC2086
__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
fi
return 0
}
install_centos_tiamat() {
__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
__yum_install_noinput ${__PACKAGES} || return 1
return 0
}
install_centos_tiamat_post() {
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
# 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
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
)
SYSTEMD_RELOAD=$BS_TRUE
elif [ -f "/etc/init.d/salt-${fname}" ]; then
/sbin/chkconfig salt-${fname} on
fi
done
if [ "$SYSTEMD_RELOAD" -eq $BS_TRUE ]; then
/bin/systemctl daemon-reload
fi
return 0
}
install_centos_restart_daemons() {
[ $_START_DAEMONS -eq $BS_FALSE ] && return
@ -4583,6 +5001,11 @@ install_red_hat_linux_git_deps() {
return 0
}
install_red_hat_linux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_red_hat_enterprise_stable_deps() {
install_red_hat_linux_stable_deps || return 1
return 0
@ -4593,6 +5016,11 @@ install_red_hat_enterprise_git_deps() {
return 0
}
install_red_hat_enterprise_tiamat_deps() {
install_red_hat_linux_tiamat_deps || return 1
return 0
}
install_red_hat_enterprise_linux_stable_deps() {
install_red_hat_linux_stable_deps || return 1
return 0
@ -4603,6 +5031,11 @@ install_red_hat_enterprise_linux_git_deps() {
return 0
}
install_red_hat_enterprise_linux_tiamat_deps() {
install_red_hat_linux_tiamat_deps || return 1
return 0
}
install_red_hat_enterprise_server_stable_deps() {
install_red_hat_linux_stable_deps || return 1
return 0
@ -4613,6 +5046,11 @@ install_red_hat_enterprise_server_git_deps() {
return 0
}
install_red_hat_enterprise_server_tiamat_deps() {
install_red_hat_linux_tiamat_deps || return 1
return 0
}
install_red_hat_enterprise_workstation_stable_deps() {
install_red_hat_linux_stable_deps || return 1
return 0
@ -4623,6 +5061,11 @@ install_red_hat_enterprise_workstation_git_deps() {
return 0
}
install_red_hat_enterprise_workstation_tiamat_deps() {
install_red_hat_linux_timat_deps || return 1
return 0
}
install_red_hat_linux_stable() {
install_centos_stable || return 1
return 0
@ -4633,6 +5076,11 @@ install_red_hat_linux_git() {
return 0
}
install_red_hat_linux_tiamat() {
install_centos_tiamat || return 1
return 0
}
install_red_hat_enterprise_stable() {
install_red_hat_linux_stable || return 1
return 0
@ -4643,6 +5091,11 @@ install_red_hat_enterprise_git() {
return 0
}
install_red_hat_enterprise_tiamat() {
install_red_hat_linux_tiamat || return 1
return 0
}
install_red_hat_enterprise_linux_stable() {
install_red_hat_linux_stable || return 1
return 0
@ -4653,6 +5106,11 @@ install_red_hat_enterprise_linux_git() {
return 0
}
install_red_hat_enterprise_linux_tiamat() {
install_red_hat_linux_tiamat || return 1
return 0
}
install_red_hat_enterprise_server_stable() {
install_red_hat_linux_stable || return 1
return 0
@ -4663,6 +5121,11 @@ install_red_hat_enterprise_server_git() {
return 0
}
install_red_hat_enterprise_server_tiamat() {
install_red_hat_linux_tiamat || return 1
return 0
}
install_red_hat_enterprise_workstation_stable() {
install_red_hat_linux_stable || return 1
return 0
@ -4673,6 +5136,11 @@ install_red_hat_enterprise_workstation_git() {
return 0
}
install_red_hat_enterprise_workstation_tiamat() {
install_red_hat_linux_tiamat || return 1
return 0
}
install_red_hat_linux_stable_post() {
install_centos_stable_post || return 1
return 0
@ -4826,6 +5294,11 @@ install_oracle_linux_git_deps() {
return 0
}
install_oracle_linux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_oracle_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
@ -4841,6 +5314,11 @@ install_oracle_linux_git() {
return 0
}
install_oracle_linux_tiamat() {
install_centos_tiamat || return 1
return 0
}
install_oracle_linux_testing() {
install_centos_testing || return 1
return 0
@ -4889,6 +5367,11 @@ install_almalinux_git_deps() {
return 0
}
install_almalinux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_almalinux_testing_deps() {
install_centos_testing_deps || return 1
return 0
@ -4904,6 +5387,11 @@ install_almalinux_git() {
return 0
}
install_almalinux_tiamat() {
install_centos_tiamat || return 1
return 0
}
install_almalinux_testing() {
install_centos_testing || return 1
return 0
@ -4952,6 +5440,11 @@ install_rocky_linux_git_deps() {
return 0
}
install_rocky_linux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_rocky_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
@ -4962,6 +5455,11 @@ install_rocky_linux_stable() {
return 0
}
install_rocky_linux_tiamat() {
install_centos_tiamat || return 1
return 0
}
install_rocky_linux_git() {
install_centos_git || return 1
return 0
@ -5015,6 +5513,11 @@ install_scientific_linux_git_deps() {
return 0
}
install_scientific_linux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_scientific_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
@ -5030,6 +5533,11 @@ install_scientific_linux_git() {
return 0
}
install_scientific_linux_tiamat() {
install_centos_tiamat || return 1
return 0
}
install_scientific_linux_testing() {
install_centos_testing || return 1
return 0
@ -5078,6 +5586,11 @@ install_cloud_linux_git_deps() {
return 0
}
install_cloud_linux_tiamat_deps() {
install_centos_tiamat_deps || return 1
return 0
}
install_cloud_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
@ -7918,6 +8431,39 @@ preseed_master() {
#
#######################################################################################################################
#######################################################################################################################
#
# This function checks if all of the installed daemons are running or not.
#
daemons_running_tiamat() {
[ "$_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
# 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
salt_path="/opt/saltstack/salt/run/run ${fname}"
process_running=$(pgrep -f "${salt_path}")
if [ "${process_running}" = "" ]; then
echoerror "${salt_path} was not found running"
FAILED_DAEMONS=$((FAILED_DAEMONS + 1))
fi
done
return $FAILED_DAEMONS
}
#
# Ended daemons running check function
#
#######################################################################################################################
#######################################################################################################################
#
# This function checks if all of the installed daemons are running or not.
@ -8018,6 +8564,7 @@ echodebug "PRESEED_MASTER_FUNC=${PRESEED_MASTER_FUNC}"
INSTALL_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}"
INSTALL_FUNC_NAMES="$INSTALL_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}"
INSTALL_FUNC_NAMES="$INSTALL_FUNC_NAMES install_${DISTRO_NAME_L}_${ITYPE}"
echodebug "INSTALL_FUNC_NAMES=${INSTALL_FUNC_NAMES}"
INSTALL_FUNC="null"
for FUNC_NAME in $(__strip_duplicates "$INSTALL_FUNC_NAMES"); do
@ -8069,6 +8616,7 @@ DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running_${DISTRO
DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}"
DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running_${DISTRO_NAME_L}_${ITYPE}"
DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running_${DISTRO_NAME_L}"
DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running_${ITYPE}"
DAEMONS_RUNNING_FUNC_NAMES="$DAEMONS_RUNNING_FUNC_NAMES daemons_running"
DAEMONS_RUNNING_FUNC="null"