Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rocky linux support #3686

Merged
merged 2 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildchain/buildchain/salt_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
25 changes: 24 additions & 1 deletion eve/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ models:
name: Git pull terraform snapshot
command: >
git clone --depth 1 "[email protected]:scality/terraform-snapshot.git"
--branch "0.3.2"
--branch "0.3.6"
haltOnFailure: true
- ShellCommand: &git_pull_ssh
name: Git pull on bastion
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -894,6 +895,7 @@ stages:
- lifecycle-minor-version
- lifecycle-major-version
- bootstrap-restore
- single-node-install-rocky-8
alexandre-allard marked this conversation as resolved.
Show resolved Hide resolved
haltOnFailure: true
- TriggerStages:
name: Trigger publish stage
Expand Down Expand Up @@ -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"
alexandre-allard marked this conversation as resolved.
Show resolved Hide resolved
- 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
Expand Down
3 changes: 3 additions & 0 deletions salt/metalk8s/node/grains.sls
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include:
- .rocky-linux-grains

{%- if '_errors' in pillar.networks %}
{{ raise('Errors in networks pillar: ' ~ pillar.networks._errors) }}
{%- endif %}
Expand Down
28 changes: 28 additions & 0 deletions salt/metalk8s/node/rocky-linux-grains.sls
Original file line number Diff line number Diff line change
@@ -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 %}
10 changes: 9 additions & 1 deletion scripts/common.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -227,6 +227,10 @@ check_dist_redhat() {
"subscription management service" >&2
}

check_dist_rocky() {
check_package_manager_yum
}

TeddyAndrieux marked this conversation as resolved.
Show resolved Hide resolved
pre_minion_checks() {
if declare -f "check_dist_$OS" &> /dev/null; then
"check_dist_$OS"
Expand Down Expand Up @@ -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
Expand Down