diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-20 21:24:54 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-20 21:24:54 -0200 |
commit | 3d9feb7f47151c9b828a5ff2e74d2f0d97ebab01 (patch) | |
tree | df97fe71507fd9eeed3deb08b87f41a503e75bbe /manifests/a.pp | |
parent | 999e4e426996f3169b0a8f647eee8e8ab4ec8c33 (diff) | |
parent | 88a39666e5b0ddf668baf93c111b549628f79704 (diff) | |
download | puppet-bind-3d9feb7f47151c9b828a5ff2e74d2f0d97ebab01.tar.gz puppet-bind-3d9feb7f47151c9b828a5ff2e74d2f0d97ebab01.tar.bz2 |
Merge branch 'master' of https://github.com/camptocamp/puppet-bind
Conflicts:
manifests/definitions/bind-mx.pp
Diffstat (limited to 'manifests/a.pp')
-rw-r--r-- | manifests/a.pp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/manifests/a.pp b/manifests/a.pp new file mode 100644 index 0000000..d457413 --- /dev/null +++ b/manifests/a.pp @@ -0,0 +1,43 @@ +# = 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, + record_type => 'A', + } + + if $ptr { + $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}.": + ensure => $ensure, + zone => $arpa_zone, + host => $name, + ttl => $ttl, + } + } + +} |