Updated the RHEL setup to automate partition resizing and Puppet install

This commit is contained in:
Gregory Ballantine
2026-06-17 12:38:02 -04:00
parent cc5e690fef
commit b210f910b8
3 changed files with 18 additions and 7 deletions

View File

@@ -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