diff --git a/backend_modules/libvirt/base/main.tf b/backend_modules/libvirt/base/main.tf index dd9adec1b..01a7c4154 100644 --- a/backend_modules/libvirt/base/main.tf +++ b/backend_modules/libvirt/base/main.tf @@ -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" diff --git a/backend_modules/libvirt/host/combustion b/backend_modules/libvirt/host/combustion index bdd73b062..330ecd8d6 100644 --- a/backend_modules/libvirt/host/combustion +++ b/backend_modules/libvirt/host/combustion @@ -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 @@ -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 } @@ -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) @@ -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" } @@ -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; diff --git a/backend_modules/libvirt/host/main.tf b/backend_modules/libvirt/host/main.tf index fa3ecdf0a..e022f279d 100644 --- a/backend_modules/libvirt/host/main.tf +++ b/backend_modules/libvirt/host/main.tf @@ -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}" diff --git a/salt/minion/init.sls b/salt/minion/init.sls index 9da7a0075..dea24ae26 100644 --- a/salt/minion/init.sls +++ b/salt/minion/init.sls @@ -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'] %}