Merge branch 'view-servers'

This commit is contained in:
Nate Riffe 2015-10-24 09:18:46 -05:00
commit 15d61bcefc
3 changed files with 35 additions and 0 deletions

View File

@ -227,6 +227,30 @@ and queries for the `example.org` domain are handled using a declared zone (see
],
}
View declarations can also include server clause configuration. The `servers`
property of `bind::view` accepts an array value which specifies each `server`
clause in the view as a hash. The hash must contain an `ip_addr` key which
specifies the IP address (optionally, a CIDR address range), and may contain a
`keys` key with a string value. The value of `keys` will be used as the name of
a key in the `server` clause. In this example, the `ns` view will contain a
`server` clause that configures BIND to use the key `internal-ns` to TSIG-sign
transactions with `192.168.24.2` and the key `hurricane-electric` to TSIG-sign
transactions with `216.218.130.2`:
bind::view { 'ns':
servers => [
{
'ip_addr' => '192.168.24.2',
'keys' => 'internal-ns',
},
{
'ip_addr' => '216.218.130.2',
'keys' => 'hurricane-electric',
}
],
...
}
###resource_record
Declares a resource record. For exampmle:

View File

@ -3,6 +3,7 @@
define bind::view (
$match_clients = 'any',
$match_destinations = '',
$servers = {},
$zones = [],
$recursion = true,
$recursion_match_clients = 'any',

View File

@ -34,6 +34,16 @@ view "<%= @name %>" {
};
<%- end -%>
<%- end -%>
<%- if @servers and @servers.is_a?(Array) -%>
<%- @servers.each do |properties| -%>
<%- raise Puppet::Error, 'view servers must have an ip_addr key' unless properties.has_key?('ip_addr') -%>
server <%= properties['ip_addr'] %> {
<%- if properties.has_key?('keys') and properties['keys'] != '' -%>
keys { <%= properties['keys'] %>; };
<%- end -%>
};
<%- end -%>
<%- end -%>
<%- if scope.lookupvar('osfamily') == 'Debian' -%>
include "<%= @confdir %>/named.conf.default-zones";
<%- end -%>