Commit 2f27d203 authored by Mike Hibler's avatar Mike Hibler

Just can't resist pissing on things...

Try my hand at modifying named config creation.  Allows for "fs" to be
different than ops/users.  Also tried to eliminate some redundant output.
We still generate multiple A records for some IPs (e.g., "ops" and "users")
and don't (I think) generate MX records consistently.
parent 2f6a197d
......@@ -22,7 +22,6 @@ $TTL 30
; Apparently, CNAME NS records are a bad idea - so, ns.emulab.net
; and boss are both A records
ns IN A %bossnode_ip%
boss IN A %bossnode_ip%
%bossnode_ina%
IN MX 10 ops
......@@ -31,16 +30,17 @@ www IN CNAME boss
db IN CNAME boss
cvsup IN CNAME boss
; Plastic and names it is otherwise known as...
ops IN A %usernode_ip%
; Ops and names it is otherwise known as...
%usernode_ina%
IN MX 10 ops
users IN CNAME ops
fs IN CNAME ops
ntp1 IN CNAME ops
ntp2 IN CNAME ops
event-server IN CNAME ops
; Fs (may just be a CNAME for ops)
%fsnode_ina%
%fsnode_mx%
; Routers interfaces in the various subnets
%private-router%
%public-router%
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -29,8 +29,10 @@ my $EXTERNAL_TESTBED_NETWORK = "@EXTERNAL_TESTBED_NETWORK@";
my $EXTERNAL_TESTBED_NETMASK = "@EXTERNAL_TESTBED_NETMASK@";
my $BOSSNODE_IP = "@BOSSNODE_IP@";
my $USERNODE_IP = "@USERNODE_IP@";
my $FSNODE_IP = "@FSNODE_IP@";
my $EXTERNAL_BOSSNODE_IP = "@EXTERNAL_BOSSNODE_IP@";
my $EXTERNAL_USERNODE_IP = "@EXTERNAL_USERNODE_IP@";
my $EXTERNAL_FSNODE_IP = "@EXTERNAL_FSNODE_IP@";
my $CONTROL_ROUTER_IP = "@CONTROL_ROUTER_IP@";
my $CONTROL_NETWORK = "@CONTROL_NETWORK@";
......@@ -85,12 +87,63 @@ while (<IF>) {
"${USERTOKEN}\t\tIN\tA\t\t${USERNODE_IP}\n";
$external_strings .=
"${USERTOKEN}\t\tIN\tA\t\t${EXTERNAL_USERNODE_IP}\n";
#
# If name is not "ops", we need an A record for that as well
#
if ($USERTOKEN ne "ops") {
$internal_strings .=
"ops\t\tIN\tA\t\t${USERNODE_IP}\n";
$external_strings .=
"ops\t\tIN\tA\t\t${EXTERNAL_USERNODE_IP}\n";
}
#
# If name is not "users" we need a CNAME for that
#
elsif ($USERTOKEN ne "users") {
$internal_strings .=
"users\t\tIN\tCNAME\t\t${USERTOKEN}\n";
$external_strings .=
"users\t\tIN\tCNAME\t\t${USERTOKEN}\n";
}
}
elsif ($2 eq "bossnode_ina") {
$internal_strings .=
"${BOSSTOKEN}\t\tIN\tA\t\t${BOSSNODE_IP}\n";
$external_strings .=
"${BOSSTOKEN}\t\tIN\tA\t\t${EXTERNAL_BOSSNODE_IP}\n";
#
# If name is not "boss", we need an A record for that as well
#
if ($BOSSTOKEN ne "boss") {
$internal_strings .=
"boss\t\tIN\tA\t\t${BOSSNODE_IP}\n";
$external_strings .=
"boss\t\tIN\tA\t\t${EXTERNAL_BOSSNODE_IP}\n";
}
}
elsif ($2 eq "fsnode_ina") {
if ($USERNODE_IP ne $FSNODE_IP) {
$internal_strings .=
"fs\t\tIN\tA\t\t${FSNODE_IP}\n";
$external_strings .=
"fs\t\tIN\tA\t\t${EXTERNAL_FSNODE_IP}\n";
} else {
$internal_strings .=
"fs\t\tIN\tCNAME\tops\n";
$external_strings .=
"fs\t\tIN\tCNAME\tops\n";
}
}
elsif ($2 eq "fsnode_mx") {
if ("$USERNODE_IP" ne "$FSNODE_IP") {
$internal_strings .=
"\t\tIN\tMX 10\tops\n";
$external_strings .=
"\t\tIN\tMX 10\tops\n";
} else {
;
}
}
elsif ($2 eq "private-router") {
my $foo = "private-router\tIN\tA\t${PRIVATE_ROUTER}\n";
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -27,8 +27,10 @@ my $EXTERNAL_TESTBED_NETWORK = "@EXTERNAL_TESTBED_NETWORK@";
my $EXTERNAL_TESTBED_NETMASK = "@EXTERNAL_TESTBED_NETMASK@";
my $BOSSNODE_IP = "@BOSSNODE_IP@";
my $USERNODE_IP = "@USERNODE_IP@";
my $FSNODE_IP = "@FSNODE_IP@";
my $EXTERNAL_BOSSNODE_IP = "@EXTERNAL_BOSSNODE_IP@";
my $EXTERNAL_USERNODE_IP = "@EXTERNAL_USERNODE_IP@";
my $EXTERNAL_FSNODE_IP = "@EXTERNAL_FSNODE_IP@";
my $CONTROL_ROUTER_IP = "@CONTROL_ROUTER_IP@";
my $CONTROL_NETWORK = "@CONTROL_NETWORK@";
......@@ -70,6 +72,9 @@ open(REV, ">>$internal_revfile")
print REV "\n";
print REV "${BOSSNODE_IP}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${USERNODE_IP}\tIN\tPTR\tops.${OURDOMAIN}.\n";
if ($FSNODE_IP ne $USERNODE_IP) {
print REV "${FSNODE_IP}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
close(REV);
# No need is just one big IP space.
......@@ -89,6 +94,9 @@ open(REV, ">>$external_revfile")
print REV "\n";
print REV "${EXTERNAL_BOSSNODE_IP}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${EXTERNAL_USERNODE_IP}\tIN\tPTR\tops.${OURDOMAIN}.\n";
if ($FSNODE_IP ne $USERNODE_IP) {
print REV "${EXTERNAL_FSNODE_IP}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
close(REV);
exit(0);
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