Commit 438cbf28 authored by Mike Hibler's avatar Mike Hibler

Sort out the elabinelab NTP situation.

Previously, inner servers (ops and fs) would use "boss" as their ntp(date)
server, but boss wasn't running an NTP server. Turns out they were not really
using boss anyway (except for the initial ntpdate call) because they still
had the outer Emulab /etc/ntp.conf file which pointed the servers to
ntp1.emulab.net. That would work fine unless the elabinelab was firewalled.
Inner nodes would use inner ops which would work, but inner ops might be
isolated.

Now by default, inner servers and nodes will use inner boss ("ntp1" is
redefined in DNS to point there instead of ops). The firewall rules let
inner boss talk to "ntp1" on the outside (ops), so this should always work!
parent 595015b9
......@@ -171,6 +171,14 @@ my $NEEDMROUTED= -1;
# Is ops a VM (Jail) on boss.
my $OPSVM = 0;
#
# Node to use as ntp server for inner nodes and other inner servers.
# This node will use the outside "ntp1" server as its server.
#
# XXX this has never been tested with anything but "boss".
#
my $NTPSERVER = "boss";
#
# Defaults for configuration attributes (options).
# These can be overridden if values are passed in via the emulabconfig command.
......@@ -831,12 +839,17 @@ sub SetupFsNode()
print RC "sshd_enable=\"YES\"\n";
print RC "ntpdate_enable=\"YES\"\n";
print RC "ntpdate_flags=\"boss\"\n";
if ($NTPSERVER eq "fs") {
print RC "ntpdate_flags=\"ntp1.${outer_domain}\"\n";
} else {
print RC "ntpdate_flags=\"$NTPSERVER\"\n";
}
if ($FBSD_VERSION >= 5) {
print RC "ntpd_enable=\"YES\"\n";
} else {
print RC "xntpd_enable=\"YES\"\n";
}
print RC "linux_enable=\"YES\"\n";
print RC "rpcbind_enable=\"YES\"\n";
......@@ -883,6 +896,13 @@ sub SetupFsNode()
mysystem("cp -pf /etc/syslog.conf /etc/syslog.conf.old ; ".
"cp /tmp/syslog.conf /etc/syslog.conf");
#
# If not us, fixup our ntp.conf file to talk to the inner ntp server.
#
if ($NTPSERVER ne "fs") {
mysystem("sed -i '.orig' -E -e 's/^server .*/server $NTPSERVER/' /etc/ntp.conf");
}
#
# Create a defs file. Note that this will move to boss at some point.
#
......@@ -1244,12 +1264,17 @@ sub SetupOpsNode($)
print RC "sshd_enable=\"YES\"\n";
print RC "ntpdate_enable=\"YES\"\n";
print RC "ntpdate_flags=\"boss\"\n";
if ($NTPSERVER eq "ops") {
print RC "ntpdate_flags=\"ntp1.${outer_domain}\"\n";
} else {
print RC "ntpdate_flags=\"$NTPSERVER\"\n";
}
if ($FBSD_VERSION >= 5) {
print RC "ntpd_enable=\"YES\"\n";
} else {
print RC "xntpd_enable=\"YES\"\n";
}
print RC "linux_enable=\"YES\"\n";
print RC "accounting_enable=\"YES\"\n";
......@@ -1299,6 +1324,13 @@ sub SetupOpsNode($)
mysystem("cp -pf /etc/syslog.conf /etc/syslog.conf.old ; ".
"cp /tmp/syslog.conf /etc/syslog.conf");
#
# If not us, fixup our ntp.conf file to talk to the inner ntp server.
#
if ($NTPSERVER ne "ops") {
mysystem("sed -i '.orig' -E -e 's/^server .*/server $NTPSERVER/' /etc/ntp.conf");
}
#
# Create a defs file. Note that this will move to boss at some point.
#
......@@ -1758,8 +1790,17 @@ sub SetupBossNode($)
print RC "sshd_enable=\"YES\"\n";
print RC "ntpdate_enable=\"YES\"\n";
# Points to outer boss
print RC "ntpdate_flags=\"${outer_bossip}\"\n";
if ($NTPSERVER eq "boss") {
print RC "ntpdate_flags=\"ntp1.${outer_domain}\"\n";
} else {
print RC "ntpdate_flags=\"$NTPSERVER\"\n";
}
if ($FBSD_VERSION >= 5) {
print RC "ntpd_enable=\"YES\"\n";
} else {
print RC "xntpd_enable=\"YES\"\n";
}
print RC "linux_enable=\"YES\"\n";
print RC "accounting_enable=\"YES\"\n";
......@@ -1825,6 +1866,13 @@ sub SetupBossNode($)
mysystem("cp -pf /etc/syslog.conf /etc/syslog.conf.old ; ".
"cp /tmp/syslog.conf /etc/syslog.conf");
#
# If not us, fixup our ntp.conf file to talk to the inner ntp server.
#
if ($NTPSERVER ne "boss") {
mysystem("sed -i '.orig' -E -e 's/^server .*/server $NTPSERVER/' /etc/ntp.conf");
}
#
# Create a defs file. Note that this will move to boss at some point.
#
......@@ -1926,6 +1974,15 @@ sub SetupBossNode($)
if (-e "/usr/local/sbin/rndc");
}
#
# Before we restart named, tweak the config to reflect the correct
# NTP server for the inner nodes.
#
my $ndbfile = "${domain}.db.head";
mysystem("sed -i '.orig' -E -e 's/^(ntp[12])[[:space:]]+IN[[:space:]]+CNAME[[:space:]]+ops/\\1 IN CNAME $NTPSERVER/' /etc/namedb/$ndbfile");
$ndbfile = "${domain}.internal.db.head";
mysystem("sed -i '.orig' -E -e 's/^(ntp[12])[[:space:]]+IN[[:space:]]+CNAME[[:space:]]+ops/\\1 IN CNAME $NTPSERVER/' /etc/namedb/$ndbfile");
#
# Setup up MFSes in /tftpboot. Must be done after boss-install as
# it needs the inner .pem files.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment