Skip to content

Commit

Permalink
Add template
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 1d24a93 commit d7c89c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
41 changes: 26 additions & 15 deletions backend_modules/libvirt/host/combustion
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }
Expand All @@ -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)
Expand All @@ -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" }
Expand Down Expand Up @@ -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;
exec 1>&- 2>&-; wait;
2 changes: 1 addition & 1 deletion salt/minion/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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'] %}
Expand Down

0 comments on commit d7c89c2

Please sign in to comment.