thias / puppet-bind

Puppet BIND DNS server module
Other
26 stars 106 forks source link

dynamic overwrite? #68

Open gameforce opened 8 years ago

gameforce commented 8 years ago

How do you prevent this from overwriting dynamic updates?

qs5779 commented 7 years ago

I add my dynamic zones via an include directive and manage their initial zone file outside the module where I can specify "replace => no"

gameforce commented 7 years ago

@qs5779 this is what I was trying to do but I'm a bit new to this could you give an example that I can use?

qs5779 commented 7 years ago

the excerpt below is from my setup with file names, ip addresses, hostnames and domain names changed for example

$varnameddynfiles = [ '12.168.192.ip4.ddns.rdns', '6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.2.ip6.ddns.rdns', 'my.sub.domain.com.ddns.zone', 'mydomain.ddns.zone' ]

$varnameddynfiles.each | $fn | { file { "/var/named/dynamic/${fn}": ensure => present, group => 'named', mode => '0640', replace => 'no', source => "puppet:///modules/profile/var/named/dynamic/${fn}" } }

$views = { 'a_local_resolver' => { match-clients => [ '!key inside', '!key outside', 'localhost' ], recursion => 'yes', includes => [ '/var/named/my.view.localhost.zones', '/etc/named.rfc1912.zones' ] }, 'b_inside' => { match-clients => [ 'key inside', 'my_locnets' ], recursion => 'yes', includes => [ '/var/named/my.view.inside.zones', '/etc/named.rfc1912.zones' ] }, 'c_outside' => { match-clients => [ 'any' ], includes => [ '/var/named/my.view.outside.zones' ] } }

in the above configuration my local view is the master for my dynamic zones and inside and outside are slaves

i have four dynamic zones two regular and two reverse, the private reverse zone is not in the outside view, and one of the regular zones is not in the outside view.

in this configuration the 4 base files are only used for the initial server setup as replace is "no", and after the server starts they are updated dynamically.

on occasions when i need to update ( add or delete ) a static entry i have to update the dynamic files and static files.

someday i hope to generate the originals and verify / update the dynamic files from a database, but that will only happen if I get around to it