From 3d716dce3a74da6da4d62fe81fd44f0b0a4f3d3e Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 11 Apr 2022 16:47:01 -0700 Subject: [PATCH 01/15] Adding bits to install Salt packages built using Tiamat. --- bootstrap-salt.sh | 606 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 593 insertions(+), 13 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 c462e0a..649c2ac --- 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: @@ -290,17 +290,20 @@ __usage() { Usage : ${__ScriptName} [options] [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 Examples: - ${__ScriptName} @@ -312,6 +315,8 @@ __usage() { - ${__ScriptName} git 2017.7 - ${__ScriptName} git v2017.7.2 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 + - ${__ScriptName} tiamat + - ${__ScriptName} tiamat 3005 Options: -a Pip install all Python pkg dependencies for Salt. Requires -V to install @@ -582,7 +587,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)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi @@ -619,6 +624,10 @@ elif [ "$ITYPE" = "stable" ]; then exit 1 fi fi + +elif [ "$ITYPE" = "tiamat" ]; then + #TIAMET_REV="latest" + TIAMET_REV="" fi # Check for any unparsed arguments. Should be an error. @@ -2964,6 +2973,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}/salt-dev/${__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 @@ -3133,6 +3184,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="" @@ -3192,6 +3281,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 @@ -3389,6 +3500,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}/salt-dev/${__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." @@ -3718,6 +3863,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 @@ -4160,6 +4327,60 @@ _eof return 0 } +__install_saltstack_tiamat_rhel_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}/salt-dev/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" + 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}/salt-dev/${__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 @@ -4464,6 +4685,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_tiamat_rhel_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_tiamat_rhel_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 @@ -4563,6 +4879,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 @@ -4573,6 +4894,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 @@ -4583,6 +4909,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 @@ -4593,6 +4924,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 @@ -4603,6 +4939,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 @@ -4613,6 +4954,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 @@ -4623,6 +4969,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 @@ -4633,6 +4984,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 @@ -4643,6 +4999,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 @@ -4653,6 +5014,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 @@ -4806,6 +5172,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 @@ -4821,6 +5192,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 @@ -4869,6 +5245,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 @@ -4884,6 +5265,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 @@ -4932,6 +5318,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 @@ -4942,6 +5333,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 @@ -4995,6 +5391,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 @@ -5010,6 +5411,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 @@ -5058,6 +5464,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 @@ -7703,6 +8114,143 @@ install_macosx_restart_daemons() { # ####################################################################################################################### +####################################################################################################################### +# +# Begin Tiamat Onedir Install Functions +# + + _parse_json_specd_ver() { + local file_name="$1" + local salt_url_version="$2" + local file_value="" + local blk_count=0 + local specd_ver_blk_count=0 + local specd_ver_flag=0 + local found_specd_ver_linux=0 + + local var1="" + local var2="" + declare -A rdict + + file_value=$(<"${file_name}") + + # limit 80 cols + var1=$(echo "${file_value}" | sed 's/,/,\n/g' | sed 's/{/\n{\n/g') + var2=$(echo "${var1}" | sed 's/}/\n}\n/g' | sed 's/,//g' | sed 's/"//g') + + while IFS= read -r line + do + echodebug "$0:${FUNCNAME[0]} parsing line '${line}'" + if [[ -z "${line}" ]]; then + continue + fi + if [[ "${line}" = "{" ]]; then + (( blk_count++ )) + elif [[ "${line}" = "}" ]]; then + # examine directory just read in + if [[ ${specd_ver_flag} -eq 1 ]]; then + if [[ "${rdict['os']}" = "linux" ]]; then + # have linux values for specd_ver + echodebug "$0:${FUNCNAME[0]} parsed following linux for"\ + "specified version '${salt_url_version}' from repo json"\ + "file '${file_name}', os ${rdict['os']}, version"\ + "${rdict['version']}, name ${rdict['name']}, SHA512"\ + "${rdict['SHA512']}" + found_specd_ver_linux=1 + break + fi + fi + + if [[ ${blk_count} -eq ${specd_ver_blk_count} ]]; then + specd_ver_flag=0 + break + fi + (( blk_count-- )) + else + line_key=$(echo "${line}" | cut -d ':' -f 1 | xargs) + line_value=$(echo "${line}" | cut -d ':' -f 2 | xargs) + if [[ "${line_key}" = "${salt_url_version}" ]]; then + # note blk_count encountered 'specd_ver', closing brace check + specd_ver_flag=1 + specd_ver_blk_count=${blk_count} + (( specd_ver_blk_count++ )) + else + rdict["${line_key}"]="${line_value}" + echodebug "$0:${FUNCNAME[0]} updated dictionary with"\ + "line_key '${line_key}' and line_value '${line_value}'" + fi + fi + done <<< "${var2}" + + if [[ ${found_specd_ver_linux} -eq 1 ]]; then + echo "${rdict['version']}:${rdict['name']}:${rdict['SHA512']}" + else + echoerr "$0:${FUNCNAME[0]} unable to parse version, name and "\ + "SHA512 from repo json file '${file_name}'" + # echo "" + fi + return 0 +} + + +install_tiamat() { + echoinfo "Fetching repo.json for Tiamat ${_TIAMAT_TYPE}" + + base_url="https://repo.saltproject.io/salt-dev/" + tiamat_type_repo_json_url="${base_url}${_TIAMAT_TYPE}/repo.json" + repo_json_file="$(mktemp /tmp/base-json-XXXXXXXX 2>/dev/null)" + salt_url="https://repo.saltproject.io/salt-dev/${_TIAMAT_TYPE}" + + if [ -z "$repo_json_file" ]; then + echoerror "Failed to create temporary file in /tmp" + return 1 + fi + + __fetch_url "$repo_json_file" "$tiamat_type_repo_json_url" || return 1 + + json_version_name_sha=$(_parse_json_specd_ver "${repo_json_file}" "${_TIAMAT_VERSION}") + + echoinfo "json_version_name_sha ${json_version_name_sha}" + + echoinfo "Installing Tiamat ${_TIAMAT_TYPE}" + + rm -f "$repo_json_file" + + salt_json_version=$(\ + echo "${json_version_name_sha}" | awk -F":" '{print $1}') + salt_json_name=$(\ + echo "${json_version_name_sha}" | awk -F":" '{print $2}') + salt_json_sha512=$(\ + echo "${json_version_name_sha}" | awk -F":" '{print $3}') + echodebug "$0:${FUNCNAME[0]} using repo.json values version"\ + "'${salt_json_version}', name '${salt_json_name}, sha512"\ + "'${salt_json_sha512}'" + + echoinfo "salt_json_name - ${salt_json_name}" + salt_pkg_name="${salt_json_name}" + salt_pkg_url="${salt_url}/${salt_json_version}/${salt_pkg_name}" + + echoinfo "salt_pkg_name - ${salt_pkg_name}" + tempfile="$(mktemp /tmp/${salt_pkg_name}-XXXXXXXX.tar.gz 2>/dev/null)" + + if [ -z "$tempfile" ]; then + echoerror "Failed to create temporary file in /tmp" + return 1 + fi + + __fetch_url "$tempfile" "$salt_pkg_url" || return 1 + + #rm -f "$tempfile" + + return 0 + +} + +# +# Ended Tiamt Onedir Install Functions +# +####################################################################################################################### + ####################################################################################################################### # # Default minion configuration function. Matches ANY distribution as long as @@ -7896,6 +8444,36 @@ 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 + + if [ '$(ps wwwaux | grep -v grep | grep "/opt/saltstack/salt/run/run $fname")' = "" ]; then + echoerror "salt-$fname 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. @@ -7996,6 +8574,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 @@ -8047,6 +8626,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" From 2cb95abd296c0f396c61a40b98dac92c5b762389 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 19 Jul 2022 09:58:48 -0700 Subject: [PATCH 02/15] More updates for installing Salt Tiamat packages via the bootstrap script. --- bootstrap-salt.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 649c2ac..ebee79f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -268,6 +268,7 @@ _CUSTOM_MASTER_CONFIG="null" _CUSTOM_MINION_CONFIG="null" _QUIET_GIT_INSTALLATION=$BS_FALSE _REPO_URL="repo.saltproject.io" +_TIAMT_DIR="salt_rc" _PY_EXE="python3" _INSTALL_PY="$BS_FALSE" _TORNADO_MAX_PY3_VERSION="5.0" @@ -3007,8 +3008,9 @@ __install_saltstack_ubuntu_tiamat_repository() { fi # SaltStack's stable Ubuntu repository: - SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/salt-dev/${__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 + SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}" + #echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list + echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL stable main" > /etc/apt/sources.list.d/salt.list __apt_key_fetch "$SALTSTACK_UBUNTU_URL/salt-archive-keyring.gpg" || return 1 @@ -3526,7 +3528,7 @@ __install_saltstack_debian_tiamat_repository() { __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}/salt-dev/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${TIAMAT_REV}" + 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 @@ -4264,9 +4266,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 @@ -4341,7 +4347,7 @@ __install_saltstack_tiamat_rhel_repository() { # Avoid using '$releasever' variable for yum. # Instead, this should work correctly on all RHEL variants. - base_url="${HTTP_VAL}://${_REPO_URL}/salt-dev/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" + base_url="${HTTP_VAL}://${_REPO_URL}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" if [ "${DISTRO_MAJOR_VERSION}" -eq 7 ]; then gpg_key="SALTSTACK-GPG-KEY.pub base/RPM-GPG-KEY-CentOS-7" else @@ -4367,7 +4373,7 @@ enabled=1 enabled_metadata=1 _eof - fetch_url="${HTTP_VAL}://${_REPO_URL}/salt-dev/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" + fetch_url="${HTTP_VAL}://${_REPO_URL}/salt_rc/${__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 @@ -8196,10 +8202,10 @@ install_macosx_restart_daemons() { install_tiamat() { echoinfo "Fetching repo.json for Tiamat ${_TIAMAT_TYPE}" - base_url="https://repo.saltproject.io/salt-dev/" + base_url="https://repo.saltproject.io/salt_rc/" tiamat_type_repo_json_url="${base_url}${_TIAMAT_TYPE}/repo.json" repo_json_file="$(mktemp /tmp/base-json-XXXXXXXX 2>/dev/null)" - salt_url="https://repo.saltproject.io/salt-dev/${_TIAMAT_TYPE}" + salt_url="https://repo.saltproject.io/salt_rc/${_TIAMAT_TYPE}" if [ -z "$repo_json_file" ]; then echoerror "Failed to create temporary file in /tmp" From b6f7490e5a2d3a9f5f1d7c6a7d3d11f2e9dad36a Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 19 Jul 2022 10:06:20 -0700 Subject: [PATCH 03/15] fixing typo. --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 34a00dd..125e244 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -268,7 +268,7 @@ _CUSTOM_MASTER_CONFIG="null" _CUSTOM_MINION_CONFIG="null" _QUIET_GIT_INSTALLATION=$BS_FALSE _REPO_URL="repo.saltproject.io" -_TIAMT_DIR="salt_rc" +_TIAMAT_DIR="salt_rc" _PY_EXE="python3" _INSTALL_PY="$BS_FALSE" _TORNADO_MAX_PY3_VERSION="5.0" From b69353db3a717cf29bbfa1d0e87b0c2935e25f4d Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 19 Jul 2022 10:17:46 -0700 Subject: [PATCH 04/15] Updating salt_rc directory --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 125e244..1685c78 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -268,7 +268,7 @@ _CUSTOM_MASTER_CONFIG="null" _CUSTOM_MINION_CONFIG="null" _QUIET_GIT_INSTALLATION=$BS_FALSE _REPO_URL="repo.saltproject.io" -_TIAMAT_DIR="salt_rc" +_TIAMAT_DIR="salt_rc/salt" _PY_EXE="python3" _INSTALL_PY="$BS_FALSE" _TORNADO_MAX_PY3_VERSION="5.0" From 316c74ab3728faf75dfec834c0f1dc6794b4dfd1 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 19 Jul 2022 10:20:28 -0700 Subject: [PATCH 05/15] fixing another reference to the Tiamat directory --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1685c78..a9cf5c1 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4382,7 +4382,7 @@ enabled=1 enabled_metadata=1 _eof - fetch_url="${HTTP_VAL}://${_REPO_URL}/salt_rc/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/" + 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 From 559b8db54f6f7c6a14dd13b8b7fa0e220c283d61 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 21 Jul 2022 12:34:33 -0700 Subject: [PATCH 06/15] Adding TIAMAT_REV to install specific versions of Tiamat packages, defaults to latest. --- bootstrap-salt.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a9cf5c1..45caa75 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -627,8 +627,23 @@ elif [ "$ITYPE" = "stable" ]; then fi elif [ "$ITYPE" = "tiamat" ]; then - #TIAMET_REV="latest" - TIAMET_REV="" + 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 + fi # Check for any unparsed arguments. Should be an error. @@ -3012,7 +3027,7 @@ __install_saltstack_ubuntu_tiamat_repository() { fi # SaltStack's stable Ubuntu repository: - SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${_TIAMAT_DIR}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}" + 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 echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL stable main" > /etc/apt/sources.list.d/salt.list @@ -4356,7 +4371,7 @@ __install_saltstack_tiamat_rhel_repository() { # 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/" + 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 From 7e669842058887bfe0acd7dc19d6e2765dda7f6e Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 21 Jul 2022 15:43:17 -0700 Subject: [PATCH 07/15] Adding ability to install RC Tiamat packages via bootstrap script. --- bootstrap-salt.sh | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 45caa75..2f2a1bd 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -268,7 +268,7 @@ _CUSTOM_MASTER_CONFIG="null" _CUSTOM_MINION_CONFIG="null" _QUIET_GIT_INSTALLATION=$BS_FALSE _REPO_URL="repo.saltproject.io" -_TIAMAT_DIR="salt_rc/salt" +_TIAMAT_DIR="salt" _PY_EXE="python3" _INSTALL_PY="$BS_FALSE" _TORNADO_MAX_PY3_VERSION="5.0" @@ -306,6 +306,10 @@ __usage() { - 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} - ${__ScriptName} stable @@ -318,6 +322,8 @@ __usage() { - ${__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 @@ -588,7 +594,7 @@ if [ "$#" -gt 0 ];then fi # Check installation type -if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|tiamat)')" = "" ]; then +if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|tiamat|tiamat_rc)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi @@ -644,6 +650,29 @@ elif [ "$ITYPE" = "tiamat" ]; then 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. @@ -3028,10 +3057,9 @@ __install_saltstack_ubuntu_tiamat_repository() { # 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 - echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL stable main" > /etc/apt/sources.list.d/salt.list + 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-archive-keyring.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -3547,10 +3575,10 @@ __install_saltstack_debian_tiamat_repository() { __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}" + 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 + __apt_key_fetch "${SALTSTACK_DEBIAN_URL}salt-archive-keyring.gpg" || return 1 __wait_for_apt apt-get update || return 1 } @@ -8499,6 +8527,7 @@ daemons_running_tiamat() { return $FAILED_DAEMONS } + # # Ended daemons running check function # From ed00a6c9b0fc82dd20a8e5c82801b93c39dd1d57 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Fri, 22 Jul 2022 11:52:37 -0700 Subject: [PATCH 08/15] adding missing Debian bits for Tiamat installs. Renaming the tiamat repo. functions to be consistent. --- bootstrap-salt.sh | 61 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2f2a1bd..1fa7765 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3550,7 +3550,7 @@ __install_saltstack_debian_repository() { } __install_saltstack_debian_tiamat_repository() { - DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" + DEBIAN_RELEASE="$DISTRO_MAJORtiamat__VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" __PY_VERSION_REPO="apt" @@ -3636,6 +3636,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 @@ -4385,7 +4438,7 @@ _eof return 0 } -__install_saltstack_tiamat_rhel_repository() { +__install_saltstack_rhel_tiamat_repository() { if [ "$ITYPE" = "stable" ]; then repo_rev="$TIAMAT_REV" else @@ -4756,14 +4809,14 @@ install_centos_tiamat_deps() { if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ]; then __install_epel_repository || return 1 - __install_saltstack_tiamat_rhel_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_tiamat_rhel_repository || return 1 + __install_saltstack_rhel_tiamat_repository || return 1 fi if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then From f0973863199953a9cf56fcbca810d719dc4943e9 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Fri, 22 Jul 2022 12:41:34 -0700 Subject: [PATCH 09/15] fixing some lint issues. --- bootstrap-salt.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1fa7765..c6bb14d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3550,7 +3550,7 @@ __install_saltstack_debian_repository() { } __install_saltstack_debian_tiamat_repository() { - DEBIAN_RELEASE="$DISTRO_MAJORtiamat__VERSION" + DEBIAN_RELEASE="$DISTRO_MAJOR_VERSION" DEBIAN_CODENAME="$DISTRO_CODENAME" __PY_VERSION_REPO="apt" @@ -4377,7 +4377,7 @@ __install_epel_repository() { # 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" - yum -y install ${epel_next_repo_url} ${epel_repo_url} + yum -y install "${epel_next_repo_url}" "${epel_repo_url}" _EPEL_REPOS_INSTALLED=$BS_TRUE @@ -8572,8 +8572,9 @@ daemons_running_tiamat() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ '$(ps wwwaux | grep -v grep | grep "/opt/saltstack/salt/run/run $fname")' = "" ]; then - echoerror "salt-$fname was not found running" + salt_path="/opt/saltstack/salt/run/run" + if [ "$(ps wwwaux | grep -v grep | grep $salt_path | grep $fname)" = "" ]; then + echoerror "$salt_process was not found running" FAILED_DAEMONS=$((FAILED_DAEMONS + 1)) fi done From 408f5beefb0e45b67c798b0722233372051556f9 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 25 Jul 2022 17:24:12 -0700 Subject: [PATCH 10/15] removing unnecessary code --- bootstrap-salt.sh | 137 ---------------------------------------------- 1 file changed, 137 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c6bb14d..17797d3 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -8225,143 +8225,6 @@ install_macosx_restart_daemons() { # ####################################################################################################################### -####################################################################################################################### -# -# Begin Tiamat Onedir Install Functions -# - - _parse_json_specd_ver() { - local file_name="$1" - local salt_url_version="$2" - local file_value="" - local blk_count=0 - local specd_ver_blk_count=0 - local specd_ver_flag=0 - local found_specd_ver_linux=0 - - local var1="" - local var2="" - declare -A rdict - - file_value=$(<"${file_name}") - - # limit 80 cols - var1=$(echo "${file_value}" | sed 's/,/,\n/g' | sed 's/{/\n{\n/g') - var2=$(echo "${var1}" | sed 's/}/\n}\n/g' | sed 's/,//g' | sed 's/"//g') - - while IFS= read -r line - do - echodebug "$0:${FUNCNAME[0]} parsing line '${line}'" - if [[ -z "${line}" ]]; then - continue - fi - if [[ "${line}" = "{" ]]; then - (( blk_count++ )) - elif [[ "${line}" = "}" ]]; then - # examine directory just read in - if [[ ${specd_ver_flag} -eq 1 ]]; then - if [[ "${rdict['os']}" = "linux" ]]; then - # have linux values for specd_ver - echodebug "$0:${FUNCNAME[0]} parsed following linux for"\ - "specified version '${salt_url_version}' from repo json"\ - "file '${file_name}', os ${rdict['os']}, version"\ - "${rdict['version']}, name ${rdict['name']}, SHA512"\ - "${rdict['SHA512']}" - found_specd_ver_linux=1 - break - fi - fi - - if [[ ${blk_count} -eq ${specd_ver_blk_count} ]]; then - specd_ver_flag=0 - break - fi - (( blk_count-- )) - else - line_key=$(echo "${line}" | cut -d ':' -f 1 | xargs) - line_value=$(echo "${line}" | cut -d ':' -f 2 | xargs) - if [[ "${line_key}" = "${salt_url_version}" ]]; then - # note blk_count encountered 'specd_ver', closing brace check - specd_ver_flag=1 - specd_ver_blk_count=${blk_count} - (( specd_ver_blk_count++ )) - else - rdict["${line_key}"]="${line_value}" - echodebug "$0:${FUNCNAME[0]} updated dictionary with"\ - "line_key '${line_key}' and line_value '${line_value}'" - fi - fi - done <<< "${var2}" - - if [[ ${found_specd_ver_linux} -eq 1 ]]; then - echo "${rdict['version']}:${rdict['name']}:${rdict['SHA512']}" - else - echoerr "$0:${FUNCNAME[0]} unable to parse version, name and "\ - "SHA512 from repo json file '${file_name}'" - # echo "" - fi - return 0 -} - - -install_tiamat() { - echoinfo "Fetching repo.json for Tiamat ${_TIAMAT_TYPE}" - - base_url="https://repo.saltproject.io/salt_rc/" - tiamat_type_repo_json_url="${base_url}${_TIAMAT_TYPE}/repo.json" - repo_json_file="$(mktemp /tmp/base-json-XXXXXXXX 2>/dev/null)" - salt_url="https://repo.saltproject.io/salt_rc/${_TIAMAT_TYPE}" - - if [ -z "$repo_json_file" ]; then - echoerror "Failed to create temporary file in /tmp" - return 1 - fi - - __fetch_url "$repo_json_file" "$tiamat_type_repo_json_url" || return 1 - - json_version_name_sha=$(_parse_json_specd_ver "${repo_json_file}" "${_TIAMAT_VERSION}") - - echoinfo "json_version_name_sha ${json_version_name_sha}" - - echoinfo "Installing Tiamat ${_TIAMAT_TYPE}" - - rm -f "$repo_json_file" - - salt_json_version=$(\ - echo "${json_version_name_sha}" | awk -F":" '{print $1}') - salt_json_name=$(\ - echo "${json_version_name_sha}" | awk -F":" '{print $2}') - salt_json_sha512=$(\ - echo "${json_version_name_sha}" | awk -F":" '{print $3}') - echodebug "$0:${FUNCNAME[0]} using repo.json values version"\ - "'${salt_json_version}', name '${salt_json_name}, sha512"\ - "'${salt_json_sha512}'" - - echoinfo "salt_json_name - ${salt_json_name}" - salt_pkg_name="${salt_json_name}" - salt_pkg_url="${salt_url}/${salt_json_version}/${salt_pkg_name}" - - echoinfo "salt_pkg_name - ${salt_pkg_name}" - tempfile="$(mktemp /tmp/${salt_pkg_name}-XXXXXXXX.tar.gz 2>/dev/null)" - - if [ -z "$tempfile" ]; then - echoerror "Failed to create temporary file in /tmp" - return 1 - fi - - __fetch_url "$tempfile" "$salt_pkg_url" || return 1 - - #rm -f "$tempfile" - - return 0 - -} - -# -# Ended Tiamt Onedir Install Functions -# -####################################################################################################################### - ####################################################################################################################### # # Default minion configuration function. Matches ANY distribution as long as From d8c6f04a46978bfcd3b1e419485de25e6b3ac537 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 25 Jul 2022 17:33:51 -0700 Subject: [PATCH 11/15] Reverting script header back to origin line. --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 17797d3..68669f1 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: From ba0d83ff3fc7f217f7c521eb3f89b8f70a3d0619 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 25 Jul 2022 19:03:32 -0700 Subject: [PATCH 12/15] Some lint fixes. --- bootstrap-salt.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 68669f1..d01844b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -8435,9 +8435,10 @@ daemons_running_tiamat() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - salt_path="/opt/saltstack/salt/run/run" - if [ "$(ps wwwaux | grep -v grep | grep $salt_path | grep $fname)" = "" ]; then - echoerror "$salt_process was not found running" + 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 From eb71c10af78352e6f5793166186c3cb0f70e2192 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 26 Jul 2022 12:07:21 -0700 Subject: [PATCH 13/15] removing Ubuntu 21.10 which is now EOL. --- .github/workflows/templates/generate.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index de12cfc..8a8f799 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -27,7 +27,6 @@ LINUX_DISTROS = [ "ubuntu-1604", "ubuntu-1804", "ubuntu-2004", - "ubuntu-2110", "ubuntu-2204", ] OSX = WINDOWS = [] @@ -53,7 +52,6 @@ STABLE_DISTROS = [ "rockylinux-8", "ubuntu-1804", "ubuntu-2004", - "ubuntu-2110", "ubuntu-2204", ] @@ -201,7 +199,6 @@ DISTRO_DISPLAY_NAMES = { "ubuntu-1604": "Ubuntu 16.04", "ubuntu-1804": "Ubuntu 18.04", "ubuntu-2004": "Ubuntu 20.04", - "ubuntu-2110": "Ubuntu 21.10", "ubuntu-2204": "Ubuntu 22.04", } From 6ab871c1da51106a72ac5f03345e812108727b6d Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 26 Jul 2022 15:55:26 -0700 Subject: [PATCH 14/15] removing Ubuntu bits. --- .github/workflows/main.yml | 230 ------------------------------------- 1 file changed, 230 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3d15af..aebc8e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4095,236 +4095,6 @@ jobs: bundle exec kitchen destroy latest-ubuntu-2004 - py3-stable-3002-ubuntu-2110: - name: Ubuntu 21.10 v3002 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-3002-ubuntu-2110 || bundle exec kitchen create py3-stable-3002-ubuntu-2110 - - - name: Test Bootstrap In Test Container - run: | - bundle exec kitchen verify py3-stable-3002-ubuntu-2110 - - - name: Destroy Test Container - if: always() - run: | - bundle exec kitchen destroy py3-stable-3002-ubuntu-2110 - - - 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 From 71d41133278e813b2e053a7360da0dccfa136d0f Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 26 Jul 2022 16:05:14 -0700 Subject: [PATCH 15/15] removing Ubuntu bits. --- .github/workflows/main.yml | 184 ------------------------------------- 1 file changed, 184 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06864cf..fa24692 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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