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 SLE Micros to Combustion #1687

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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 backend_modules/libvirt/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ locals {
slemicro52-ign = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_52/SUSE-MicroOS.x86_64-sumaform.qcow2"
slemicro53-ign = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_53/SLE-Micro.x86_64-sumaform.qcow2"
slemicro54-ign = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_54/SLE-Micro.x86_64-sumaform.qcow2"
slemicro54 = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_54/SLE-Micro.x86_64-sumaform.qcow2"
slemicro55o = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_55/SLE-Micro.x86_64-sumaform.qcow2"
slmicro60o = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.opensuse.org"}/repositories/systemsmanagement:/sumaform:/images:/microos/images_60/SL-Micro.x86_64-sumaform.qcow2"
suma43VM-ign = "${var.use_mirror_images ? "http://${var.mirror}" : "http://download.suse.de"}/ibs/Devel:/Galaxy:/Manager:/4.3/images/SUSE-Manager-Server.x86_64-KVM-x86_64.qcow2"
Expand Down
120 changes: 94 additions & 26 deletions backend_modules/libvirt/host/combustion
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
# see https://github.com/openSUSE/combustion#simple-example
# combustion: network

%{ if image == "leapmicro55o" }
# combustion: network prepare
set -euxo pipefail

Expand Down Expand Up @@ -29,60 +33,91 @@ if [ "$${1-}" = "--prepare" ]; then
exit 0
fi

# Redirect output to the console
exec > >(exec tee -a /var/log/combustion) 2>&1

# Name the Network Manager connections (final phase on real filesystem)
nm_config 1 eth0 auto
nm_config 2 eth1 manual
%{ endif } # leapmicro55o


# Redirect output to log file
exec > >(exec tee -a /var/log/combustion) 2>&1

# Set linux as password for root
echo 'root:$6$3aQC9rrDLHiTf1yR$NoKe9tko0kFIpu0rQ2y/OzOOtbVvs0Amr2bx0T4cGf6aq8PG74EmVy8lSDJdbLVVFpOSzwELWyReRCiPHa7DG0' | chpasswd -e

# SL Micro6: Add PermitRootLogin to sshd config
%{ if image == "slmicro60o" }
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/root.conf
echo "ChallengeResponseAuthentication yes" >> /etc/ssh/sshd_config.d/root.conf
%{ endif }

# Add a public ssh key and enable sshd
systemctl enable sshd.service

# Add the GPG keys
${ gpg_keys }

# Add repositories
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/15.5/ ca_suse

%{ if image == "leapmicro55o" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/openSUSE_Leap_15-Uyuni-Client-Tools/openSUSE_Leap_15.0/ client_tools_repo
### SLE Micro ###
%{ if image == "slemicro51" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP1/ ca_suse
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Products/SUSE-MicroOS/5.1/x86_64/product/ micro_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Updates/SUSE-MicroOS/5.1/x86_64/update/ micro_update_repo

%{ if container_server || container_proxy }
%{ if product_version == "uyuni-master" || product_version == "uyuni-pr" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/ContainerUtils/openSUSE_Leap_Micro_5.5/ container_utils
%{ else }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Stable:/ContainerUtils/openSUSE_Leap_Micro_5.5/ container_utils
%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
%{ endif }
%{ endif } # slemicro51


%{ if image == "slemicro52" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP2/ ca_suse
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Products/SUSE-MicroOS/5.2/x86_64/product/ micro_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Updates/SUSE-MicroOS/5.2/x86_64/update/ micro_update_repo

%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
%{ endif }
%{ endif } # slemicro52


%{ if image == "slemicro53" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP3/ ca_suse
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Products/SLE-Micro/5.3/x86_64/product/ micro_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Updates/SLE-Micro/5.3/x86_64/update/ micro_update_repo

%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
%{ endif }
%{ endif } # slemicro53

# Leap repos are required to install expect
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/distribution/leap/15.5/repo/oss/ leap_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/update/leap/15.5/oss/ leap_update_repo

%{ if image == "slemicro54" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP4/ ca_suse
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Products/SLE-Micro/5.4/x86_64/product/ micro_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs" }/SUSE/Updates/SLE-Micro/5.4/x86_64/update/ micro_update_repo

%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
%{ endif }
%{ endif } # slemicro54

%{ if container_runtime == "k3s" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/update/leap/15.5/sle/ sle_update_repo

# TODO
#%{ if image == "slemicro55" }
#%{ endif } # slemicro55


# shared SLE Micro 5.x client tools
%{ if image == "slemicro55" || image == "slemicro54" || image == "slemicro53" || image == "slemicro52" || image == "slemicro51" }
zypper ar 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/ tools_pool_repo
%{ endif }
%{ endif } # end of image == "leapmicro55o" block


%{ if image == "slmicro60o" }
# SL Micro 6.x does not allow this anymore
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/root.conf
echo "ChallengeResponseAuthentication yes" >> /etc/ssh/sshd_config.d/root.conf

zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/SLE_15_SP6/ ca_suse
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs"}/SUSE/Products/SL-Micro/6.0/x86_64/product/ os_pool_repo

# SL Micro 6.0 is being used in both Uyuni and SUSE Manager
# we do not support yet Leap Micro 6.0, even in Uyuni
# we do not support Leap Micro 6.0, yet, even in Uyuni
%{ if product_version == "uyuni-master" || product_version == "uyuni-released" || product_version == "uyuni-pr" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org"}/repositories/systemsmanagement:/Uyuni:/Master:/SLMicro6-Uyuni-Client-Tools/SL-Micro6/ client_tools_repo
%{ else }
Expand All @@ -94,6 +129,36 @@ zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repos
%{ endif }
%{ endif } # end of image == "slmicro60o" block



### openSUSE Leap Micro ###
%{ if image == "leapmicro55o" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/openSUSE_Leap_15-Uyuni-Client-Tools/openSUSE_Leap_15.0/ client_tools_repo
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/15.5/ ca_suse

%{ if container_server || container_proxy }
%{ if product_version == "uyuni-master" || product_version == "uyuni-pr" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Master:/ContainerUtils/openSUSE_Leap_Micro_5.5/ container_utils
%{ else }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Stable:/ContainerUtils/openSUSE_Leap_Micro_5.5/ container_utils
%{ endif }
%{ endif }


%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
# Leap repos are required to install expect
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/distribution/leap/15.5/repo/oss/ leap_pool_repo
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/update/leap/15.5/oss/ leap_update_repo
%{ endif }

%{ if container_runtime == "k3s" }
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/update/leap/15.5/sle/ sle_update_repo
%{ endif }
%{ endif } # end leapmicro55o


## additional repositories from the terraform file
for i in ${additional_repos}; do
name=$(echo $i | cut -d= -f1)
url=$(echo $i | cut -d= -f2)
Expand All @@ -104,7 +169,7 @@ for i in ${additional_repos}; do
%{ endif }
done

# Install packages
#### Install packages ####
PACKAGES="qemu-guest-agent avahi ca-certificates"

%{ if container_runtime == "podman" }
Expand Down Expand Up @@ -144,3 +209,6 @@ zypper --non-interactive install $PACKAGES

# Leave a marker
echo "Configured with combustion" > /etc/issue.d/combustion

# Close outputs and wait for tee to finish.
exec 1>&- 2>&-; wait;
2 changes: 1 addition & 1 deletion backend_modules/libvirt/host/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
manufacturer = lookup(var.provider_settings, "manufacturer", "Intel")
product = lookup(var.provider_settings, "product", "Genuine")
x86_64_v2_images = ["almalinux9o", "libertylinux9o", "oraclelinux9o", "rocky9o", "slmicro60o"]
combustion_images = ["leapmicro55o", "slmicro60o"]
combustion_images = ["leapmicro55o", "slemicro54", "slmicro60o"]
gpg_keys = [
for key in fileset("salt/default/gpg_keys/", "*.key"): {
path = "/etc/gpg_keys/${key}"
Expand Down
3 changes: 1 addition & 2 deletions salt/minion/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ include:
- minion.reflector

{% if not grains['osfullname'] in ['SLE Micro', 'SL-Micro'] %}
# Dependencies already satisfied by the images
# https://build.opensuse.org/project/show/systemsmanagement:sumaform:images:microos
# Dependencies already satisfied by cloud-init/combustion
minion_package:
pkg.installed:
{% if grains['install_salt_bundle'] %}
Expand Down
Loading