From 0e0f6b3d0ca750af22d3ebe6ca044dfca2d36437 Mon Sep 17 00:00:00 2001 From: Trond Davidsen Date: Thu, 15 Jan 2026 10:09:41 +0100 Subject: [PATCH] Update the buildscript for the UiB managed image, to take into account different versions of Enterprise Linux. --- scripts/uib-puppet.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/uib-puppet.sh b/scripts/uib-puppet.sh index 20b41f7..0e457be 100755 --- a/scripts/uib-puppet.sh +++ b/scripts/uib-puppet.sh @@ -1,11 +1,20 @@ #!/bin/bash -# Install puppet repo, agent and theforman module -sudo yum install -y redhat-lsb-core.x86_64 -sudo yum install -y https://yum.puppetlabs.com/puppet7-release-el-"$(lsb_release -sr|cut -d'.' -f1)".noarch.rpm -sudo yum install -y puppet-agent -sudo /opt/puppetlabs/bin/puppet module install theforeman/puppet +# Source information about the operating system we are running on +. /etc/os-release + +# Install different versions of puppet repo and agent based on Enterprise Linux version +if [[ `echo $VERSION_ID | /bin/cut -d '.' -f1` -eq 8 ]]; then + sudo yum install -y redhat-lsb-core.x86_64 + sudo yum install -y https://yum.puppetlabs.com/puppet7-release-el-"$(lsb_release -sr|cut -d'.' -f1)".noarch.rpm + sudo yum install -y puppet-agent +elif [[ `echo $VERSION_ID | /bin/cut -d '.' -f1` -eq 10 ]]; then + sudo dnf install -y https://yum.voxpupuli.org/openvox7-release-el-"$(echo $VERSION_ID | cut -d'.' -f1)".noarch.rpm + sudo dnf install -y openvox-agent +fi +# Install theforman module +sudo /opt/puppetlabs/bin/puppet module install theforeman/puppet # Create dir for UiB spesifics sudo mkdir /opt/uib