Commit 38a39130 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Create /etc/hosts on ops and make sure that names resolve.

parent 690af4d9
......@@ -26,13 +26,13 @@ my @MAILING_LISTS = ("@TBOPSEMAIL@","@TBLOGSEMAIL@","@TBWWWEMAIL@",
"@TBTESTSUITEEMAIL@");
my $OURDOMAIN = '@OURDOMAIN@';
my $USERNODE = '@USERNODE@';
my $FSNODE = '@FSNODE@';
my $BOSSNODE = '@BOSSNODE@';
my $LOGFACIL = '@TBLOGFACIL@';
my $OURDOMAIN = '@OURDOMAIN@';
my $USERNODE = '@USERNODE@';
my $FSNODE = '@FSNODE@';
my $BOSSNODE = '@BOSSNODE@';
my $BOSSNODE_IP = '@BOSSNODE_IP@';
my $USERNODE_IP = '@USERNODE_IP@';
my $LOGFACIL = '@TBLOGFACIL@';
#
# Allow this to work if the library is left in the source directory
......@@ -96,6 +96,7 @@ my $ENV = "/usr/bin/env";
# Some files we edit/create
#
my $RCCONF = "/etc/rc.conf";
my $HOSTS = "/etc/hosts";
my $RCLOCAL = "/etc/rc.local";
my $RCCAPTURE = "$PREFIX/etc/rc.capture";
my $LOCAL_HOSTNAMES = "/etc/mail/local-host-names";
......@@ -146,6 +147,13 @@ my $IDENTPUB = "$TOP_SRCDIR/install/identity.pub";
#
my $OPS_PORT = "emulab-ops-1.4";
#
# List of names that goes into $HOSTS and which must resolve.
#
my @OPS_NAMES = ($USERNODE, "users", "ops");
push(@OPS_NAMES, $FSNODE)
if ($USERNODE ne $FSNODE);
#
# Make sure they know what they're getting into...
#
......@@ -250,6 +258,25 @@ Phase "rc.conf", "Adding testbed content to rc.conf", sub {
qq|syslogd_flags=""|);
};
Phase "hosts", "Adding boss/ops IP addresses to $HOSTS", sub {
DoneIfEdited($HOSTS);
AppendToFileFatal($HOSTS,
"${BOSSNODE_IP}\t${BOSSNODE} boss",
"${USERNODE_IP}\t@OPS_NAMES");
};
Phase "resolve", "Checking to make sure names for boss/ops resolve", sub {
foreach my $name (@OPS_NAMES, ${BOSSNODE}, "boss") {
Phase $name, $name, sub {
if (gethostbyname($name)) {
PhaseSkip("$name resolves");
} else {
PhaseFail("$name does not resolve");
}
};
}
};
Phase "sendmail","Configuring sendmail", sub {
Phase "localhosts", "Setting up $LOCAL_HOSTNAMES", sub {
DoneIfExists($LOCAL_HOSTNAMES);
......
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