diff options
-rw-r--r-- | lib/puppet/provider/dns_zone/zonefile.rb | 10 | ||||
-rw-r--r-- | lib/puppet/type/dns_zone.rb | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/puppet/provider/dns_zone/zonefile.rb b/lib/puppet/provider/dns_zone/zonefile.rb index eaaea11..af2fedd 100644 --- a/lib/puppet/provider/dns_zone/zonefile.rb +++ b/lib/puppet/provider/dns_zone/zonefile.rb @@ -53,6 +53,16 @@ Puppet::Type.type(:dns_zone).provide :zonefile do create end + def ns + zone = get_zone(resource[:zone]) + zone.ns.map {|record| record[:host] } + end + + def ns=(value) + zone = get_zone(resource[:zone]) + zone.ns = value.map {|s| { :name => '@', :ttl => resource[:ns_ttl], :host => s } } + end + def email zone = get_zone(resource[:zone]) zone.soa[:email] diff --git a/lib/puppet/type/dns_zone.rb b/lib/puppet/type/dns_zone.rb index e13c2d3..13acd54 100644 --- a/lib/puppet/type/dns_zone.rb +++ b/lib/puppet/type/dns_zone.rb @@ -52,6 +52,15 @@ Puppet::Type.newtype(:dns_zone) do newparam(:zone, :namevar => true) do end + newparam(:ns_ttl) do + desc "TTL for NS records" + defaultto '1w' + end + + newproperty(:ns, :array_matching => :all) do + desc "Nameservers for this zone" + end + newproperty(:primary) do desc "Primary nameserver for this zone" end |