summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>2010-11-29 09:46:46 +0100
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>2010-11-29 09:46:46 +0100
commitb3e5b6e81fad0181f2d884f35efa875c7b7fa0e1 (patch)
tree14e4de78960081f77ccd127e42eb729543c45ee4
parentf8510094599c2233422a2ba3fa5cf5268c94af84 (diff)
downloadpuppet-bind-b3e5b6e81fad0181f2d884f35efa875c7b7fa0e1.tar.gz
puppet-bind-b3e5b6e81fad0181f2d884f35efa875c7b7fa0e1.tar.bz2
bind - simplification for bind::* definitions.
namevar can be used as "$owner", if $owner is not set.
-rw-r--r--manifests/definitions/bind-a.pp2
-rw-r--r--manifests/definitions/bind-aaaa.pp2
-rw-r--r--manifests/definitions/bind-cname.pp2
-rw-r--r--manifests/definitions/bind-mx.pp8
-rw-r--r--manifests/definitions/bind-ns.pp2
-rw-r--r--manifests/definitions/bind-record.pp8
-rw-r--r--templates/default-record.erb4
7 files changed, 20 insertions, 8 deletions
diff --git a/manifests/definitions/bind-a.pp b/manifests/definitions/bind-a.pp
index b0947d1..3f30187 100644
--- a/manifests/definitions/bind-a.pp
+++ b/manifests/definitions/bind-a.pp
@@ -12,7 +12,7 @@ Arguments:
*/
define bind::a($ensure=present,
$zone,
- $owner,
+ $owner=false,
$host,
$ttl=false) {
diff --git a/manifests/definitions/bind-aaaa.pp b/manifests/definitions/bind-aaaa.pp
index e91e162..80291c2 100644
--- a/manifests/definitions/bind-aaaa.pp
+++ b/manifests/definitions/bind-aaaa.pp
@@ -12,7 +12,7 @@ Arguments:
*/
define bind::aaaa($ensure=present,
$zone,
- $owner,
+ $owner=false,
$host,
$ttl=false) {
diff --git a/manifests/definitions/bind-cname.pp b/manifests/definitions/bind-cname.pp
index d5e8209..c8baeec 100644
--- a/manifests/definitions/bind-cname.pp
+++ b/manifests/definitions/bind-cname.pp
@@ -12,7 +12,7 @@ Arguments:
*/
define bind::cname($ensure=present,
$zone,
- $owner,
+ $owner=false,
$host,
$ttl=false) {
diff --git a/manifests/definitions/bind-mx.pp b/manifests/definitions/bind-mx.pp
index 5090932..84a2b9f 100644
--- a/manifests/definitions/bind-mx.pp
+++ b/manifests/definitions/bind-mx.pp
@@ -13,11 +13,17 @@ Arguments:
*/
define bind::mx($ensure=present,
$zone,
- $owner,
+ $owner=false,
$priority,
$host,
$ttl=false) {
+ if $owner {
+ $_owner = $owner
+ } else {
+ $_owner = $name
+ }
+
common::concatfilepart{"bind.${name}":
file => "/etc/bind/pri/${zone}",
ensure => $ensure,
diff --git a/manifests/definitions/bind-ns.pp b/manifests/definitions/bind-ns.pp
index 065575f..3d07aea 100644
--- a/manifests/definitions/bind-ns.pp
+++ b/manifests/definitions/bind-ns.pp
@@ -12,7 +12,7 @@ Arguments:
*/
define bind::ns($ensure=present,
$zone,
- $owner,
+ $owner=false,
$host,
$ttl=false) {
diff --git a/manifests/definitions/bind-record.pp b/manifests/definitions/bind-record.pp
index 5436a99..d551d60 100644
--- a/manifests/definitions/bind-record.pp
+++ b/manifests/definitions/bind-record.pp
@@ -14,12 +14,18 @@ Arguments:
*/
define bind::record($ensure=present,
$zone,
- $owner,
+ $owner=false,
$host,
$record_type,
$record_class='IN',
$ttl=false) {
+ if $owner {
+ $_owner = $owner
+ } else {
+ $_owner = $name
+ }
+
common::concatfilepart {"${zone}.${record_type}.${name}":
ensure => $ensure,
file => "/etc/bind/pri/${zone}.conf",
diff --git a/templates/default-record.erb b/templates/default-record.erb
index 112ae2f..16b839f 100644
--- a/templates/default-record.erb
+++ b/templates/default-record.erb
@@ -1,5 +1,5 @@
<% if ttl -%>
-<%=owner%> <%=ttl%> <%=record_class%> <%=record_type%> <%=host%>
+<%=_owner%> <%=ttl%> <%=record_class%> <%=record_type%> <%=host%>
<% else -%>
-<%=owner%> <%=record_class%> <%=record_type%> <%=host%>
+<%=_owner%> <%=record_class%> <%=record_type%> <%=host%>
<% end -%>