if we're not dealing with a datanode or hypervisor write the TIER_ID down into the environment so it's available next time, also cleanup interfaces and do not restart strongswan just like we don't restart frr to avoid service interruption after an upgrade

This commit is contained in:
root 2018-08-02 15:45:52 +00:00
parent 653d175c30
commit 5280d685c6
2 changed files with 10 additions and 5 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
wit-hypervisor-config (1.0) unstable; urgency=low
wit-hypervisor-config (1.1) unstable; urgency=low
* Initial release.

View File

@ -44,6 +44,7 @@ case "$1" in
[ $HOSTTYPE = datanode -a $DOMAINNAME = .usw1.wit.com ] && export TIER_ID=4
[ $HOSTTYPE = hypervisor -a $DOMAINNAME = .usw2.wit.com ] && export TIER_ID=18
[ $HOSTTYPE = datanode -a $DOMAINNAME = .usw2.wit.com ] && export TIER_ID=20
[ $HOSTTYPE != hypervisor -a $HOSTTYPE != datanode ] && sed -i -e '/TIER_ID/d' -e "$ s/$/\nTIER_ID=$TIER_ID/" /etc/environment
if [ -z "$TIER_ID" ]; then
@ -65,10 +66,14 @@ case "$1" in
## START writing config files
echo "auto lo:0" >/etc/network/interfaces.d/lo
echo "iface lo:0 inet static" >> /etc/network/interfaces.d/lo
sed -i -e '/#*PasswordAuthentication /d' /etc/ssh/sshd_config
echo "PasswordAuthentication no" >>/etc/ssh/sshd_config
echo "iface lo inet static" > /etc/network/interfaces.d/lo
echo " address ${LOOPBACKv4}/32" >> /etc/network/interfaces.d/lo
echo "iface lo:0 inet6 static" >> /etc/network/interfaces.d/lo
echo "" >> /etc/network/interfaces.d/lo
echo "iface lo inet6 static" >> /etc/network/interfaces.d/lo
echo " address ${LOOPBACKv6}/128" >> /etc/network/interfaces.d/lo
@ -109,7 +114,7 @@ case "$1" in
systemctl enable firewall
systemctl restart systemd-timesyncd
systemctl restart strongswan
systemctl restart ssh
update-grub