From b210f910b8002498852adc7be61ac38fe938d6e9 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Wed, 17 Jun 2026 12:38:02 -0400 Subject: [PATCH] Updated the RHEL setup to automate partition resizing and Puppet install --- http/almalinux-server.ks | 4 ++-- http/rocky-server.ks | 4 ++-- scripts/initial-setup.sh | 17 ++++++++++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/http/almalinux-server.ks b/http/almalinux-server.ks index fa11dce..b74ce51 100644 --- a/http/almalinux-server.ks +++ b/http/almalinux-server.ks @@ -49,10 +49,10 @@ sudo %post # Update the system dnf -y update -# Istall the EPEL repository +# Install the EPEL repository dnf -y install epel-release -dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent +dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent cloud-utils-growpart echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin diff --git a/http/rocky-server.ks b/http/rocky-server.ks index 837a7a6..814ecc5 100644 --- a/http/rocky-server.ks +++ b/http/rocky-server.ks @@ -49,10 +49,10 @@ sudo %post # Update the system dnf -y update -# Istall the EPEL repository +# Install the EPEL repository dnf -y install epel-release -dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent +dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent cloud-utils-growpart echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin diff --git a/scripts/initial-setup.sh b/scripts/initial-setup.sh index dc4ca9f..df6b516 100644 --- a/scripts/initial-setup.sh +++ b/scripts/initial-setup.sh @@ -1,10 +1,11 @@ #!/bin/bash -PUPPET_MASTER='puppet-v1.int.metaunix.net' +PUPPET_MASTER='puppet-v2.int.metaunix.net' # determine OS version if [ -f '/etc/redhat-release' ]; then OS="rhel" + OSVERSION=$(sed -rn 's/.*release ([0-9]+).*/\1/p' /etc/redhat-release) elif [ -f '/etc/debian_version' ]; then OS="debian" elif [ -d '/etc/ubuntu-advantage' ]; then @@ -27,9 +28,19 @@ if [ "$OS" = 'freebsd' ]; then zpool online -e zroot da0p3 # make ZFS resize the volume to match # Install Puppet - echo -e "[agent]\nserver = $PUPPET_MASTER" > /usr/local/etc/puppet/puppet.conf + echo -e "[agent]\nserver = $PUPPET_MASTER\nruninterval = 6h\n" > /usr/local/etc/puppet/puppet.conf sysrc puppet_enable="YES" else # Configure system hostname - hostnamectl set-hostname "$HOSTNAME" + hostnamectl set-hostname "$HOSTNAME.$DOMAIN" + + # Grow the partition and filesystem + growpart /dev/sda 4 + xfs_growfs / + + # Install and configure Puppet (OpenVox) + rpm -Uvh "https://yum.voxpupuli.org/openvox8-release-el-$OSVERSION.noarch.rpm" + dnf install -y openvox-agent + echo -e "[agent]\nserver = $PUPPET_MASTER\nruninterval = 6h\n" > /etc/puppetlabs/puppet/puppet.conf + systemctl restart puppet fi