Have autoula addressing store in hosts.ip for KICKSTARTNET directive

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13164 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-06-25 20:05:11 +00:00
parent f590db8fc4
commit 2e7f1599fe

View File

@ -234,15 +234,19 @@ sub subvars {
sub kickstartnetwork {
my $line = "network --bootproto=";
my $hoststab;
my $mactab = xCAT::Table->new('mac',-create=>0);
unless ($mactab) { die "mac table should always exist prior to flexcat specific template processing"; }
unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
my $ent = $mactab->getNodeAttribs($node,['mac']);
unless ($ent and $ent->{mac}) { die "missing mac data for $node"; }
my $suffix = $ent->{mac};
$suffix = lc($suffix);
if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
unless ($hoststab) { $hoststab = xCAT::Table->new('hosts',-create=>1); }
$line .= "static --device=$suffix --noipv4 --ipv6=";
$line .= autoulaaddress($suffix);
my $ulaaddr = autoulaaddress($suffix);
$hoststab->setNodeAttribs($node,{ip=>$ulaaddr});
$line .= $ulaaddr;
} else {
$line .= "dhcp";
}