summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/dns_zones.pp19
1 files changed, 11 insertions, 8 deletions
diff --git a/manifests/dns_zones.pp b/manifests/dns_zones.pp
index 1ce636a..f4bf630 100644
--- a/manifests/dns_zones.pp
+++ b/manifests/dns_zones.pp
@@ -8,6 +8,7 @@ class profiles::dns_zones (
String $default_view = '_GLOBAL_',
Hash $zonedata_default = {},
Hash[String,Hash] $zonedata = {},
+ Hash[String,Array[Hash]] $records = {},
) {
if $views != undef {
@@ -25,14 +26,16 @@ class profiles::dns_zones (
Dns_record <<| zone == $zone |>>
}
- $zone_hash = Hash(lookup('dns_zones."adrift.space"').map |$d| {
- ["adrift.space ${d['type']} ${d['key']} ${d['value']}", $d]
- })
+ $records.each |$zone, $record_entries| {
+ $zone_hash = $record_entries.map |$d| {
+ $type = $d['type']
+ $key = $d['key']
+ $value = $d['value']
+ ["${zone} ${type} ${key} ${value}", $d]
+ }
+
+ create_resources(dns_record, Hash($zone_hash), { 'zone' => $zone, })
+ }
- create_resources(dns_record, $zone_hash, {
- # 'ensure' => 'present',
- 'zone' => 'adrift.space',
- # 'notify' => Dns_zone['adrift.space'],
- })
}