Updated post-install script without salt
This commit is contained in:
parent
5a27129508
commit
18e0214a21
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SALT_MASTER='salt-v1.int.metaunix.net'
|
PUPPET_MASTER='puppet-v1.int.metaunix.net'
|
||||||
|
|
||||||
# determine OS version
|
# determine OS version
|
||||||
if [ -f '/etc/redhat-release' ]; then
|
if [ -f '/etc/redhat-release' ]; then
|
||||||
@ -20,25 +20,11 @@ if [ "$OS" = 'freebsd' ]; then
|
|||||||
# Configure system hostname
|
# Configure system hostname
|
||||||
sysrc hostname="$HOSTNAME.$DOMAIN"
|
sysrc hostname="$HOSTNAME.$DOMAIN"
|
||||||
|
|
||||||
# Configure salt
|
# Install Puppet
|
||||||
echo "$HOSTNAME" > /usr/local/etc/salt/minion_id
|
pkg install -y puppet7
|
||||||
sed -i .orig "s/\#master: salt/master: $SALT_MASTER/" /usr/local/etc/salt/minion
|
echo -e "[agent]\nserver = $PUPPET_MASTER" > /usr/local/etc/puppet/puppet.conf
|
||||||
rm -rf /usr/local/etc/salt/pki
|
sysrc puppet_enable="YES"
|
||||||
|
|
||||||
# Enable and start salt
|
|
||||||
sysrc salt_minion_enable="YES"
|
|
||||||
service salt_minion start
|
|
||||||
else
|
else
|
||||||
# Configure system hostname
|
# Configure system hostname
|
||||||
hostnamectl set-hostname "$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
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user