Add a parameter to `bind::zone` which indicates whether a zone is dynamic or not. This has the effect of allowing puppet to manage the zone file rather than simply initialize it. This change also introduces more appropriate handling of slave and stub zones, so that puppet will not populate a stock zone file, forcing the nameserver to do a zone transfer when a zone is created. Also, there is now a substancial amount of validation in the `bind::zone` class in order to prevent invalid parameter combinations, so that validity may be assumed elsewhere in the manifest and in the configuration template.
68 lines
1.7 KiB
Plaintext
68 lines
1.7 KiB
Plaintext
|
|
# This file managed by puppet - changes will be lost
|
|
zone "<%= @_domain %>" {
|
|
type <%= @zone_type %>;
|
|
<%- if @dnssec -%>
|
|
auto-dnssec maintain;
|
|
<%- if @key_directory and @key_directory != '' -%>
|
|
key-directory "<%= @key_directory %>";
|
|
<%- else -%>
|
|
key-directory "<%= @cachedir %>/<%= @name %>";
|
|
<%- end -%>
|
|
file "<%= @cachedir %>/<%= @name %>/<%= @_domain %>.signed";
|
|
<%- elsif %w(init managed allowed).include? @zone_file_mode -%>
|
|
file "<%= @cachedir %>/<%= @name %>/<%= @_domain %>";
|
|
<%- end -%>
|
|
<%- if %w(master slave).include? @zone_type -%>
|
|
notify <%= @ns_notify ? 'yes' : 'no' %>;
|
|
<%- end -%>
|
|
<%- if @also_notify and @also_notify != '' -%>
|
|
also-notify {
|
|
<%- Array(@also_notify).each do |server| -%>
|
|
<%= server %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
<%- if @allow_notify and @allow_notify != '' -%>
|
|
allow-notify {
|
|
<%- Array(@allow_notify).each do |server| -%>
|
|
<%= server %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
<%- if @masters and @masters != '' -%>
|
|
masters {
|
|
<%- Array(@masters).each do |master| -%>
|
|
<%= master %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
<%- if @transfer_source and @transfer_source != ''-%>
|
|
transfer-source <%= @transfer_source %>;
|
|
<%- end -%>
|
|
<%- if @allow_updates and @allow_updates != '' -%>
|
|
allow-update {
|
|
<%- Array(@allow_updates).each do |allow_update| -%>
|
|
<%= allow_update %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
<%- if @allow_transfers and @allow_transfers != '' -%>
|
|
allow-transfer {
|
|
<%- Array(@allow_transfers).each do |allow_transfer| -%>
|
|
<%= allow_transfer %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
<%- if @forward != '' -%>
|
|
forward <%= @forward %>;
|
|
<%- end -%>
|
|
<%- if @forwarders and @forwarders != '' -%>
|
|
forwarders {
|
|
<%- Array(@forwarders).each do |forwarder| -%>
|
|
<%= forwarder %>;
|
|
<%- end -%>
|
|
};
|
|
<%- end -%>
|
|
};
|