summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-15 22:45:59 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-16 15:37:14 +0100
commit0066e5bb4bd181df63a7415a10929dc513936238 (patch)
treece3eb41d114f880ef05a47209664f7b77a11a709
parentCreate new zone if file doesn't exist. (diff)
downloaddns_record-0066e5bb4bd181df63a7415a10929dc513936238.tar.gz
dns_record-0066e5bb4bd181df63a7415a10929dc513936238.tar.xz
Document want for zone_file path setting.
-rw-r--r--lib/puppet/functions/zones.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/functions/zones.rb b/lib/puppet/functions/zones.rb
index 2f675d4..ef54427 100644
--- a/lib/puppet/functions/zones.rb
+++ b/lib/puppet/functions/zones.rb
@@ -6,6 +6,14 @@ def get_zone(zone_name)
end
if ! $zones[zone_name]
+ # TODO templetize this path!
+ # I would prefer if the user did something like
+ # class { 'dns_record':
+ # zone_pattern => '/var/named/dynamic/db.%s',
+ # }
+ # and here we used dns_record.zone_pattern.
+ # But I don't know how.
+ # Functions have the method `closure_scope` but we dont't.
zone_file = "/var/named/dynamic/db.#{zone_name}"
if File.exists?(zone_file)
$zones[zone_name] = Zonefile.from_file(zone_file, "#{zone_name}.")