diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 3c5da55e6..79368d157 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -25,7 +25,6 @@ my $lastmachinepass; my %tab_replacement=( "noderes:nfsserver"=>"noderes:xcatmaster", "noderes:tftpserver"=>"noderes:xcatmaster", - "noderes:xcatmaster"=>"site:key=master:value", ); @@ -69,6 +68,10 @@ sub subvars { if ($et and $et->{value}) { $master = $et->{value}; } + my $ipfn = xCAT::Utils->my_ip_facing($node); + if ($ipfn) { + $master = $ipfn; + } $et = $noderestab->getNodeAttribs($node,['xcatmaster']); if ($et and $et->{'xcatmaster'}) { $master = $et->{'xcatmaster'}; @@ -419,6 +422,12 @@ sub tabdb $tabh->close; unless($ent and defined($ent->{$field})) { unless ($blankok) { + if ($field eq "xcatmaster") { + my $ipfn = xCAT::Utils->my_ip_facing($node); + if ($ipfn) { + return $ipfn; + } + } #$tmplerr="Unable to find requested $field from $table, with $key"; my $rep=get_replacement($table,$key,$field); if ($rep) {