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 SUSE Liberty Linux 9 support #1259

Merged
merged 1 commit into from
Feb 27, 2023
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
11 changes: 6 additions & 5 deletions backend_modules/libvirt/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ locals {
image_urls = {
almalinux8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://repo.almalinux.org"}/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2"
almalinux9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://repo.almalinux.org"}/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
rocky8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.rockylinux.org"}/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2"
rocky9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.rockylinux.org"}/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2"
oraclelinux8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://yum.oracle.com"}/templates/OracleLinux/OL8/u6/x86_64/OL8U6_x86_64-kvm-b126.qcow"
oraclelinux9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://yum.oracle.com"}/templates/OracleLinux/OL9/u0/x86_64/OL9U0_x86_64-kvm-b142.qcow"
amazonlinux2o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cdn.amazonlinux.com"}/os-images/2.0.20210721.2/kvm/amzn2-kvm-2.0.20210721.2-x86_64.xfs.gpt.qcow2"
centos6o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cloud.centos.org"}/centos/6/images/CentOS-6-x86_64-GenericCloud.qcow2"
centos7 = "${var.use_mirror_images ? "http://${var.mirror}" : "https://github.com"}/uyuni-project/sumaform-images/releases/download/4.3.0/centos7.qcow2"
centos7o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cloud.centos.org"}/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
centos8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cloud.centos.org"}/centos/8/x86_64/images/CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2"
centos9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cloud.centos.org"}/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20220829.0.x86_64.qcow2"
amazonlinux2o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://cdn.amazonlinux.com"}/os-images/2.0.20210721.2/kvm/amzn2-kvm-2.0.20210721.2-x86_64.xfs.gpt.qcow2"
libertylinux9o = "${var.use_mirror_images ? "http://${var.mirror}" : "http://zenon.suse.de"}/download/sll9.1-cloud/sll9.1-cloud.img"
oraclelinux8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://yum.oracle.com"}/templates/OracleLinux/OL8/u6/x86_64/OL8U6_x86_64-kvm-b126.qcow"
oraclelinux9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://yum.oracle.com"}/templates/OracleLinux/OL9/u0/x86_64/OL9U0_x86_64-kvm-b142.qcow"
rocky8o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.rockylinux.org"}/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2"
rocky9o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.rockylinux.org"}/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2"
opensuse152o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.opensuse.org"}/distribution/leap/15.2/appliances/openSUSE-Leap-15.2-JeOS.x86_64-OpenStack-Cloud.qcow2"
opensuse153o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.opensuse.org"}/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-OpenStack-Cloud.qcow2"
opensuse154o = "${var.use_mirror_images ? "http://${var.mirror}" : "https://download.opensuse.org"}/distribution/leap/15.4/appliances/openSUSE-Leap-15.4-JeOS.x86_64-OpenStack-Cloud.qcow2"
Expand Down
8 changes: 4 additions & 4 deletions backend_modules/libvirt/host/cpu_features.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<xsl:output omit-xml-declaration="yes" indent="yes"/>

<!-- Features for x86-64 v2 -->
<xsl:template match="/domain/cpu[@mode = 'host-model']">
<xsl:template match="/domain/cpu[@mode = 'host-model' or @mode = 'custom']">
<xsl:element name="cpu">
<xsl:apply-templates select="node()|@*"/>
<xsl:text> </xsl:text>
<xsl:attribute name="mode">host-model</xsl:attribute>
<xsl:text>&#x0A; </xsl:text>
<feature policy='require' name='lahf_lm'/>
<xsl:text>&#x0A; </xsl:text>
<feature policy='require' name='popcnt'/>
Expand All @@ -19,7 +19,7 @@
<feature policy='require' name='sse4.2'/>
<xsl:text>&#x0A; </xsl:text>
<feature policy='require' name='ssse3'/>
<xsl:text>&#x0A; </xsl:text>
<xsl:text>&#x0A; </xsl:text>
</xsl:element>
</xsl:template>

Expand Down
2 changes: 1 addition & 1 deletion backend_modules/libvirt/host/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
resource_name_prefix = "${var.base_configuration["name_prefix"]}${var.name}"
manufacturer = lookup(var.provider_settings, "manufacturer", "Intel")
product = lookup(var.provider_settings, "product", "Genuine")
x86_64_v2_images = ["almalinux9o", "rocky9o", "oraclelinux9o", "centos9o"]
x86_64_v2_images = ["almalinux9o", "libertylinux9o", "oraclelinux9o", "rocky9o"]
provider_settings = merge({
memory = 1024
vcpu = 1
Expand Down
46 changes: 42 additions & 4 deletions backend_modules/libvirt/host/user_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ yum_repos:
priority: 98
# repo for nss-mdns
epel:
baseurl: http://download.fedoraproject.org/pub/epel/8/$basearch
baseurl: http://download.fedoraproject.org/pub/epel/8/Everything/$basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch
failovermethod: priority
enabled: true
Expand Down Expand Up @@ -601,7 +601,7 @@ yum_repos:
priority: 98
# repo for nss-mdns
epel:
baseurl: http://download.fedoraproject.org/pub/epel/9/$basearch
baseurl: http://download.fedoraproject.org/pub/epel/9/Everything/$basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=$basearch
failovermethod: priority
enabled: true
Expand All @@ -622,6 +622,44 @@ packages: ["avahi", "nss-mdns", "qemu-guest-agent", "salt-minion", "dbus-tools"]

%{ endif }

%{ if image == "libertylinux9o" }
yum_repos:
# repo for salt
tools_pool_repo:
baseurl: http://${ use_mirror_images ? mirror : "download.opensuse.org"}/repositories/systemsmanagement:/Uyuni:/Master:/EL9-Uyuni-Client-Tools/EL_9/
failovermethod: priority
enabled: true
gpgcheck: false
name: tools_pool_repo
priority: 98
# repo for nss-mdns
epel:
baseurl: http://download.fedoraproject.org/pub/epel/9/Everything/$basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=$basearch
failovermethod: priority
enabled: true
gpgcheck: false
priority: 99
name: epel

runcmd:
# Registration with SUSEConnect
- curl http://rmt.scc.suse.de/tools/rmt-client-setup-res --output rmt-client-setup-res
- yes | sh rmt-client-setup-res https://rmt.scc.suse.de
# Packages installation after registration
- dnf config-manager --set-enabled epel
%{ if install_salt_bundle }
- dnf -y install venv-salt-minion salt-minion avahi nss-mdns
%{ else }
- dnf -y install avahi nss-mdns salt-minion
%{ endif }
# WORKAROUND: cloud-init in Liberty 9 does not take care of the following
- dnf -y install dbus-tools
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
- systemctl restart sshd

%{ endif }

%{ if image == "rocky8o" }
yum_repos:
# repo for salt
Expand Down Expand Up @@ -689,7 +727,7 @@ yum_repos:
priority: 98
# repo for nss-mdns
epel:
baseurl: http://download.fedoraproject.org/pub/epel/8/$basearch
baseurl: http://download.fedoraproject.org/pub/epel/8/Everything/$basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch
enabled: true
gpgcheck: false
Expand All @@ -715,7 +753,7 @@ yum_repos:
priority: 98
# repo for nss-mdns
epel:
baseurl: http://download.fedoraproject.org/pub/epel/9/$basearch
baseurl: http://download.fedoraproject.org/pub/epel/9/Everything/$basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=$basearch
enabled: true
gpgcheck: false
Expand Down
2 changes: 1 addition & 1 deletion backend_modules/null/base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ variable "provider_settings" {

variable "images" {
description = "list of images to be uploaded to the libvirt host, leave default for all"
default = [ "almalinux8o", "amazonlinux2o", "centos7o", "opensuse153o", "opensuse154o", "rocky8o", "rocky9o", "sles12sp4o", "sles12sp5o", "sles15sp3o", "sles15sp4o", "ubuntu1804o", "ubuntu2004o", "ubuntu2204o" ]
default = [ "almalinux9o", "amazonlinux2o", "centos7o", "centos8o", "libertylinux9o", "opensuse153o", "opensuse154o", "oraclelinux9o", "rocky8o", "rocky9o", "sles12sp4o", "sles12sp5o", "sles15sp3o", "sles15sp4o", "ubuntu1804o", "ubuntu2004o", "ubuntu2204o" ]
type = set(string)
}

Expand Down
14 changes: 8 additions & 6 deletions main.tf.libvirt-testsuite.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ module "cucumber_testsuite" {
# define what images should be used and uploaded
# https://github.com/uyuni-project/sumaform/blob/master/backend_modules/libvirt/README.md#only-upload-a-subset-of-available-images
# the following images are e.g. available:
# "almalinux8o", "almalinux9o",
# "amazonlinux2o",
# "centos6o", "centos7o",
# "libertylinux9o",
# "opensuse152o", "opensuse154o",
# "sles12sp5o", "sles15sp3o", "sles15sp4o",
# "ubuntu1804o", "ubuntu2004o", "ubuntu2204o",
# "centos7o", "centos8o",
# "oraclelinux9o",
# "rocky8o", "rocky9o",
# "almalinux8o",
# "amazonlinux2o"
# "sles12sp4o", "sles12sp5o", "sles15o", "sles15sp1o", "sles15sp2o", "sles15sp3o", "sles15sp4o",
# "ubuntu1604o", "ubuntu1804o", "ubuntu2004o", "ubuntu2204o"
# to see what VM uses what image, have a look at the image variable in the cucumber_module definition
# https://github.com/uyuni-project/sumaform/blob/master/modules/cucumber_testsuite/main.tf
# images = ["rocky8o", "opensuse152o", "opensuse154o", "sles15sp4o", "ubuntu2004o"]
# images = ["rocky9o", "opensuse152o", "opensuse154o", "sles15sp4o", "ubuntu2204o"]

use_avahi = true
name_prefix = "prefix-"
Expand Down
10 changes: 6 additions & 4 deletions modules/controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ module "controller" {
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
rocky8_minion = length(var.rocky8_minion_configuration["hostnames"]) > 0 ? var.rocky8_minion_configuration["hostnames"][0] : null
rocky8_sshminion = length(var.rocky8_sshminion_configuration["hostnames"]) > 0 ? var.rocky8_sshminion_configuration["hostnames"][0] : null
rocky9_minion = length(var.rocky9_minion_configuration["hostnames"]) > 0 ? var.rocky9_minion_configuration["hostnames"][0] : null
rocky9_sshminion = length(var.rocky9_sshminion_configuration["hostnames"]) > 0 ? var.rocky9_sshminion_configuration["hostnames"][0] : null
alma9_minion = length(var.alma9_minion_configuration["hostnames"]) > 0 ? var.alma9_minion_configuration["hostnames"][0] : null
alma9_sshminion = length(var.alma9_sshminion_configuration["hostnames"]) > 0 ? var.alma9_sshminion_configuration["hostnames"][0] : null
liberty9_minion = length(var.liberty9_minion_configuration["hostnames"]) > 0 ? var.liberty9_minion_configuration["hostnames"][0] : null
liberty9_sshminion = length(var.liberty9_sshminion_configuration["hostnames"]) > 0 ? var.liberty9_sshminion_configuration["hostnames"][0] : null
oracle9_minion = length(var.oracle9_minion_configuration["hostnames"]) > 0 ? var.oracle9_minion_configuration["hostnames"][0] : null
oracle9_sshminion = length(var.oracle9_sshminion_configuration["hostnames"]) > 0 ? var.oracle9_sshminion_configuration["hostnames"][0] : null
rhel9_minion = length(var.rhel9_minion_configuration["hostnames"]) > 0 ? var.rhel9_minion_configuration["hostnames"][0] : null
rhel9_sshminion = length(var.rhel9_sshminion_configuration["hostnames"]) > 0 ? var.rhel9_sshminion_configuration["hostnames"][0] : null
rocky8_minion = length(var.rocky8_minion_configuration["hostnames"]) > 0 ? var.rocky8_minion_configuration["hostnames"][0] : null
rocky8_sshminion = length(var.rocky8_sshminion_configuration["hostnames"]) > 0 ? var.rocky8_sshminion_configuration["hostnames"][0] : null
rocky9_minion = length(var.rocky9_minion_configuration["hostnames"]) > 0 ? var.rocky9_minion_configuration["hostnames"][0] : null
rocky9_sshminion = length(var.rocky9_sshminion_configuration["hostnames"]) > 0 ? var.rocky9_sshminion_configuration["hostnames"][0] : null
ubuntu1604_minion = length(var.ubuntu1604_minion_configuration["hostnames"]) > 0 ? var.ubuntu1604_minion_configuration["hostnames"][0] : null
ubuntu1604_sshminion = length(var.ubuntu1604_sshminion_configuration["hostnames"]) > 0 ? var.ubuntu1604_sshminion_configuration["hostnames"][0] : null
ubuntu1804_minion = length(var.ubuntu1804_minion_configuration["hostnames"]) > 0 ? var.ubuntu1804_minion_configuration["hostnames"][0] : null
Expand Down
14 changes: 14 additions & 0 deletions modules/controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,20 @@ variable "centos7_client_configuration" {
}
}

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

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

variable "rocky8_minion_configuration" {
description = "use module.<ROCKY8_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
Expand Down
14 changes: 8 additions & 6 deletions salt/controller/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,24 @@ export {{ hostname }}="{{ name }}.{{ grains.get('domain') }}"
{% if grains.get('slemicro53_minion') | default(false, true) %}export SLEMICRO53_MINION="{{ grains.get('slemicro53_minion') }}" {% else %}# no SLEMICRO53 minion defined {% endif %}
{% if grains.get('slemicro53_sshminion') | default(false, true) %}export SLEMICRO53_SSHMINION="{{ grains.get('slemicro53_sshminion') }}" {% else %}# no SLEMICRO53 ssh minion defined {% endif %}
{% if grains.get('sle15sp4_client') | default(false, true) %}export SLE15SP4_CLIENT="{{ grains.get('sle15sp4_client') }}" {% else %}# no SLE15SP4 client defined {% endif %}
{% if grains.get('alma9_minion') | default(false, true) %}export ALMA9_MINION="{{ grains.get('alma9_minion') }}" {% else %}# no ALMA9 minion defined {% endif %}
{% if grains.get('alma9_sshminion') | default(false, true) %}export ALMA9_SSHMINION="{{ grains.get('alma9_sshminion') }}" {% else %}# no ALMA9 ssh minion defined {% endif %}
{% if grains.get('centos6_minion') | default(false, true) %}export CENTOS6_MINION="{{ grains.get('centos6_minion') }}" {% else %}# no CENTOS6 minion defined {% endif %}
{% if grains.get('centos6_sshminion') | default(false, true) %}export CENTOS6_SSHMINION="{{ grains.get('centos6_sshminion') }}" {% else %}# no CENTOS6 ssh minion defined {% endif %}
{% if grains.get('centos6_client') | default(false, true) %}export CENTOS6_CLIENT="{{ grains.get('centos6_client') }}" {% else %}# no CENTOS6 client defined {% endif %}
{% if grains.get('centos7_minion') | default(false, true) %}export CENTOS7_MINION="{{ grains.get('centos7_minion') }}" {% else %}# no CENTOS7 minion defined {% endif %}
{% if grains.get('centos7_sshminion') | default(false, true) %}export CENTOS7_SSHMINION="{{ grains.get('centos7_sshminion') }}" {% else %}# no CENTOS7 ssh minion defined {% endif %}
{% if grains.get('centos7_client') | default(false, true) %}export CENTOS7_CLIENT="{{ grains.get('centos7_client') }}" {% else %}# no CENTOS7 client defined {% endif %}
{% if grains.get('liberty9_minion') | default(false, true) %}export LIBERTY9_MINION="{{ grains.get('liberty9_minion') }}" {% else %}# no LIBERTY9 minion defined {% endif %}
{% if grains.get('liberty9_sshminion') | default(false, true) %}export LIBERTY9_SSHMINION="{{ grains.get('liberty9_sshminion') }}" {% else %}# no LIBERTY9 ssh minion defined {% endif %}
{% if grains.get('oracle9_minion') | default(false, true) %}export ORACLE9_MINION="{{ grains.get('oracle9_minion') }}" {% else %}# no ORACLE9 minion defined {% endif %}
{% if grains.get('oracle9_sshminion') | default(false, true) %}export ORACLE9_SSHMINION="{{ grains.get('oracle9_sshminion') }}" {% else %}# no ORACLE9 ssh minion defined {% endif %}
{% if grains.get('rhel9_minion') | default(false, true) %}export RHEL9_MINION="{{ grains.get('rhel9_minion') }}" {% else %}# no RHEL9 minion defined {% endif %}
{% if grains.get('rhel9_sshminion') | default(false, true) %}export RHEL9_SSHMINION="{{ grains.get('rhel9_sshminion') }}" {% else %}# no RHEL9 ssh minion defined {% endif %}
{% if grains.get('rocky8_minion') | default(false, true) %}export ROCKY8_MINION="{{ grains.get('rocky8_minion') }}" {% else %}# no ROCKY8 minion defined {% endif %}
{% if grains.get('rocky8_sshminion') | default(false, true) %}export ROCKY8_SSHMINION="{{ grains.get('rocky8_sshminion') }}" {% else %}# no ROCKY8 ssh minion defined {% endif %}
{% if grains.get('rocky9_minion') | default(false, true) %}export ROCKY9_MINION="{{ grains.get('rocky9_minion') }}" {% else %}# no ROCKY9 minion defined {% endif %}
{% if grains.get('rocky9_sshminion') | default(false, true) %}export ROCKY9_SSHMINION="{{ grains.get('rocky9_sshminion') }}" {% else %}# no ROCKY9 ssh minion defined {% endif %}
{% if grains.get('rhel9_minion') | default(false, true) %}export RHEL9_MINION="{{ grains.get('rhel9_minion') }}" {% else %}# no RHEL9 minion defined {% endif %}
{% if grains.get('rhel9_sshminion') | default(false, true) %}export RHEL9_SSHMINION="{{ grains.get('rhel9_sshminion') }}" {% else %}# no RHEL9 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 %}
{% if grains.get('alma9_sshminion') | default(false, true) %}export ALMA9_SSHMINION="{{ grains.get('alma9_sshminion') }}" {% else %}# no ALMA9 ssh minion defined {% endif %}
{% if grains.get('oracle9_minion') | default(false, true) %}export ORACLE9_MINION="{{ grains.get('oracle9_minion') }}" {% else %}# no ORACLE9 minion defined {% endif %}
{% if grains.get('oracle9_sshminion') | default(false, true) %}export ORACLE9_SSHMINION="{{ grains.get('oracle9_sshminion') }}" {% else %}# no ORACLE9 ssh minion defined {% endif %}
{% if grains.get('ubuntu1604_minion') | default(false, true) %}export UBUNTU1604_MINION="{{ grains.get('ubuntu1604_minion') }}" {% else %}# no UBUNTU1604 minion defined {% endif %}
{% if grains.get('ubuntu1604_sshminion') | default(false, true) %}export UBUNTU1604_SSHMINION="{{ grains.get('ubuntu1604_sshminion') }}" {% else %}# no UBUNTU1604 ssh minion defined {% endif %}
{% if grains.get('ubuntu1804_minion') | default(false, true) %}export UBUNTU1804_MINION="{{ grains.get('ubuntu1804_minion') }}" {% else %}# no UBUNTU1804 minion defined {% endif %}
Expand Down
Loading