Skip to content

Commit

Permalink
Add SLE Micros to Combustion to have Salt Bundle
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Gedon <[email protected]>
  • Loading branch information
nodeg committed Sep 11, 2024
1 parent 9fec5ca commit 1d24a93
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
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
21 changes: 20 additions & 1 deletion backend_modules/libvirt/host/combustion
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
# combustion: network prepare

%{ if image == "leapmicro55o" }
set -euxo pipefail

function nm_config() {
Expand Down Expand Up @@ -28,13 +30,16 @@ if [ "$${1-}" = "--prepare" ]; then
nm_config 2 eth1 manual
exit 0
fi
%{ endif }

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

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

# Set linux as password for root
echo 'root:$6$3aQC9rrDLHiTf1yR$NoKe9tko0kFIpu0rQ2y/OzOOtbVvs0Amr2bx0T4cGf6aq8PG74EmVy8lSDJdbLVVFpOSzwELWyReRCiPHa7DG0' | chpasswd -e
Expand All @@ -54,6 +59,17 @@ ${ gpg_keys }
# Add repositories
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/15.5/ ca_suse

%{ if image == "slemicro54" }
%{ if testsuite }
zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs"}/SUSE/Products/SLE-Module-Basesystem/15-SP4/x86_64/product os_pool_repo
%{ endif }

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
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 } # end of image == "slemicro54-ign" block

%{ 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

Expand Down Expand Up @@ -144,3 +160,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 for SLEM 5.5 and Leap Micro 5.5
minion_package:
pkg.installed:
{% if grains['install_salt_bundle'] %}
Expand Down

0 comments on commit 1d24a93

Please sign in to comment.