From d7c89c20e12f8d17def28ac09d8b1ebdc4b2b544 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Wed, 11 Sep 2024 17:52:58 +0200 Subject: [PATCH] Add template Signed-off-by: Dominik Gedon --- backend_modules/libvirt/host/combustion | 41 ++++++++++++++++--------- salt/minion/init.sls | 2 +- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/backend_modules/libvirt/host/combustion b/backend_modules/libvirt/host/combustion index 401ef290a..edef2dee5 100644 --- a/backend_modules/libvirt/host/combustion +++ b/backend_modules/libvirt/host/combustion @@ -1,7 +1,9 @@ #!/bin/bash -# combustion: network prepare +# see https://github.com/openSUSE/combustion#simple-example +# combustion: network %{ if image == "leapmicro55o" } +# combustion: network prepare set -euxo pipefail function nm_config() { @@ -30,21 +32,20 @@ if [ "$${1-}" = "--prepare" ]; then nm_config 2 eth1 manual exit 0 fi -%{ endif } -# 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 } +%{ 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 +# SL Micro 6: 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 @@ -56,9 +57,17 @@ systemctl enable sshd.service # Add the GPG keys ${ gpg_keys } -# Add repositories +#### Add repositories #### zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repositories/SUSE:/CA/15.5/ ca_suse + +%{ if image == "slemicro51" } +%{ endif } # slemicro51 +%{ if image == "slemicro52" } +%{ endif } # slemicro52 +%{ if image == "slemicro53" } +%{ endif } # slemicro53 + %{ 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 @@ -67,8 +76,8 @@ zypper ar http://${ use_mirror_images ? mirror : "download.suse.de/ibs"}/SUSE/Pr 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 } # slemicro54 -%{ 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 @@ -81,9 +90,9 @@ zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repos %{ 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 @@ -92,13 +101,14 @@ zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/updat %{ 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 of image == "leapmicro55o" block +%{ endif } # end leapmicro55o + %{ if image == "slmicro60o" } 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 } @@ -110,6 +120,7 @@ zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repos %{ endif } %{ endif } # end of image == "slmicro60o" block +## add additional repos for i in ${additional_repos}; do name=$(echo $i | cut -d= -f1) url=$(echo $i | cut -d= -f2) @@ -120,7 +131,7 @@ for i in ${additional_repos}; do %{ endif } done -# Install packages +#### Install packages #### PACKAGES="qemu-guest-agent avahi ca-certificates" %{ if container_runtime == "podman" } @@ -162,4 +173,4 @@ zypper --non-interactive install $PACKAGES echo "Configured with combustion" > /etc/issue.d/combustion # Close outputs and wait for tee to finish. -exec 1>&- 2>&-; wait; \ No newline at end of file +exec 1>&- 2>&-; wait; diff --git a/salt/minion/init.sls b/salt/minion/init.sls index eca1799a6..dea24ae26 100644 --- a/salt/minion/init.sls +++ b/salt/minion/init.sls @@ -7,7 +7,7 @@ include: - minion.reflector {% if not grains['osfullname'] in ['SLE Micro', 'SL-Micro'] %} -# Dependencies already satisfied by cloud-init/combustion for SLEM 5.5 and Leap Micro 5.5 +# Dependencies already satisfied by cloud-init/combustion minion_package: pkg.installed: {% if grains['install_salt_bundle'] %}