fix: enable dynamic/tsig updates
- add eyaml to hiera.yaml - consolidate all paths into single tree - change to new profiles::dns::client wrapper - change to new profiles::dns::record wrapper - change to use concat method to build zone file
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
# profiles::dns::master authoritative service
|
||||
class profiles::dns::master (
|
||||
Array[String] $nameservers,
|
||||
Stdlib::AbsolutePath $basedir,
|
||||
Hash $acls = {},
|
||||
Hash $zones = {},
|
||||
Hash $views = {},
|
||||
Hash $keys = {},
|
||||
Hash[
|
||||
String,
|
||||
String
|
||||
] $tags = {},
|
||||
String $owner = 'root',
|
||||
String $group = 'named',
|
||||
Boolean $dnssec = false,
|
||||
){
|
||||
|
||||
@@ -14,14 +19,29 @@ class profiles::dns::master (
|
||||
acls => $acls,
|
||||
zones => $zones,
|
||||
views => $views,
|
||||
keys => $keys,
|
||||
forwarders => [],
|
||||
dnssec => $dnssec,
|
||||
}
|
||||
|
||||
# collect records
|
||||
$tags.each | String $key, String $tag_value | {
|
||||
if $tag_value != undef {
|
||||
Resource_record <<| tag == $tag_value |>>
|
||||
# ensure the target basedir exists
|
||||
file { $basedir:
|
||||
ensure => directory,
|
||||
owner => $owner,
|
||||
group => $group,
|
||||
}
|
||||
|
||||
# create zones
|
||||
$zones.each | String $name, Hash $data | {
|
||||
if $data['zone_type'] == 'master' {
|
||||
profiles::dns::zone { $name:
|
||||
zone => $data['domain'],
|
||||
basedir => $basedir,
|
||||
nameservers => $nameservers,
|
||||
owner => $owner,
|
||||
group => $group,
|
||||
before => Bind::Zone[$name]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user