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

Add support for SL Micro 6.1 hosts #1771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Legal values for work-in-progress software are:
- `4.3-VM-nightly` (corresponds to the VM image in the Build Service project Devel:Galaxy:Manager:4.3)
- `4.3-beta` (corresponds to the Build Service project SUSE:SLE-15-SP4:Update:Products:Manager43)
- `5.0-nightly` (corresponds to the Build Service project Devel:Galaxy:Manager:5.0)
- `head` (corresponds to the Build Service project Devel:Galaxy:Manager:Head, uses SLE Micro as the base image for server)
- `head` (corresponds to the Build Service project Devel:Galaxy:Manager:Head, uses SL Micro 6.1 as the base image for server)
- `uyuni-master` (corresponds to the Build Service project systemsmanagement:Uyuni:Master, for `server` and `proxy` only works with openSUSE Leap image)

**Important:** sumaform only supports containerized deployments for SUSE Manager versions 5.0 and later.
Expand Down
87 changes: 87 additions & 0 deletions backend_modules/libvirt/host/user_data.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slemicro61o is not supported by user_data.yaml but combustion. Those changes need to be impacted in combustion (if needed).

combustion_images = ["leapmicro55o", "slmicro60o", "slmicro61o"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check if what is already in combustion is not enough.

Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,93 @@ runcmd:
- [ reboot ]
%{ endif }

%{ if image == "slmicro61o" }

%{ if container_server }
%{ if product_version == "head" }
- id: container_tools_repo
name: container_tools_repo
baseurl: http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/ContainerUtils/SLMicro6/
enabled: 1
autorefresh: 1
gpgcheck: false
%{ endif }
%{ endif }
%{ if container_proxy }
%{ if product_version == "head" }
- id: container_tools_repo
name: container_tools_repo
baseurl: http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/ContainerUtils/SLMicro6/
enabled: 1
autorefresh: 1
gpgcheck: false
%{ endif }
%{ endif }

%{ if testsuite }
# Required only for wget
- id: os_pool_repo
name: os_pool_repo
baseurl: http://${ use_mirror_images ? mirror : "download.suse.de/ibs"}/SUSE/Products/SLE-Module-Basesystem/15-SP5/x86_64/product
enabled: 1
autorefresh: 1
gpgcheck: false
%{ endif }
- id: ca_suse
name: ca_suse
baseurl: http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP5/
enabled: 1
autorefresh: 1
gpgcheck: false
- id: micro_pool_repo
name: micro_pool_repo
baseurl: http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Products/SL-Micro/6.1/x86_64/product/
enabled: 1
autorefresh: 1
gpgcheck: false
# There is no updates repo currently
# - id: micro_update_repo
# name: micro_update_repo
# baseurl: http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Updates/SL-Micro/6.1/x86_64/update/
# enabled: 1
# autorefresh: 1
# gpgcheck: false
- id: tools_pool_repo
name: tools_pool_repo
baseurl: http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/Devel:/Galaxy:/Manager:/Head:/SLE15-SUSE-Manager-Tools/images/repo/SLE-15-Manager-Tools-POOL-x86_64-Media1/
enabled: 1
autorefresh: 1
gpgcheck: false
%{ for name, url in jsondecode(additional_repos) }
- id: ${name}_repo
name: ${name}_repo
baseurl: ${url}
enabled: 1
autorefresh: 1
gpgcheck: false
%{ endfor }

runcmd:
- [transactional-update, run, sh, -c, "for key in $(ls /etc/gpg_keys); do rpm --import /etc/gpg_keys/$key; done" ]
- [ zypper, mr, -a, -g ]
%{ if testsuite }
# Packages needed for the testsuite
- [ transactional-update, --continue, --non-interactive, pkg, install, wget, timezone, expect, aaa_base-extras, ca-certificates ]
%{ endif }
%{ if container_server }
- [ transactional-update, --continue, --non-interactive, pkg, install, mgrctl, mgradm, netavark, aardvark-dns, ca-certificates-suse ]
%{ endif }
%{ if container_proxy }
- [ transactional-update, --continue, --non-interactive, pkg, install, mgrpxy, ca-certificates-suse ]
%{ endif }
%{ if install_salt_bundle }
- [ transactional-update, --continue, --non-interactive, pkg, install, qemu-guest-agent, venv-salt-minion, avahi ]
%{ else }
- [ transactional-update, --continue, --non-interactive, pkg, install, qemu-guest-agent, salt-minion, avahi ]
%{ endif }
- [ reboot ]
%{ endif }

%{ if image == "ubuntu2004o" }

apt:
Expand Down
2 changes: 2 additions & 0 deletions modules/controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module "controller" {
slemicro55_sshminion = length(var.slemicro55_sshminion_configuration["hostnames"]) > 0 ? var.slemicro55_sshminion_configuration["hostnames"][0] : null
slmicro60_minion = length(var.slmicro60_minion_configuration["hostnames"]) > 0 ? var.slmicro60_minion_configuration["hostnames"][0] : null
slmicro60_sshminion = length(var.slmicro60_sshminion_configuration["hostnames"]) > 0 ? var.slmicro60_sshminion_configuration["hostnames"][0] : null
slmicro61_minion = length(var.slmicro61_minion_configuration["hostnames"]) > 0 ? var.slmicro61_minion_configuration["hostnames"][0] : null
slmicro61_sshminion = length(var.slmicro61_sshminion_configuration["hostnames"]) > 0 ? var.slmicro61_sshminion_configuration["hostnames"][0] : null
centos7_minion = length(var.centos7_minion_configuration["hostnames"]) > 0 ? var.centos7_minion_configuration["hostnames"][0] : null
centos7_sshminion = length(var.centos7_sshminion_configuration["hostnames"]) > 0 ? var.centos7_sshminion_configuration["hostnames"][0] : null
centos7_client = length(var.centos7_client_configuration["hostnames"]) > 0 ? var.centos7_client_configuration["hostnames"][0] : null
Expand Down
22 changes: 22 additions & 0 deletions modules/controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ variable "slemicro_minion_configuration" {
}
}

variable "slmicro_minion_configuration" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a minion for slmicro ? Can't we reuse the slemicro minion. Just a question.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reuse it indeed.
Maybe in a future PR, we can also rename it, to something like suse_micro_minion.

description = "use module.<SL_MICRO_MINION_NAME>.configuration, see main.tf.libvirt-testsuite.example"
default = {
ids = []
hostnames = []
}
}

