Skip to content

Allow Zone file to be created from a template #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/puppet_bind/provider/nsupdate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def update(&block)
yield file
file.write "send\n"
file.close
#puts File.read(file.path)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you get rid of this please?

if keyed?
nsupdate('-y', tsig_param, file.path)
elsif keyfile?
Expand Down
29 changes: 21 additions & 8 deletions manifests/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
$forwarders = '',
$forward = '',
$source = '',
$content = '',
$forwarders_port = 53,
) {
# where there is a zone, there is a server
Expand Down Expand Up @@ -102,14 +103,26 @@
}

if member(['init', 'managed'], $zone_file_mode) {
file { "${cachedir}/${name}/${zone_file}":
ensure => present,
owner => $bind_user,
group => $bind_group,
mode => '0644',
replace => ($zone_file_mode == 'managed'),
source => pick($source, 'puppet:///modules/bind/db.empty'),
audit => [ content ],
if ! empty($content) {
file { "${cachedir}/${name}/${zone_file}":
ensure => present,
owner => $bind_user,
group => $bind_group,
mode => '0644',
replace => ($zone_file_mode == 'managed'),
content => $content,
audit => [ content ],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to get rid of the audit parameters on this and the other file resource. They've been removed on master, and that's the source of the merge conflict.

}
} else {
file { "${cachedir}/${name}/${zone_file}":
ensure => present,
owner => $bind_user,
group => $bind_group,
mode => '0644',
replace => ($zone_file_mode == 'managed'),
source => pick($source, 'puppet:///modules/bind/db.empty'),
audit => [ content ],
}
}
}

Expand Down