Updated post-install script without salt

This commit is contained in:
Gregory Ballantine 2024-04-24 23:12:59 -04:00
parent 5a27129508
commit 18e0214a21

View File

@ -1,6 +1,6 @@
#!/bin/bash
SALT_MASTER='salt-v1.int.metaunix.net'
PUPPET_MASTER='puppet-v1.int.metaunix.net'
# determine OS version
if [ -f '/etc/redhat-release' ]; then
@ -20,25 +20,11 @@ if [ "$OS" = 'freebsd' ]; then
# Configure system hostname
sysrc hostname="$HOSTNAME.$DOMAIN"
# Configure salt
echo "$HOSTNAME" > /usr/local/etc/salt/minion_id
sed -i .orig "s/\#master: salt/master: $SALT_MASTER/" /usr/local/etc/salt/minion
rm -rf /usr/local/etc/salt/pki
# Enable and start salt
sysrc salt_minion_enable="YES"
service salt_minion start
# Install Puppet
pkg install -y puppet7
echo -e "[agent]\nserver = $PUPPET_MASTER" > /usr/local/etc/puppet/puppet.conf
sysrc puppet_enable="YES"
else
# Configure system hostname
hostnamectl set-hostname "$HOSTNAME"
# Configure salt
echo "$HOSTNAME" > /etc/salt/minion_id
sed -i "s/\#master: salt/master: $SALT_MASTER/" /etc/salt/minion
# Enable and start salt
systemctl stop salt-minion
rm -rf /etc/salt/pki
systemctl start salt-minion
systemctl enable salt-minion
fi