mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-26 08:55:24 +00:00 
			
		
		
		
	change empty_zones_enable in named.conf
This commit is contained in:
		| @@ -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. The default is yes. \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" . | ||||
|   | ||||
| @@ -587,6 +587,11 @@ sub process_request { | ||||
|         $ctx->{forwarders} = \@forwarders; | ||||
|     } | ||||
|  | ||||
|     my @options = xCAT::TableUtils->get_site_attribute("emptyzonesenable"); | ||||
|     my $empty_zones = $options[0]; | ||||
|     if (defined($empty_zones) and $empty_zones =~ /^yes$|^no$/) { | ||||
|         $ctx->{empty_zones_enable} = $empty_zones; | ||||
|     } | ||||
|     my @slave_ips; | ||||
|     my $dns_slaves = get_dns_slave(); | ||||
|     if (scalar @$dns_slaves) { | ||||
| @@ -1098,6 +1103,9 @@ 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 " . $_ . ";\n"; | ||||
|                         $skip = 1; | ||||
|                     } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { | ||||
|                         push @newnamed, "\tallow-transfer \{\n"; | ||||
|                         $skip = 1; | ||||
| @@ -1237,6 +1245,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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user