Commit 965be5ea authored by Leigh Stoller's avatar Leigh Stoller

Initial work at generalizing the genirack target automated setup,

as per issue #440.
parent b322a14e
...@@ -78,7 +78,7 @@ my $THISHOMEBASE= "@THISHOMEBASE@"; ...@@ -78,7 +78,7 @@ my $THISHOMEBASE= "@THISHOMEBASE@";
my $PROTOUSER = 'elabman'; my $PROTOUSER = 'elabman';
my $ELABINELAB = @ELABINELAB@; my $ELABINELAB = @ELABINELAB@;
my $PGENISUPPORT= @PROTOGENI_SUPPORT@; my $PGENISUPPORT= @PROTOGENI_SUPPORT@;
my $GENIRACK = @PROTOGENI_GENIRACK@; my $CONFIG_TARGETSYS = @CONFIG_TARGETSYS@;
my $SAMBANODE = "fs"; # DNS makes this do the right thing in E-in-E. my $SAMBANODE = "fs"; # DNS makes this do the right thing in E-in-E.
my $SMBPASSWD = "/usr/local/bin/smbpasswd"; my $SMBPASSWD = "/usr/local/bin/smbpasswd";
...@@ -472,7 +472,7 @@ sub AddUser() ...@@ -472,7 +472,7 @@ sub AddUser()
# #
# Leave the password "starred" on elabinelab; safer. # Leave the password "starred" on elabinelab; safer.
# #
if (!$ELABINELAB || $GENIRACK) { if (!$ELABINELAB && !$CONFIG_TARGETSYS) {
# shell escape. # shell escape.
$pswd =~ s/\$/\\\$/g; $pswd =~ s/\$/\\\$/g;
$pswd =~ s/\*/\\\*/g; $pswd =~ s/\*/\\\*/g;
...@@ -750,7 +750,7 @@ sub UpdatePassword() ...@@ -750,7 +750,7 @@ sub UpdatePassword()
# Change on ops only if there is a real account there. # Change on ops only if there is a real account there.
# For ELABINELAB, safer to leave the password "starred". # For ELABINELAB, safer to leave the password "starred".
# #
if (!$wikionly && (!$ELABINELAB || $GENIRACK)) { if (!$wikionly && !$ELABINELAB && !$CONFIG_TARGETSYS) {
# #
# Grab from the DB to avoid taint checking sillyness. # Grab from the DB to avoid taint checking sillyness.
# #
......
...@@ -219,7 +219,7 @@ my %emulabconfig = ( ...@@ -219,7 +219,7 @@ my %emulabconfig = (
# CONFIG_QUERIER configure mfrisbeed to act as IGMP querier # CONFIG_QUERIER configure mfrisbeed to act as IGMP querier
# CONFIG_OPSVM configure ops node to be jail on boss (obsolete) # CONFIG_OPSVM configure ops node to be jail on boss (obsolete)
# CONFIG_NODBINIT do not load DB state on boss # CONFIG_NODBINIT do not load DB state on boss
# CONFIG_GENIRACK configure as a GENI rack # CONFIG_TARGETSYS configure for a target system
# CONFIG_ZFS configure fs node to use ZFS # CONFIG_ZFS configure fs node to use ZFS
# CONFIG_AUTOFS configure autofs instead of amd for boss ZFS mounts # CONFIG_AUTOFS configure autofs instead of amd for boss ZFS mounts
# #
...@@ -233,7 +233,6 @@ my %emulabconfig = ( ...@@ -233,7 +233,6 @@ my %emulabconfig = (
"CONFIG_QUERIER" => $NEEDQUERIER, "CONFIG_QUERIER" => $NEEDQUERIER,
"CONFIG_OPSVM" => $OPSVM, "CONFIG_OPSVM" => $OPSVM,
"CONFIG_NODBINIT" => 0, "CONFIG_NODBINIT" => 0,
"CONFIG_GENIRACK" => 0,
"CONFIG_TARGETSYS" => 0, "CONFIG_TARGETSYS" => 0,
"CONFIG_ZFS" => 0, "CONFIG_ZFS" => 0,
"CONFIG_AUTOFS" => 0, "CONFIG_AUTOFS" => 0,
...@@ -1306,7 +1305,7 @@ sub SetupFsNode() ...@@ -1306,7 +1305,7 @@ sub SetupFsNode()
skipsetup: skipsetup:
return return
if ($emulabconfig{"CONFIG_GENIRACK"}); if ($emulabconfig{"CONFIG_TARGETSYS"});
# #
# Hmm, need to run this at startup though. # Hmm, need to run this at startup though.
...@@ -1862,30 +1861,28 @@ sub SetupOpsNode($) ...@@ -1862,30 +1861,28 @@ sub SetupOpsNode($)
else { else {
print RC "defaultrouter=\"$bossnode_ip\"\n"; print RC "defaultrouter=\"$bossnode_ip\"\n";
} }
if ($emulabconfig{"CONFIG_GENIRACK"} && if ($emulabconfig{"CONFIG_TARGETSYS"} &&
exists($emulabconfig{"GENIRACK_OPSIP"}) && exists($emulabconfig{"TARGETSYS_OPSIP"}) &&
$emulabconfig{"CONFIG_SINGLECNET"}) { $emulabconfig{"CONFIG_SINGLECNET"}) {
my $GENIRACK_NETWORK = $emulabconfig{"GENIRACK_NETWORK"}; my $TARGETSYS_NETWORK = $emulabconfig{"TARGETSYS_NETWORK"};
my $GENIRACK_NETMASK = $emulabconfig{"GENIRACK_NETMASK"}; my $TARGETSYS_NETMASK = $emulabconfig{"TARGETSYS_NETMASK"};
my $GENIRACK_OPSIP = $emulabconfig{"GENIRACK_OPSIP"}; my $TARGETSYS_OPSIP = $emulabconfig{"TARGETSYS_OPSIP"};
my $GENIRACK_DOMAIN = $emulabconfig{"GENIRACK_DOMAIN"}; my $TARGETSYS_DOMAIN = $emulabconfig{"TARGETSYS_DOMAIN"};
print RC "ifconfig_${outer_controlif}_alias0=". print RC "ifconfig_${outer_controlif}_alias0=".
"\"inet $GENIRACK_OPSIP netmask $GENIRACK_NETMASK\"\n"; "\"inet $TARGETSYS_OPSIP netmask $TARGETSYS_NETMASK\"\n";
print RC "static_routes=\"\$static_routes genirack\"\n"; print RC "static_routes=\"\$static_routes targetsys\"\n";
print RC "route_genirack=\"-net $GENIRACK_NETWORK ". print RC "route_targetsys=\"-net $TARGETSYS_NETWORK ".
" -netmask $GENIRACK_NETMASK -iface $outer_controlif\"\n"; " -netmask $TARGETSYS_NETMASK -iface $outer_controlif\"\n";
print RC "hostname=\"" . "ops" . "." . $GENIRACK_DOMAIN . "\"\n"; print RC "hostname=\"" . "ops" . "." . $TARGETSYS_DOMAIN . "\"\n";
# #
# Need to enact these changes now before trying setup Emulab # Need to enact these changes now before trying setup Emulab
# #
mysystem("ifconfig $outer_controlif ". mysystem("ifconfig $outer_controlif ".
"inet $GENIRACK_OPSIP netmask $GENIRACK_NETMASK add"); "inet $TARGETSYS_OPSIP netmask $TARGETSYS_NETMASK add");
#mysystem("route add -net $GENIRACK_NETWORK ".
# "-netmask $GENIRACK_NETMASK -iface $outer_controlif");
} }
else { else {
print RC "hostname=\"" . $emulabconfig{"OPSNODE"} . "." . $domain . "\"\n"; print RC "hostname=\"" . $emulabconfig{"OPSNODE"} . "." . $domain . "\"\n";
...@@ -1895,9 +1892,9 @@ sub SetupOpsNode($) ...@@ -1895,9 +1892,9 @@ sub SetupOpsNode($)
# #
# Localize the timezone for the Geni Racks # Localize the timezone for the Geni Racks
# #
if ($emulabconfig{"CONFIG_GENIRACK"} && if ($emulabconfig{"CONFIG_TARGETSYS"} &&
exists($emulabconfig{"GENIRACK_TIMEZONE"})) { exists($emulabconfig{"TARGETSYS_TIMEZONE"})) {
my $zonefile = $emulabconfig{"GENIRACK_TIMEZONE"}; my $zonefile = $emulabconfig{"TARGETSYS_TIMEZONE"};
mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime"); mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime");
} }
...@@ -2574,29 +2571,27 @@ sub SetupBossNode($) ...@@ -2574,29 +2571,27 @@ sub SetupBossNode($)
print RC "ifconfig_${outer_controlif}=". print RC "ifconfig_${outer_controlif}=".
"\"inet $outer_ip netmask $outer_netmask $tso\"\n"; "\"inet $outer_ip netmask $outer_netmask $tso\"\n";
if ($emulabconfig{"CONFIG_GENIRACK"} && if ($emulabconfig{"CONFIG_TARGETSYS"} &&
exists($emulabconfig{"GENIRACK_BOSSIP"}) && exists($emulabconfig{"TARGETSYS_BOSSIP"}) &&
$emulabconfig{"CONFIG_SINGLECNET"}) { $emulabconfig{"CONFIG_SINGLECNET"}) {
my $GENIRACK_NETWORK = $emulabconfig{"GENIRACK_NETWORK"}; my $TARGETSYS_NETWORK = $emulabconfig{"TARGETSYS_NETWORK"};
my $GENIRACK_NETMASK = $emulabconfig{"GENIRACK_NETMASK"}; my $TARGETSYS_NETMASK = $emulabconfig{"TARGETSYS_NETMASK"};
my $GENIRACK_BOSSIP = $emulabconfig{"GENIRACK_BOSSIP"}; my $TARGETSYS_BOSSIP = $emulabconfig{"TARGETSYS_BOSSIP"};
my $GENIRACK_DOMAIN = $emulabconfig{"GENIRACK_DOMAIN"}; my $TARGETSYS_DOMAIN = $emulabconfig{"TARGETSYS_DOMAIN"};
print RC "ifconfig_${outer_controlif}_alias0=". print RC "ifconfig_${outer_controlif}_alias0=".
"\"inet $GENIRACK_BOSSIP netmask $GENIRACK_NETMASK\"\n"; "\"inet $TARGETSYS_BOSSIP netmask $TARGETSYS_NETMASK\"\n";
print RC "static_routes=\"\$static_routes genirack\"\n"; print RC "static_routes=\"\$static_routes targetsys\"\n";
print RC "route_genirack=\"-net $GENIRACK_NETWORK ". print RC "route_targetsys=\"-net $TARGETSYS_NETWORK ".
" -netmask $GENIRACK_NETMASK -iface $outer_controlif\"\n"; " -netmask $TARGETSYS_NETMASK -iface $outer_controlif\"\n";
print RC "hostname=\"" . "boss" . "." . $GENIRACK_DOMAIN . "\"\n"; print RC "hostname=\"" . "boss" . "." . $TARGETSYS_DOMAIN . "\"\n";
# #
# Need to enact these changes now before trying setup Emulab # Need to enact these changes now before trying setup Emulab
# #
mysystem("ifconfig $outer_controlif ". mysystem("ifconfig $outer_controlif ".
"inet $GENIRACK_BOSSIP netmask $GENIRACK_NETMASK add"); "inet $TARGETSYS_BOSSIP netmask $TARGETSYS_NETMASK add");
#mysystem("route add -net $GENIRACK_NETWORK ".
# "-netmask $GENIRACK_NETMASK -iface $outer_controlif");
} }
else { else {
print RC "hostname=\"" . $emulabconfig{"BOSSNODE"} . "." . $domain . "\"\n"; print RC "hostname=\"" . $emulabconfig{"BOSSNODE"} . "." . $domain . "\"\n";
...@@ -2675,11 +2670,11 @@ sub SetupBossNode($) ...@@ -2675,11 +2670,11 @@ sub SetupBossNode($)
close(RC); close(RC);
# #
# Localize the timezone for the Geni Racks # Localize the timezone for the target.
# #
if ($emulabconfig{"CONFIG_GENIRACK"} && if ($emulabconfig{"CONFIG_TARGETSYS"} &&
exists($emulabconfig{"GENIRACK_TIMEZONE"})) { exists($emulabconfig{"TARGETSYS_TIMEZONE"})) {
my $zonefile = $emulabconfig{"GENIRACK_TIMEZONE"}; my $zonefile = $emulabconfig{"TARGETSYS_TIMEZONE"};
mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime"); mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime");
} }
...@@ -2823,7 +2818,7 @@ sub SetupBossNode($) ...@@ -2823,7 +2818,7 @@ sub SetupBossNode($)
# the non-singlenet case, we restrict it to that. # the non-singlenet case, we restrict it to that.
# #
if (! $emulabconfig{"CONFIG_SINGLECNET"} && if (! $emulabconfig{"CONFIG_SINGLECNET"} &&
! $emulabconfig{"CONFIG_GENIRACK"}) { ! $emulabconfig{"CONFIG_TARGETSYS"}) {
mysystem("echo 'ipfw add 10 allow udp from any to 224.0.0.0/4' ". mysystem("echo 'ipfw add 10 allow udp from any to 224.0.0.0/4' ".
" >> /etc/rc.local"); " >> /etc/rc.local");
} }
...@@ -3313,21 +3308,21 @@ sub CreateDefsFile($) ...@@ -3313,21 +3308,21 @@ sub CreateDefsFile($)
# #
# Ug. # Ug.
# #
if ($emulabconfig{"CONFIG_GENIRACK"}) { if ($emulabconfig{"CONFIG_TARGETSYS"}) {
$bossnode_ip = $emulabconfig{"GENIRACK_BOSSIP"}; $bossnode_ip = $emulabconfig{"TARGETSYS_BOSSIP"};
$opsnode_ip = $emulabconfig{"GENIRACK_OPSIP"}; $opsnode_ip = $emulabconfig{"TARGETSYS_OPSIP"};
$fsnode_ip = $opsnode_ip; $fsnode_ip = $opsnode_ip;
$control_ip = $opsnode_ip; $control_ip = $opsnode_ip;
$control_netmask = $emulabconfig{"GENIRACK_NETMASK"}; $control_netmask = $emulabconfig{"TARGETSYS_NETMASK"};
$bossnode_hostname = "boss"; $bossnode_hostname = "boss";
$opsnode_hostname = "ops"; $opsnode_hostname = "ops";
$fsnode_hostname = "ops"; $fsnode_hostname = "ops";
$ourdomain = $emulabconfig{"GENIRACK_DOMAIN"}; $ourdomain = $emulabconfig{"TARGETSYS_DOMAIN"};
$thishomebase = $emulabconfig{"GENIRACK_HOMEBASE"} $thishomebase = $emulabconfig{"TARGETSYS_HOMEBASE"}
if (defined($emulabconfig{"GENIRACK_HOMEBASE"})); if (defined($emulabconfig{"TARGETSYS_HOMEBASE"}));
$cookiesuffix = $emulabconfig{"GENIRACK_HOMEBASE"} $cookiesuffix = $emulabconfig{"TARGETSYS_HOMEBASE"}
if (defined($emulabconfig{"GENIRACK_HOMEBASE"})); if (defined($emulabconfig{"TARGETSYS_HOMEBASE"}));
$router_ip = $emulabconfig{"GENIRACK_ROUTER"}; $router_ip = $emulabconfig{"TARGETSYS_ROUTER"};
} }
my $control_network = inet_ntoa(inet_aton($control_ip) & my $control_network = inet_ntoa(inet_aton($control_ip) &
...@@ -3655,23 +3650,33 @@ sub CreateDefsFile($) ...@@ -3655,23 +3650,33 @@ sub CreateDefsFile($)
print OUTDEFS $_; print OUTDEFS $_;
} }
} }
if ($emulabconfig{"CONFIG_PROTOGENI"} || if ($emulabconfig{"CONFIG_TARGETSYS"}) {
$emulabconfig{"CONFIG_GENIRACK"}) { my $target = $emulabconfig{"TARGETSYS_TARGET"};
my $config_genirack = $emulabconfig{"CONFIG_GENIRACK"};
print OUTDEFS "CONFIG_TARGETSYS=1\n";
print OUTDEFS "TARGETSYS_TARGET=\"${target}\"\n";
if ($target eq "GENIRACK") {
print OUTDEFS "PROTOGENI_GENIRACK=1\n";
}
}
if ($emulabconfig{"CONFIG_PROTOGENI"}) {
my $protogeni_domain = lc($thishomebase); my $protogeni_domain = lc($thishomebase);
if (defined($emulabconfig{"GENIRACK_HOMEBASE"})) { if (defined($emulabconfig{"TARGETSYS_HOMEBASE"})) {
$protogeni_domain = lc($emulabconfig{"GENIRACK_HOMEBASE"}); $protogeni_domain = lc($emulabconfig{"TARGETSYS_HOMEBASE"});
} }
print OUTDEFS "PROTOGENI_SUPPORT=1\n"; print OUTDEFS "PROTOGENI_SUPPORT=1\n";
print OUTDEFS "PROTOGENI_GENIRACK=$config_genirack\n";
print OUTDEFS "PROTOGENI_DOMAIN=\"$protogeni_domain\"\n"; print OUTDEFS "PROTOGENI_DOMAIN=\"$protogeni_domain\"\n";
print OUTDEFS "FANCYBANNER=1\n"; print OUTDEFS "FANCYBANNER=1\n";
print OUTDEFS "ISOLATEADMINS=0\n"; print OUTDEFS "ISOLATEADMINS=0\n";
if ($emulabconfig{"CONFIG_PORTAL"} && !$config_genirack) { if ($emulabconfig{"CONFIG_PORTAL"}) {
print OUTDEFS "PORTAL_ENABLE=1\n"; print OUTDEFS "PORTAL_ENABLE=1\n";
print OUTDEFS "PROTOGENI_ISCLEARINGHOUSE=1\n";
print OUTDEFS "PROTOGENI_LOCALUSER=1\n"; print OUTDEFS "PROTOGENI_LOCALUSER=1\n";
}
if (! ($emulabconfig{"CONFIG_TARGETSYS"} eq "GENIRACK" ||
$emulabconfig{"CONFIG_FEDERATED"})) {
print OUTDEFS "PROTOGENI_ISCLEARINGHOUSE=1\n";
print OUTDEFS "PROTOGENI_WEBSITE=${bossnode_hostname}.${ourdomain}\n"; print OUTDEFS "PROTOGENI_WEBSITE=${bossnode_hostname}.${ourdomain}\n";
} }
} }
......
...@@ -219,6 +219,9 @@ ...@@ -219,6 +219,9 @@
/* Support Protogeni rack */ /* Support Protogeni rack */
#undef PROTOGENI_GENIRACK #undef PROTOGENI_GENIRACK
/* Configure for a target system (like a rack) */
#undef CONFIG_TARGETSYS
/* Support Protogeni */ /* Support Protogeni */
#undef PROTOGENI_SUPPORT #undef PROTOGENI_SUPPORT
......
...@@ -739,6 +739,8 @@ GMAP_API_KEY ...@@ -739,6 +739,8 @@ GMAP_API_KEY
STANDALONE_CLEARINGHOUSE STANDALONE_CLEARINGHOUSE
PROTOGENI_NICKNAME PROTOGENI_NICKNAME
PROTOGENI_GENIRACK PROTOGENI_GENIRACK
CONFIG_TARGETSYS
TARGETSYS_TARGET
PROTOGENI_URL PROTOGENI_URL
GENI_PUBRPCPORT GENI_PUBRPCPORT
PROTOGENI_NONFSMOUNTS PROTOGENI_NONFSMOUNTS
...@@ -5148,6 +5150,8 @@ PROTOGENI_MAXSERVERLOAD=12 ...@@ -5148,6 +5150,8 @@ PROTOGENI_MAXSERVERLOAD=12
PROTOGENI_NONFSMOUNTS=0 PROTOGENI_NONFSMOUNTS=0
GENI_PUBRPCPORT=12370 GENI_PUBRPCPORT=12370
PROTOGENI_GENIRACK=0 PROTOGENI_GENIRACK=0
CONFIG_TARGETSYS=0
TARGETSYS_TARGET=""
PROTOGENI_NICKNAME="unknown" PROTOGENI_NICKNAME="unknown"
STANDALONE_CLEARINGHOUSE=0 STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0 NODE_USAGE_SUPPORT=0
...@@ -5649,6 +5653,13 @@ cat >>confdefs.h <<_ACEOF ...@@ -5649,6 +5653,13 @@ cat >>confdefs.h <<_ACEOF
#define PROTOGENI_GENIRACK 1 #define PROTOGENI_GENIRACK 1
_ACEOF _ACEOF
fi
if test $CONFIG_TARGETSYS -eq 1; then
cat >>confdefs.h <<_ACEOF
#define CONFIG_TARGETSYS 1
_ACEOF
fi fi
if test $IMAGEPROVENANCE -eq 1; then if test $IMAGEPROVENANCE -eq 1; then
......
...@@ -266,6 +266,8 @@ AC_SUBST(PROTOGENI_URL) ...@@ -266,6 +266,8 @@ AC_SUBST(PROTOGENI_URL)
AC_SUBST(PROTOGENI_GENIRACK) AC_SUBST(PROTOGENI_GENIRACK)
AC_SUBST(PROTOGENI_NICKNAME) AC_SUBST(PROTOGENI_NICKNAME)
AC_SUBST(STANDALONE_CLEARINGHOUSE) AC_SUBST(STANDALONE_CLEARINGHOUSE)
AC_SUBST(CONFIG_TARGETSYS)
AC_SUBST(TARGETSYS_TARGET)
AC_SUBST(GMAP_API_KEY) AC_SUBST(GMAP_API_KEY)
AC_SUBST(NODE_USAGE_SUPPORT) AC_SUBST(NODE_USAGE_SUPPORT)
AC_SUBST(NOSTACKMIB) AC_SUBST(NOSTACKMIB)
...@@ -438,6 +440,8 @@ PROTOGENI_MAXSERVERLOAD=12 ...@@ -438,6 +440,8 @@ PROTOGENI_MAXSERVERLOAD=12
PROTOGENI_NONFSMOUNTS=0 PROTOGENI_NONFSMOUNTS=0
GENI_PUBRPCPORT=12370 GENI_PUBRPCPORT=12370
PROTOGENI_GENIRACK=0 PROTOGENI_GENIRACK=0
CONFIG_TARGETSYS=0
TARGETSYS_TARGET=""
PROTOGENI_NICKNAME="unknown" PROTOGENI_NICKNAME="unknown"
STANDALONE_CLEARINGHOUSE=0 STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0 NODE_USAGE_SUPPORT=0
......
...@@ -10,20 +10,23 @@ tb-set-elabinelab-attribute LOAD_PROTOGENI 1 ...@@ -10,20 +10,23 @@ tb-set-elabinelab-attribute LOAD_PROTOGENI 1
tb-set-elabinelab-attribute CONFIG_NODBINIT 1 tb-set-elabinelab-attribute CONFIG_NODBINIT 1
tb-set-elabinelab-attribute CONFIG_NOSETUP 0 tb-set-elabinelab-attribute CONFIG_NOSETUP 0
tb-set-elabinelab-attribute CONFIG_GENIRACK 1 tb-set-elabinelab-attribute CONFIG_TARGETSYS 1
tb-set-elabinelab-attribute GENIRACK_NETWORK 128.82.75.64 tb-set-elabinelab-attribute TARGETSYS_TARGET GENIRACK
tb-set-elabinelab-attribute GENIRACK_NETMASK 255.255.255.192 tb-set-elabinelab-attribute TARGETSYS_DOMAIN instageni.odu.edu
tb-set-elabinelab-attribute GENIRACK_ROUTER 128.82.75.65 tb-set-elabinelab-attribute TARGETSYS_NETWORK 128.82.75.64
tb-set-elabinelab-attribute GENIRACK_ILOIP 128.82.75.66 tb-set-elabinelab-attribute TARGETSYS_NETMASK 255.255.255.192
tb-set-elabinelab-attribute GENIRACK_CONTROLIP 128.82.75.67 tb-set-elabinelab-attribute TARGETSYS_ROUTER 128.82.75.65
tb-set-elabinelab-attribute GENIRACK_BOSSIP 128.82.75.68 tb-set-elabinelab-attribute TARGETSYS_BOSSIP 128.82.75.68
tb-set-elabinelab-attribute GENIRACK_OPSIP 128.82.75.69 tb-set-elabinelab-attribute TARGETSYS_OPSIP 128.82.75.69
# Geni Rack specific stuff.
tb-set-elabinelab-attribute GENIRACK_FOAMIP 128.82.75.70 tb-set-elabinelab-attribute GENIRACK_FOAMIP 128.82.75.70
tb-set-elabinelab-attribute GENIRACK_FLOWIP 128.82.75.71 tb-set-elabinelab-attribute GENIRACK_FLOWIP 128.82.75.71
tb-set-elabinelab-attribute GENIRACK_ILOIP 128.82.75.66
tb-set-elabinelab-attribute GENIRACK_CONTROLIP 128.82.75.67
# Added Utah boss to avoid timeouts during setup. # Added Utah boss to avoid timeouts during setup.
tb-set-elabinelab-attribute NAMED_FORWARDERS "128.82.254.154,128.82.254.155,155.98.32.70" tb-set-elabinelab-attribute NAMED_FORWARDERS "128.82.254.154,128.82.254.155,155.98.32.70"
tb-set-elabinelab-attribute NAMED_ALSONOTIFY 155.98.32.70 tb-set-elabinelab-attribute NAMED_ALSONOTIFY 155.98.32.70
tb-set-elabinelab-attribute GENIRACK_DOMAIN instageni.odu.edu
#tb-set-elabinelab-attribute ROUTABLE_IPRANGE "128.82.75.96-128.82.75.126" #tb-set-elabinelab-attribute ROUTABLE_IPRANGE "128.82.75.96-128.82.75.126"
tb-set-elabinelab-attribute GENIRACK_COUNTRY "US" tb-set-elabinelab-attribute GENIRACK_COUNTRY "US"
...@@ -31,13 +34,13 @@ tb-set-elabinelab-attribute GENIRACK_LATITUDE "36.88560" ...@@ -31,13 +34,13 @@ tb-set-elabinelab-attribute GENIRACK_LATITUDE "36.88560"
tb-set-elabinelab-attribute GENIRACK_LONGITUDE "-76.30741" tb-set-elabinelab-attribute GENIRACK_LONGITUDE "-76.30741"
# Reset to admin email later. # Reset to admin email later.
tb-set-elabinelab-attribute GENIRACK_TBOPS "genirack-ops@flux.utah.edu" tb-set-elabinelab-attribute TARGETSYS_TBOPS "genirack-ops@flux.utah.edu"
tb-set-elabinelab-attribute GENIRACK_TBLOGS "genirack-logs@flux.utah.edu" tb-set-elabinelab-attribute TARGETSYS_TBLOGS "genirack-logs@flux.utah.edu"
tb-set-elabinelab-attribute GENIRACK_TBSTATED "genirack-stated@flux.utah.edu" tb-set-elabinelab-attribute TARGETSYS_TBSTATED "genirack-stated@flux.utah.edu"
# We make this stuff up for the site. # We make this stuff up for the site.
tb-set-elabinelab-attribute GENIRACK_HOMEBASE ODU tb-set-elabinelab-attribute TARGETSYS_HOMEBASE ODU
tb-set-elabinelab-attribute GENIRACK_TIMEZONE America/New_York tb-set-elabinelab-attribute TARGETSYS_TIMEZONE America/New_York
tb-set-elabinelab-attribute SSLCERT_COUNTRY US tb-set-elabinelab-attribute SSLCERT_COUNTRY US
tb-set-elabinelab-attribute SSLCERT_STATE "Virginia" tb-set-elabinelab-attribute SSLCERT_STATE "Virginia"
tb-set-elabinelab-attribute SSLCERT_LOCALITY "Norfolk" tb-set-elabinelab-attribute SSLCERT_LOCALITY "Norfolk"
......
...@@ -185,6 +185,7 @@ $PREFIX = $TBROOT; ...@@ -185,6 +185,7 @@ $PREFIX = $TBROOT;
$MAINSITE = @TBMAINSITE@; $MAINSITE = @TBMAINSITE@;
$PGENISUPPORT = @PROTOGENI_SUPPORT@; $PGENISUPPORT = @PROTOGENI_SUPPORT@;
$PROTOGENI_GENIRACK = @PROTOGENI_GENIRACK@; $PROTOGENI_GENIRACK = @PROTOGENI_GENIRACK@;
$CONFIG_TARGETSYS = @CONFIG_TARGETSYS@;
$PORTAL_ENABLE = @PORTAL_ENABLE@; $PORTAL_ENABLE = @PORTAL_ENABLE@;
$ELABINELAB = @ELABINELAB@; $ELABINELAB = @ELABINELAB@;
$DBNAME = "@TBDBNAME@"; $DBNAME = "@TBDBNAME@";
......
...@@ -282,27 +282,27 @@ sub Install($$$) ...@@ -282,27 +282,27 @@ sub Install($$$)
# #
# Latitude/Longitude # Latitude/Longitude
# #
if (exists($configvars{'GENIRACK_COUNTRY'}) && if (exists($configvars{'TARGETSYS_COUNTRY'}) &&
$configvars{'GENIRACK_COUNTRY'} ne "") { $configvars{'TARGETSYS_COUNTRY'} ne "") {
Phase "sitevar2", "Setting country sitevar", sub { Phase "sitevar2", "Setting country sitevar", sub {
SetSiteVar("general/default_country", SetSiteVar("general/default_country",
$configvars{'GENIRACK_COUNTRY'}) $configvars{'TARTGETSYS_COUNTRY'})
or PhaseFail("failed"); or PhaseFail("failed");
}; };
} }
if (exists($configvars{'GENIRACK_LATITUDE'}) && if (exists($configvars{'TARGETSYS_LATITUDE'}) &&
$configvars{'GENIRACK_LATITUDE'} ne "") { $configvars{'TARGETSYS_LATITUDE'} ne "") {
Phase "sitevar3", "Setting latitude sitevar", sub { Phase "sitevar3", "Setting latitude sitevar", sub {
SetSiteVar("general/default_latitude", SetSiteVar("general/default_latitude",
$configvars{'GENIRACK_LATITUDE'}) $configvars{'TARGETSYS_LATITUDE'})
or PhaseFail("failed"); or PhaseFail("failed");
}; };
} }
if (exists($configvars{'GENIRACK_LONGITUDE'}) && if (exists($configvars{'TARGETSYS_LONGITUDE'}) &&
$configvars{'GENIRACK_LONGITUDE'} ne "") { $configvars{'TARGETSYS_LONGITUDE'} ne "") {
Phase "sitevar4", "Setting longitude sitevar", sub { Phase "sitevar4", "Setting longitude sitevar", sub {
SetSiteVar("general/default_longitude", SetSiteVar("general/default_longitude",
$configvars{'GENIRACK_LONGITUDE'}) $configvars{'TARGETSYS_LONGITUDE'})
or PhaseFail("failed"); or PhaseFail("failed");
}; };
} }
...@@ -436,8 +436,8 @@ sub Install($$$) ...@@ -436,8 +436,8 @@ sub Install($$$)
push(@strings, push(@strings,
"network_interfaces=\"\$network_interfaces @ifaces\""); "network_interfaces=\"\$network_interfaces @ifaces\"");
push(@strings, push(@strings,
"ifconfig_xn0=\"inet ". $configvars{"GENIRACK_BOSSIP"} . "ifconfig_xn0=\"inet ". $configvars{"TARGETSYS_BOSSIP"} .
" netmask " . $configvars{"GENIRACK_NETMASK"} . " -tso\""); " netmask " . $configvars{"TARGETSYS_NETMASK"} . " -tso\"");
# Jail network. # Jail network.
push(@strings, push(@strings,
"ifconfig_xn0_alias0=\"inet 172.17.254.254 ". "ifconfig_xn0_alias0=\"inet 172.17.254.254 ".
...@@ -448,7 +448,7 @@ sub Install($$$) ...@@ -448,7 +448,7 @@ sub Install($$$)
"netmask 255.255.255.0\""); "netmask 255.255.255.0\"");
# Actual default router. # Actual default router.
push(@strings, push(@strings,
"defaultrouter=\"" . $configvars{"GENIRACK_ROUTER"} . "\""); "defaultrouter=\"" . $configvars{"TARGETSYS_ROUTER"} . "\"");
# Going to lose all static routes below, so add this back. # Going to lose all static routes below, so add this back.
push(@strings, push(@strings,
"static_routes=\"\$static_routes frisbee\""); "static_routes=\"\$static_routes frisbee\"");
......
...@@ -32,6 +32,11 @@ my %NEWIMAGES = ( ...@@ -32,6 +32,11 @@ my %NEWIMAGES = (
"FBSD111-64-STD" => "https://www.emulab.net/image_metadata.php?uuid=560f4743-795d-11e7-ac90-90e2ba22fee4" "FBSD111-64-STD" => "https://www.emulab.net/image_metadata.php?uuid=560f4743-795d-11e7-ac90-90e2ba22fee4"
); );
if ($FBSD_MAJOR > 10) {
$LINUXSTDIMAGE = "UBUNTU16-64-STD";
$FBSDSTDIMAGE = "FBSD111-64-STD";
}
# #
# Old style mappings, but probably still in use someplace. # Old style mappings, but probably still in use someplace.
# #
......
...@@ -26,7 +26,7 @@ sub Install($$$) ...@@ -26,7 +26,7 @@ sub Install($$$)
Phase "mibs", "Fetching Cisco MIBs", sub { Phase "mibs", "Fetching Cisco MIBs", sub {
# Not needed in an inner elab, and it takes a long time. # Not needed in an inner elab, and it takes a long time.
PhaseSkip("Not needed in ELABINELAB") PhaseSkip("Not needed in ELABINELAB")
if ($ELABINELAB && !$PROTOGENI_GENIRACK); if ($ELABINELAB && !$CONFIG_TARGETSYS);
foreach my $mib (@CISCO_MIBS) { foreach my $mib (@CISCO_MIBS) {
my $localfile = "$MIBPATH/$mib.txt"; my $localfile = "$MIBPATH/$mib.txt";
...@@ -40,7 +40,7 @@ sub Install($$$) ...@@ -40,7 +40,7 @@ sub Install($$$)
Phase "hpmibs", "Fetching HP MIBs", sub { Phase "hpmibs", "Fetching HP MIBs", sub {
# Not needed in an inner elab, and it takes a long time. # Not needed in an inner elab, and it takes a long time.
PhaseSkip("Not needed in ELABINELAB") PhaseSkip("Not needed in ELABINELAB")
if ($ELABINELAB && !$PROTOGENI_GENIRACK); if ($ELABINELAB && !$CONFIG_TARGETSYS);
foreach my $mib (@HP_MIBS) { foreach my $mib (@HP_MIBS) {
my $localfile = "$MIBPATH/$mib.txt"; my $localfile = "$MIBPATH/$mib.txt";
......
...@@ -30,8 +30,8 @@ sub Install($$$) ...@@ -30,8 +30,8 @@ sub Install($$$)
" $WAP $CREATETYPE $NODETYPEXML"); " $WAP $CREATETYPE $NODETYPEXML");
}; };
# Do not run this in a genirack setup; must wait till later. # Do not run this in a targetsys setup; must wait till later.
if (!$PROTOGENI_GENIRACK) { if (!$CONFIG_TARGETSYS) {
Phase "adding", "Adding control nodes", sub { Phase "adding", "Adding control nodes", sub {
PhaseSkip("already added") PhaseSkip("already added")
if (defined(Node->Lookup("ops"))); if (defined(Node->Lookup("ops")));
......
...@@ -62,8 +62,8 @@ sub Install($$$) ...@@ -62,8 +62,8 @@ sub Install($$$)
" StrictHostKeyChecking no", " StrictHostKeyChecking no",
" Protocol 2"); " Protocol 2");
}; };
# GPO wants password authentication turned off. # We should probably turn off password authentication all the time.
if ($PROTOGENI_GENIRACK) { if ($CONFIG_TARGETSYS) {
Phase "sshdconfig", "Turning off password authentication", sub { Phase "sshdconfig", "Turning off password authentication", sub {
DoneIfEdited($SSHD_CONFIG); DoneIfEdited($SSHD_CONFIG);
......
...@@ -9,9 +9,9 @@ sub Install($$$) ...@@ -9,9 +9,9 @@ sub Install($$$)
{ {
my ($server, $isupdate, $impotent) = @_; my ($server, $isupdate, $impotent) = @_;
# Do not run this in a genirack setup; must wait till later. # Do not run this in a targetsys setup; must wait till later.
return 0 return 0
if ($PROTOGENI_GENIRACK && !$isupdate); if ($CONFIG_TARGETSYS && !$isupdate);
# #
# Initialize server IP/MAC sitevars (for ARP lockdown). # Initialize server IP/MAC sitevars (for ARP lockdown).
......
...@@ -130,8 +130,8 @@ sub Install($$$) ...@@ -130,8 +130,8 @@ sub Install($$$)
closedir(DIR); closedir(DIR);
my @default = "genirack-ops\@flux.utah.edu"; my @default = "genirack-ops\@flux.utah.edu";
if (exists($configvars{"GENIRACK_TBOPS"})) { if (exists($configvars{"TARGETSYS_TBOPS"})) {
@default = split(",", $configvars{"GENIRACK_TBOPS"}); @default = split(",", $configvars{"TARGETSYS_TBOPS"});
} }
foreach my $list (@lists) { foreach my $list (@lists) {
my @where = @default; my @where = @default;
...@@ -146,12 +146,12 @@ sub Install($$$) ...@@ -146,12 +146,12 @@ sub Install($$$)
Phase "emaillist", "Changing target for $list", sub { Phase "emaillist", "Changing target for $list", sub {
if ($list eq "testbed-logs" || $list eq "testbed-audit") { if ($list eq "testbed-logs" || $list eq "testbed-audit") {
@where = split(",", $configvars{"GENIRACK_TBLOGS"}) @where = split(",", $configvars{"TARGETSYS_TBLOGS"})
if (exists($configvars{"GENIRACK_TBLOGS"})); if (exists($configvars{"TARGETSYS_TBLOGS"}));
} }
elsif ($list eq "testbed-stated") { elsif ($list eq "testbed-stated") {
@where = split(",", $configvars{"GENIRACK_TBSTATED"}) @where = split(",", $configvars{"TARGETSYS_TBSTATED"})
if (exists($configvars{"GENIRACK_TBSTATED"})); if (exists($configvars{"TARGETSYS_TBSTATED"}));
} }
AppendToFileFatal($fname, @where); AppendToFileFatal($fname, @where);
}; };
...@@ -179,15 +179,15 @@ sub Install($$$) ...@@ -179,15 +179,15 @@ sub Install($$$)
my @strings = (); my @strings = ();
push(@strings, push(@strings,
"ifconfig_xn0=\"inet ". $configvars{"GENIRACK_OPSIP"} . "ifconfig_xn0=\"inet ". $configvars{"TARGETSYS_OPSIP"} .
" netmask " . $configvars{"GENIRACK_NETMASK"} . " -tso\""); " netmask " . $configvars{"TARGETSYS_NETMASK"} . " -tso\"");
# Actual default router. # Actual default router.
push(@strings, push(@strings,
"defaultrouter=\"" . $configvars{"GENIRACK_ROUTER"} . "\""); "defaultrouter=\"" . $configvars{"TARGETSYS_ROUTER"} . "\"");
# Going to lose all static routes below, so add this back. # Going to lose all static routes below, so add this back.
push(@strings, push(@strings,
"syslogd_flags=\"-a " . "syslogd_flags=\"-a " .
$configvars{"GENIRACK_NETWORK"} . "/24\""); $configvars{"TARGETSYS_NETWORK"} . "/24\"");
# Jail network. # Jail network.
push(@strings, push(@strings,
"ifconfig_xn0_alias0=\"inet 172.17.253.254 ". "ifconfig_xn0_alias0=\"inet 172.17.253.254 ".
......
...@@ -24,8 +24,8 @@ sub Install($$$) ...@@ -24,8 +24,8 @@ sub Install($$$)
my @strings = ("PermitRootLogin yes", my @strings = ("PermitRootLogin yes",
"Protocol 2"); "Protocol 2");
# GPO wants this turned off. # We should probably do this all the time
if ($PROTOGENI_GENIRACK) { if ($CONFIG_TARGETSYS) {
ExecQuietFatal("sed -i.orig ". ExecQuietFatal("sed -i.orig ".
" -e 's/PasswordAuth/#PasswordAuth/' ". " -e 's/PasswordAuth/#PasswordAuth/' ".
" -e 's/PermitRootLogin/#PermitRootLogin/' ". " -e 's/PermitRootLogin/#PermitRootLogin/' ".
......
#!/usr/bin/perl -w #!/usr/bin/perl -w