From 9e6078c20f9027290102559e890ea5c2e493854b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 3 May 2012 22:57:21 +0000 Subject: [PATCH] Set hb_device in config.yml on PRO systems during deployment By default we use eth1 for the crosslink / interconnect device, but there are VMs which use eth0 - so support this in the deployment process so we get a happy heartbeat service... From: Michael Prokop --- deployment.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/deployment.sh b/deployment.sh index b9d81a3..fa33726 100755 --- a/deployment.sh +++ b/deployment.sh @@ -1169,6 +1169,38 @@ for i in asterisk atd collectd collectdmon dbus-daemon exim4 \ killall -9 $i >/dev/null 2>&1 || true done +adjust_hb_device() { + local hb_device + + if [ -n "$INTERNAL_DEV" ] ; then + export hb_device="$INTERNAL_DEV" + else + export hb_device="eth1" # default + fi + + echo "Setting hb_device to ${hb_device}." + + chroot $TARGET perl <<"EOF" +use strict; +use warnings; +use YAML::Tiny; +use Env qw(hb_device); + +my $yaml = YAML::Tiny->new; +my $inputfile = '/etc/ngcp-config/config.yml'; +my $outputfile = '/etc/ngcp-config/config.yml'; + +$yaml = YAML::Tiny->read($inputfile); +$yaml->[0]->{networking}->{hb_device} = "$hb_device"; +$yaml->write($outputfile); +EOF +} + +if "$PRO_EDITION" ; then + echo "Deploying PRO edition - adjusting heartbeat device (hb_device)." + adjust_hb_device +fi + upload_db_dump() { if "$CE_EDITION" ; then echo "CE edition noticed, continuing..."