2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Merge pull request #4650 from bybai/emptyzone

change empty_zones_enable in named.conf
This commit is contained in:
zet809 2018-01-18 16:20:15 +08:00 committed by GitHub
commit 4bfaba915d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -1057,6 +1057,7 @@ passed as argument rather than by table value',
" requests it does not know to these servers. Note that the DNS servers on the\n" .
" service nodes will ignore this value and always be configured to forward \n" .
" to the management node.\n\n" .
" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n"
" master: The hostname of the xCAT management node, as known by the nodes.\n\n" .
" nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" .
" use. This value will end up in the nameserver settings of the\n" .

View File

@ -587,6 +587,18 @@ sub process_request {
$ctx->{forwarders} = \@forwarders;
}
my @options = xCAT::TableUtils->get_site_attribute("emptyzonesenable");
my $empty_zones = $options[0];
if (defined($empty_zones)) {
if ($empty_zones =~ /^yes$|^no$/) {
$ctx->{empty_zones_enable} = $empty_zones;
} else {
my $rsp;
push @{ $rsp->{data} }, "emptyzonesenable from xCAT site table should be yes or no.";
xCAT::MsgUtils->message("E", $rsp, $callback);
return;
}
}
my @slave_ips;
my $dns_slaves = get_dns_slave();
if (scalar @$dns_slaves) {
@ -1098,6 +1110,8 @@ sub update_namedconf {
push @newnamed, "\t\t" . $_ . ";\n";
}
push @newnamed, "\t};\n";
} elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) {
push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n";
} elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) {
push @newnamed, "\tallow-transfer \{\n";
$skip = 1;
@ -1237,6 +1251,10 @@ sub update_namedconf {
push @newnamed, "\t};\n";
}
if ($ctx->{empty_zones_enable}){
push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n";
}
if ($slave) {
push @newnamed, "\tallow-transfer { any; };\n";
} else {