variable "buildhost_configuration" {
description = "use module.<BUILDHOST_NAME>.configuration, see main.tf.libvirt-testsuite.example"
default = {
Expand Down Expand Up @@ -352,13 +360,27 @@ variable "slmicro60_minion_configuration" {
}
}

variable "slmicro61_minion_configuration" {
description = "use module.<SLMICRO61_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}

variable "slmicro60_sshminion_configuration" {
description = "use module.<SLMICRO60_SSHMINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}

variable "slmicro61_sshminion_configuration" {
description = "use module.<SLMICRO61_SSHMINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}

variable "centos7_minion_configuration" {
description = "use module.<CENTOS7_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
Expand Down
24 changes: 24 additions & 0 deletions modules/cucumber_testsuite/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,28 @@ module "slemicro_minion" {
provider_settings = lookup(local.provider_settings_by_host, "slemicro_minion", {})
}

module "slmicro_minion" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a minion for slmicro ? Can't we reuse the slemicro minion. Just a question.

source = "../minion"

quantity = contains(local.hosts, "slmicro_minion") ? 1 : 0
base_configuration = module.base.configuration
image = lookup(local.images, "slmicro_minion", "slmicro61o")
name = lookup(local.names, "slmicro_minion", "slmicro-minion")

server_configuration = local.minimal_configuration
sles_registration_code = lookup(local.sles_registration_code, "slmicro_minion", null)

use_os_released_updates = true
ssh_key_path = "./salt/controller/id_rsa.pub"
install_salt_bundle = lookup(local.install_salt_bundle, "slmicro_minion", true)

additional_repos = lookup(local.additional_repos, "slmicro_minion", {})
additional_repos_only = lookup(local.additional_repos_only, "slmicro_minion", false)
additional_packages = lookup(local.additional_packages, "slmicro_minion", ["avahi", "avahi-lang", "libavahi-common3", "libavahi-core7"])
additional_grains = lookup(local.additional_grains, "slmicro_minion", {})
provider_settings = lookup(local.provider_settings_by_host, "slmicro_minion", {})
}

module "rhlike_minion" {
source = "../minion"

Expand Down Expand Up @@ -471,6 +493,7 @@ module "controller" {
minion_configuration = contains(local.hosts, "suse_minion") ? module.suse_minion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
sshminion_configuration = contains(local.hosts, "suse_sshminion") ? module.suse_sshminion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
slemicro_minion_configuration = contains(local.hosts, "slemicro_minion") ? module.slemicro_minion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
slmicro_minion_configuration = contains(local.hosts, "slmicro_minion") ? module.slmicro_minion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
# TODO: rename redhat_configuration and debian_configuration to rhlike_configuration and deblike_configuration once the renaming is done: https://github.com/SUSE/spacewalk/issues/25062
redhat_configuration = contains(local.hosts, "rhlike_minion") ? module.rhlike_minion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
debian_configuration = contains(local.hosts, "deblike_minion") ? module.deblike_minion.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
Expand Down Expand Up @@ -505,6 +528,7 @@ output "configuration" {
proxy = var.container_proxy ? module.proxy_containerized[0].configuration : module.proxy[0].configuration
suse_client = module.suse_client.configuration
slemicro_minion = module.slemicro_minion.configuration
Copy link
Contributor

@maximenoel8 maximenoel8 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the controller, we are parsing those slemicro and slmicro minion variables but we are actually doing nothing with it.
The slemicro variable is call nowhere.

variable "slemicro_minion_configuration" {
description = "use module.<SLE_MICRO_MINION_NAME>.configuration, see main.tf.libvirt-testsuite.example"
default = {
ids = []
hostnames = []
}
}

If you search in controller/main.tf, we don't use this variable.

We don't declare it in bashrc controller.

{% if grains.get('proxy') | default(false, true) %}export PROXY="{{ grains.get('proxy') }}" {% else %}# no proxy defined {% endif %}
{% if grains.get('client') | default(false, true) %}export CLIENT="{{ grains.get('client') }}"{% else %}# no client defined {% endif %}
{% if grains.get('minion') | default(false, true) %}export MINION="{{ grains.get('minion') }}"{% else %}# no minion defined {% endif %}
{% if grains.get('build_host') | default(false, true) %}export BUILD_HOST="{{ grains.get('build_host') }}"{% else %}# no build host defined {% endif %}
{% if grains.get('ssh_minion') | default(false, true) %}export SSH_MINION="{{ grains.get('ssh_minion') }}" {% else %}# no SSH minion defined {% endif %}
{% if grains.get('redhat_minion') | default(false, true) %}export RHLIKE_MINION="{{ grains.get('redhat_minion') }}" {% else %}# no RedHat-like minion defined {% endif %}
{% if grains.get('debian_minion') | default(false, true) %}export DEBLIKE_MINION="{{ grains.get('debian_minion') }}" {% else %}# no Debian-like minion defined {% endif %}
{% if grains.get('pxeboot_mac') | default(false, true) %}export PXEBOOT_MAC="{{ grains.get('pxeboot_mac') }}" {% else %}# no PXE boot MAC defined {% endif %}
{% if grains.get('kvm_host') | default(false, true) %}export VIRTHOST_KVM_URL="{{ grains.get('kvm_host') }}"

slmicro_minion = module.slmicro_minion.configuration
suse_minion = module.suse_minion.configuration
suse_sshminion = module.suse_sshminion.configuration
rhlike_minion = module.rhlike_minion.configuration
Expand Down
2 changes: 1 addition & 1 deletion modules/cucumber_testsuite/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variable "name_prefix" {

variable "images" {
description = "list of images to be uploaded to the libvirt host, leave default for all"
default = ["centos7o", "opensuse155o", "leapmicro55o", "slemicro55o", "rocky8o", "rocky9o", "sles12sp5o", "sles15sp2o", "sles15sp3o", "sles15sp4o", "sles15sp5o", "sles15sp6o", "ubuntu2004o", "ubuntu2204o", "suma43VM-ign"]
default = ["centos7o", "opensuse155o", "leapmicro55o", "slemicro55o", "slmicro60o", "slmicro61o", "rocky8o", "rocky9o", "sles12sp5o", "sles15sp2o", "sles15sp3o", "sles15sp4o", "sles15sp5o", "sles15sp6o", "ubuntu2004o", "ubuntu2204o", "suma43VM-ign"]
}

variable "main_disk_size" {
Expand Down
2 changes: 2 additions & 0 deletions salt/controller/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export VIRTHOST_KVM_PASSWORD="linux" {% else %}# no KVM host defined {% endif %}
{% if grains.get('slemicro55_sshminion') | default(false, true) %}export SLEMICRO55_SSHMINION="{{ grains.get('slemicro55_sshminion') }}" {% else %}# no SLEMICRO55 ssh minion defined {% endif %}
{% if grains.get('slmicro60_minion') | default(false, true) %}export SLMICRO60_MINION="{{ grains.get('slmicro60_minion') }}" {% else %}# no SLMICRO60 minion defined {% endif %}
{% if grains.get('slmicro60_sshminion') | default(false, true) %}export SLMICRO60_SSHMINION="{{ grains.get('slmicro60_sshminion') }}" {% else %}# no SLMICRO60 ssh minion defined {% endif %}
{% if grains.get('slmicro61_minion') | default(false, true) %}export SLMICRO61_MINION="{{ grains.get('slmicro61_minion') }}" {% else %}# no SLMICRO61 minion defined {% endif %}
{% if grains.get('slmicro61_sshminion') | default(false, true) %}export SLMICRO61_SSHMINION="{{ grains.get('slmicro61_sshminion') }}" {% else %}# no SLMICRO61 ssh minion defined {% endif %}
{% if grains.get('alma8_minion') | default(false, true) %}export ALMA8_MINION="{{ grains.get('alma8_minion') }}" {% else %}# no ALMA8 minion defined {% endif %}
{% if grains.get('alma8_sshminion') | default(false, true) %}export ALMA8_SSHMINION="{{ grains.get('alma8_sshminion') }}" {% else %}# no ALMA8 ssh minion defined {% endif %}
{% if grains.get('alma9_minion') | default(false, true) %}export ALMA9_MINION="{{ grains.get('alma9_minion') }}" {% else %}# no ALMA9 minion defined {% endif %}
Expand Down
1 change: 1 addition & 0 deletions salt/mirror/etc/minima.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ scc:
# SL Micro
- SL-Micro-6.0-Pool
- SL-Micro-6.0-Updates
- SL-Micro-6.1-Pool
# SLE 15-SP4 Products
- SLE-Product-SLES15-SP4-Pool
- SLE-Product-SLES15-SP4-Updates
Expand Down
21 changes: 20 additions & 1 deletion salt/repos/client_tools.sls
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,26 @@ tools_update_repo:

{% elif grains['osfullname'] == 'SL-Micro' %}

{# TODO: add SL Micro 6 #}
{% if not grains.get('product_version') or not grains.get('product_version').startswith('uyuni-') %} {# Released Tools repos #}

tools_pool_repo:
pkgrepo.managed:
- baseurl: http://{{ grains.get("mirror") | default("download.suse.de/ibs", true) }}/SUSE/Products/SUSE-Manager-Tools-For-SL-Micro/6/{{ grains.get("cpuarch") }}/product/
- refresh: True

{% else %}

tools_pool_repo:
pkgrepo.managed:
- baseurl: http://{{ grains.get("mirror") | default("downloadcontent.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/Stable:/SLE15-Uyuni-Client-Tools/SLE_15/
- refresh: True

{% endif %} {# Released Tools repos #}

tools_additional_repo:
pkgrepo.managed:
- baseurl: http://{{ grains.get("mirror") | default("download.suse.de", true) }}/ibs/Devel:/Galaxy:/Manager:/Head:/SL-Micro-6-SUSE-Manager-Tools/SL-Micro6/
- refresh: True

{% elif grains['osfullname'] == 'SLE Micro' %}

Expand Down
2 changes: 1 addition & 1 deletion salt/repos/testsuite.sls
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ uyuni_key_for_fake_packages:
- name: transactional-update -c run rpm --import http://{{ grains.get("mirror") | default("minima-mirror-ci-bv.mgr.prv.suse.net", true) }}/uyuni.key
{% endif %}

{% if not (grains['osfullname'] in ['SL-Micro'] and grains['osrelease'] in ['6.0']) and not (grains['osfullname'] in ['openSUSE Leap Micro'] and grains['osrelease'] in ['5.5']) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support both 6.0 and 6.1 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. But in fact here, what we do is to NOT support this salt state if we are on a transactional system.
So, I think we need to refactor it to cover any kind of transactional system version.

{% if not (grains['osfullname'] in ['SL-Micro'] and grains['osrelease'] in ['6.1']) and not (grains['osfullname'] in ['openSUSE Leap Micro'] and grains['osrelease'] in ['5.5']) %}
test_repo_rpm_pool:
pkgrepo.managed:
- baseurl: http://{{ grains.get("mirror") | default("downloadcontent.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/
Expand Down
3 changes: 3 additions & 0 deletions salt/salt_testenv/salt_bundle_package.sls
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
{% if grains['osrelease'] == '6.0' %}
{% set repo_path = 'SLMicro60' %}
{% endif %}
{% if grains['osrelease'] == '6.1' %}
{% set repo_path = 'SLMicro61' %}
{% endif %}
{% endif %}

{% if grains['salt_obs_flavor'] != 'saltstack' %}
Expand Down
2 changes: 1 addition & 1 deletion salt/server_containerized/testsuite.sls
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repo_key_import:
- onchanges:
- file: galaxy_key_copy_host

# needed for SL Micro 6.0 maintenance updates coming from staging e.g.
# needed for SL Micro maintenance updates coming from staging e.g.
# https://download.suse.de/ibs/SUSE:/ALP:/Source:/Standard:/1.0:/Staging:/Z/standard/
suse_staging_key_copy_host:
file.managed:
Expand Down
Loading