diff options
Diffstat (limited to 'manifests/a.pp')
-rw-r--r-- | manifests/a.pp | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/manifests/a.pp b/manifests/a.pp index 41fdee8..d457413 100644 --- a/manifests/a.pp +++ b/manifests/a.pp @@ -1,34 +1,35 @@ -/* - -= Definition: bind::a -Creates an IPv4 record. - -Arguments: - *$zone*: Bind::Zone name - *$owner*: owner of the Resource Record - *$host*: target of the Resource Record - *$ttl*: Time to Live for the Resource Record. Optional. - *$ptr*: create the corresponding ptr record (default=false) - -*/ -define bind::a($ensure=present, - $zone, - $owner=false, - $host, - $ttl=false, - $ptr=false) { +# = Definition: bind::a +# +# Creates an IPv4 record. +# +# Arguments: +# *$zone*: Bind::Zone name +# *$owner*: owner of the Resource Record +# *$host*: target of the Resource Record +# *$ttl*: Time to Live for the Resource Record. Optional. +# *$ptr*: create the corresponding ptr record (default=false) +# +# +define bind::a( + $zone, + $host, + $ensure = present, + $owner = false, + $ttl = false, + $ptr = false +) { bind::record {$name: - ensure => $ensure, - zone => $zone, - owner => $owner, - host => $host, - ttl => $ttl, + ensure => $ensure, + zone => $zone, + owner => $owner, + host => $host, + ttl => $ttl, record_type => 'A', } if $ptr { - $arpa = inline_template("<%= require 'ipaddr'; IPAddr.new(host).reverse %>") + $arpa = inline_template("<%= require 'ipaddr'; IPAddr.new(host).reverse %>") $arpa_zone = inline_template("<%= require 'ipaddr'; IPAddr.new(host).reverse.split('.')[1..-1].join('.') %>") bind::ptr {"${arpa}.": @@ -38,4 +39,5 @@ define bind::a($ensure=present, ttl => $ttl, } } + } |