From 42db68faf74fdbe0003351128444dfccbea761a7 Mon Sep 17 00:00:00 2001 From: szachovy Date: Thu, 16 Jan 2025 13:45:55 +0100 Subject: [PATCH] integrating sl micro 6.1 with testsuite QE --- README_ADVANCED.md | 2 +- backend_modules/libvirt/host/user_data.yaml | 87 +++++++++++++++++++++ modules/controller/main.tf | 2 + modules/controller/variables.tf | 22 ++++++ modules/cucumber_testsuite/main.tf | 24 ++++++ modules/cucumber_testsuite/variables.tf | 2 +- salt/controller/bashrc | 2 + salt/mirror/etc/minima.yaml | 1 + salt/repos/client_tools.sls | 21 ++++- salt/repos/testsuite.sls | 2 +- salt/salt_testenv/salt_bundle_package.sls | 3 + salt/server_containerized/testsuite.sls | 2 +- 12 files changed, 165 insertions(+), 5 deletions(-) diff --git a/README_ADVANCED.md b/README_ADVANCED.md index 29120c709..02a77981d 100644 --- a/README_ADVANCED.md +++ b/README_ADVANCED.md @@ -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. diff --git a/backend_modules/libvirt/host/user_data.yaml b/backend_modules/libvirt/host/user_data.yaml index 0f068c6d5..9449acdf2 100644 --- a/backend_modules/libvirt/host/user_data.yaml +++ b/backend_modules/libvirt/host/user_data.yaml @@ -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: diff --git a/modules/controller/main.tf b/modules/controller/main.tf index 57ed2dbe6..566372156 100644 --- a/modules/controller/main.tf +++ b/modules/controller/main.tf @@ -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 diff --git a/modules/controller/variables.tf b/modules/controller/variables.tf index 370e0b4d1..e38e0280d 100644 --- a/modules/controller/variables.tf +++ b/modules/controller/variables.tf @@ -62,6 +62,14 @@ variable "slemicro_minion_configuration" { } } +variable "slmicro_minion_configuration" { + description = "use module..configuration, see main.tf.libvirt-testsuite.example" + default = { + ids = [] + hostnames = [] + } +} + variable "buildhost_configuration" { description = "use module..configuration, see main.tf.libvirt-testsuite.example" default = { @@ -352,6 +360,13 @@ variable "slmicro60_minion_configuration" { } } +variable "slmicro61_minion_configuration" { + description = "use module..configuration, see main.tf.libvirt-testsuite.example" + default = { + hostnames = [] + } +} + variable "slmicro60_sshminion_configuration" { description = "use module..configuration, see main.tf.libvirt-testsuite.example" default = { @@ -359,6 +374,13 @@ variable "slmicro60_sshminion_configuration" { } } +variable "slmicro61_sshminion_configuration" { + description = "use module..configuration, see main.tf.libvirt-testsuite.example" + default = { + hostnames = [] + } +} + variable "centos7_minion_configuration" { description = "use module..configuration, see main.tf.libvirt-testsuite.example" default = { diff --git a/modules/cucumber_testsuite/main.tf b/modules/cucumber_testsuite/main.tf index b7a5fbcef..398cbf0da 100644 --- a/modules/cucumber_testsuite/main.tf +++ b/modules/cucumber_testsuite/main.tf @@ -332,6 +332,28 @@ module "slemicro_minion" { provider_settings = lookup(local.provider_settings_by_host, "slemicro_minion", {}) } +module "slmicro_minion" { + 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" @@ -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 = [] } @@ -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 + slmicro_minion = module.slmicro_minion.configuration suse_minion = module.suse_minion.configuration suse_sshminion = module.suse_sshminion.configuration rhlike_minion = module.rhlike_minion.configuration diff --git a/modules/cucumber_testsuite/variables.tf b/modules/cucumber_testsuite/variables.tf index e432fb0bd..1c2f4bd04 100644 --- a/modules/cucumber_testsuite/variables.tf +++ b/modules/cucumber_testsuite/variables.tf @@ -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" { diff --git a/salt/controller/bashrc b/salt/controller/bashrc index f255215fc..776fe39ed 100644 --- a/salt/controller/bashrc +++ b/salt/controller/bashrc @@ -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 %} diff --git a/salt/mirror/etc/minima.yaml b/salt/mirror/etc/minima.yaml index 5a1a484cf..4f8014199 100644 --- a/salt/mirror/etc/minima.yaml +++ b/salt/mirror/etc/minima.yaml @@ -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 diff --git a/salt/repos/client_tools.sls b/salt/repos/client_tools.sls index ee042bcfb..215b346b6 100644 --- a/salt/repos/client_tools.sls +++ b/salt/repos/client_tools.sls @@ -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' %} diff --git a/salt/repos/testsuite.sls b/salt/repos/testsuite.sls index d6bc7018e..fd81e9034 100644 --- a/salt/repos/testsuite.sls +++ b/salt/repos/testsuite.sls @@ -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']) %} +{% 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/ diff --git a/salt/salt_testenv/salt_bundle_package.sls b/salt/salt_testenv/salt_bundle_package.sls index c01978709..02c22007d 100644 --- a/salt/salt_testenv/salt_bundle_package.sls +++ b/salt/salt_testenv/salt_bundle_package.sls @@ -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' %} diff --git a/salt/server_containerized/testsuite.sls b/salt/server_containerized/testsuite.sls index 8989e2416..7287716c6 100644 --- a/salt/server_containerized/testsuite.sls +++ b/salt/server_containerized/testsuite.sls @@ -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: