diff --git a/buildchain/buildchain/salt_tree.py b/buildchain/buildchain/salt_tree.py index 99f3b44abf..d232f95f02 100644 --- a/buildchain/buildchain/salt_tree.py +++ b/buildchain/buildchain/salt_tree.py @@ -577,6 +577,7 @@ def task(self) -> types.TaskDict: Path("salt/metalk8s/macro.sls"), Path("salt/metalk8s/map.jinja"), Path("salt/metalk8s/node/grains.sls"), + Path("salt/metalk8s/node/rocky-linux-grains.sls"), Path("salt/metalk8s/orchestrate/apiserver.sls"), Path("salt/metalk8s/orchestrate/deploy_node.sls"), Path("salt/metalk8s/orchestrate/etcd.sls"), diff --git a/eve/main.yml b/eve/main.yml index 603a210850..e8b4523755 100644 --- a/eve/main.yml +++ b/eve/main.yml @@ -18,7 +18,7 @@ models: name: Git pull terraform snapshot command: > git clone --depth 1 "git@github.com:scality/terraform-snapshot.git" - --branch "0.3.2" + --branch "0.3.6" haltOnFailure: true - ShellCommand: &git_pull_ssh name: Git pull on bastion @@ -786,6 +786,7 @@ models: case "%(prop:os:-centos-7)s" in centos-*) REPORT_OWNER=${REPORT_OWNER:-centos} REPORT_GROUP=${REPORT_GROUP:-centos};; rhel-*) REPORT_OWNER=${REPORT_OWNER:-cloud-user} REPORT_GROUP=${REPORT_GROUP:-cloud-user};; + rocky-*) REPORT_OWNER=${REPORT_OWNER:-rocky} REPORT_GROUP=${REPORT_GROUP:-rocky};; esac for host in $HOSTS_LIST; do ssh -F "$SSH_CONFIG" $host \ @@ -894,6 +895,7 @@ stages: - lifecycle-minor-version - lifecycle-major-version - bootstrap-restore + - single-node-install-rocky-8 haltOnFailure: true - TriggerStages: name: Trigger publish stage @@ -1798,6 +1800,27 @@ stages: stage_names: - single-node-install + single-node-install-rocky-8: + worker: + type: local + steps: + - SetProperty: + name: Set OS property to Rocky 8 + property: os + value: "rocky-8" + - SetProperty: + name: Set offline property to false + property: offline + value: "false" + - SetProperty: + name: Set use_proxy property to false + property: use_proxy + value: "false" + - TriggerStages: + name: Trigger single-node-install with OS set to Rocky 8 + stage_names: + - single-node-install + single-node-install: _metalk8s_internal_info: junit_info: &_install_single-node_junit_info diff --git a/salt/metalk8s/node/grains.sls b/salt/metalk8s/node/grains.sls index 9114239e5f..e2947379aa 100644 --- a/salt/metalk8s/node/grains.sls +++ b/salt/metalk8s/node/grains.sls @@ -1,3 +1,6 @@ +include: + - .rocky-linux-grains + {%- if '_errors' in pillar.networks %} {{ raise('Errors in networks pillar: ' ~ pillar.networks._errors) }} {%- endif %} diff --git a/salt/metalk8s/node/rocky-linux-grains.sls b/salt/metalk8s/node/rocky-linux-grains.sls new file mode 100644 index 0000000000..b710f63155 --- /dev/null +++ b/salt/metalk8s/node/rocky-linux-grains.sls @@ -0,0 +1,28 @@ +{#- Ugly workaround waiting for Rocky Linux support in Salt #} +{%- if grains.get("os_family") == "Rocky" %} + +Set os_family grain: + grains.present: + - name: os_family + - value: RedHat + +{%- else %} + +Not a Rocky Linux host, no os_family grain to set: + test.nop + +{%- endif %} + +{%- if grains.get("os") == "Rocky" %} + +Set os grain: + grains.present: + - name: os + - value: CentOS + +{%- else %} + +Not a Rocky Linux host, no os grain to set: + test.nop + +{%- endif %} diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 020784d7dd..da7b992e00 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -23,7 +23,7 @@ determine_os() { OS=$ID OS_VERSION=$VERSION_ID [[ $OS = rhel ]] && OS=redhat - if [[ $OS =~ ^(redhat|centos)$ ]]; then + if [[ $OS =~ ^(redhat|centos|rocky)$ ]]; then OS_FAMILY=redhat fi else @@ -227,6 +227,10 @@ check_dist_redhat() { "subscription management service" >&2 } +check_dist_rocky() { + check_package_manager_yum +} + pre_minion_checks() { if declare -f "check_dist_$OS" &> /dev/null; then "check_dist_$OS" @@ -272,6 +276,10 @@ configure_salt_minion_local_mode() { "$SALT_CALL" --file-root="$file_root" \ --local --retcode-passthrough saltutil.sync_all saltenv=base + # Workaround waiting for Rocky Linux support in Salt + "$SALT_CALL" --file-root="$file_root" \ + --local --retcode-passthrough state.sls \ + metalk8s.node.rocky-linux-grains saltenv=base "$SALT_CALL" --file-root="$file_root" \ --local --retcode-passthrough state.sls metalk8s.salt.minion.local \ pillar="{'metalk8s': {'archives': '$BASE_DIR'}}" saltenv=base