Add dynamic parameter to bind::zone

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.
This commit is contained in:
Nate Riffe
2015-05-14 11:14:48 -05:00
parent ebe75830c6
commit 9f5c4bacb0
3 changed files with 101 additions and 71 deletions
+16 -18
View File
@@ -2,35 +2,33 @@
# This file managed by puppet - changes will be lost
zone "<%= @_domain %>" {
type <%= @zone_type %>;
<%- if @has_zone_file -%>
<%- if @dnssec -%>
<%- if @dnssec -%>
auto-dnssec maintain;
<%- if @key_directory and @key_directory != '' -%>
<%- if @key_directory and @key_directory != '' -%>
key-directory "<%= @key_directory %>";
<%- else -%>
key-directory "<%= @cachedir %>/<%= @name %>";
<%- end -%>
file "<%= @cachedir %>/<%= @name %>/<%= @_domain %>.signed";
<%- 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 -%>
<%- unless @zone_type == 'stub' -%>
<%- end -%>
<%- if %w(master slave).include? @zone_type -%>
notify <%= @ns_notify ? 'yes' : 'no' %>;
<%- end -%>
<%- if @also_notify and @also_notify != '' -%>
<%- end -%>
<%- if @also_notify and @also_notify != '' -%>
also-notify {
<%- Array(@also_notify).each do |server| -%>
<%- Array(@also_notify).each do |server| -%>
<%= server %>;
<%- end -%>
};
<%- end -%>
<%- if @allow_notify and @allow_notify != '' -%>
};
<%- end -%>
<%- if @allow_notify and @allow_notify != '' -%>
allow-notify {
<%- Array(@allow_notify).each do |server| -%>
<%- Array(@allow_notify).each do |server| -%>
<%= server %>;
<%- end -%>
};
<%- end -%>
};
<%- end -%>
<%- if @masters and @masters != '' -%>
masters {