Fixed hostname setting and salt config in initial-setup script
This commit is contained in:
parent
060c35058d
commit
d8fea80ded
@ -17,17 +17,28 @@ read -p 'System hostname: ' HOSTNAME
|
|||||||
read -p 'System domain: ' DOMAIN
|
read -p 'System domain: ' DOMAIN
|
||||||
|
|
||||||
if [ "$OS" = 'freebsd' ]; then
|
if [ "$OS" = 'freebsd' ]; then
|
||||||
echo "$HOSTNAME.$DOMAIN" > /usr/local/etc/salt/minion_id
|
# 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
|
sed -i .orig "s/\#master: salt/master: $SALT_MASTER/" /usr/local/etc/salt/minion
|
||||||
rm -rf /usr/local/etc/salt/pki
|
rm -rf /usr/local/etc/salt/pki
|
||||||
|
|
||||||
|
# Enable and start salt
|
||||||
sysrc salt_minion_enable="YES"
|
sysrc salt_minion_enable="YES"
|
||||||
service salt_minion start
|
service salt_minion start
|
||||||
else
|
else
|
||||||
echo "$HOSTNAME.$DOMAIN" > /etc/salt/minion_id
|
# Configure system hostname
|
||||||
sed -i "s/\#master: salt/master: $SALT_MASTER/" /etc/salt/minion
|
hostnamectl set-hostname "$HOSTNAME"
|
||||||
rm -rf /etc/salt/pki
|
|
||||||
|
|
||||||
systemctl enable salt-minion
|
# 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 start salt-minion
|
||||||
|
systemctl enable salt-minion
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user