]> gitweb.fluxo.info Git - puppet-bind.git/commitdiff
switch from common::concatfilepart to concat[1]
authorMathieu Bornoz <mathieu.bornoz@camptocamp.com>
Thu, 2 Aug 2012 07:30:21 +0000 (09:30 +0200)
committerMathieu Bornoz <mathieu.bornoz@camptocamp.com>
Thu, 2 Aug 2012 07:30:21 +0000 (09:30 +0200)
[1] https://github.com/camptocamp/puppet-concat

manifests/base.pp
manifests/init.pp
manifests/mx.pp
manifests/record.pp
manifests/zone.pp

index c4420852faf5235ec1f6a01a18ce46f36df0a0d5..752ed580bc5b1c1926f73955562d3d38228eb5f1 100644 (file)
@@ -8,6 +8,15 @@ Please refer to Class["bind"].
 
 */
 class bind::base {
+
+  include concat::setup
+
+  concat {'/etc/bind/named.conf.local':
+    owner => root,
+    group => root,
+    mode  => '0644',
+  }
+
   package {"bind9":
     ensure => present,
   }
@@ -18,11 +27,11 @@ class bind::base {
     require => Package["bind9"],
   }
 
-  file {["/etc/bind/pri", "/etc/bind/zones"]:
-    ensure => directory,
-    owner  => root,
-    group  => root,
-    mode   => 0755,
+  file {'/etc/bind/zones':
+    ensure  => directory,
+    owner   => root,
+    group   => root,
+    mode    => 0755,
     require => Package["bind9"],
     purge   => true,
     force   => true,
index d9af70871d8c5acbe017adddabe8ee910d8b2051..f81874a5137bb09b1766a6a00d14a0dbb63fbe17 100644 (file)
@@ -3,9 +3,6 @@
 = Class: bind
 Include this class to install bind9 server on your node.
 
-Requires:
-- module common (git://github.com/camptocamp/puppet-common.git)
-
 Bind documentation:
 http://www.bind9.net/manuals
 
index 84a2b9f52ce9b76b953eabcc081da87b7c96b9bb..433c8ead28ffa1ba29125c7959c0a31ed95ac844 100644 (file)
@@ -24,11 +24,11 @@ define bind::mx($ensure=present,
     $_owner = $name
   }
 
-  common::concatfilepart{"bind.${name}":
-    file    => "/etc/bind/pri/${zone}",
+  concat::fragment {"bind.${name}":
     ensure  => $ensure,
-    notify  => Service["bind9"],
+    target  => "/etc/bind/pri/${zone}.conf",
     content => template("bind/mx-record.erb"),
+    notify  => Service["bind9"],
     require => [Bind::Zone[$zone], Bind::A[$host]],
   }
 }
index d551d609c93eac11e440f7b49079ccfce0172bbe..ef53833bed448bdb23113597b0af25259a8b8aae 100644 (file)
@@ -26,9 +26,9 @@ define bind::record($ensure=present,
     $_owner = $name
   }
 
-  common::concatfilepart {"${zone}.${record_type}.${name}":
+  concat::fragment {"${zone}.${record_type}.${name}":
     ensure  => $ensure,
-    file    => "/etc/bind/pri/${zone}.conf",
+    target  => "/etc/bind/pri/${zone}.conf",
     content => template("bind/default-record.erb"),
     notify  => Service["bind9"],
   }
index 62df7fc3f8904a9597c9b1b6ff5d88466e4da9fc..68295695d6a530fd75e13b2da4f0fb8b25ba35f0 100644 (file)
@@ -29,19 +29,31 @@ define bind::zone($ensure=present,
     $zone_xfers=false,
     $zone_masters=false,
     $zone_origin=false) {
+  
+  concat {"/etc/bind/pri/${name}.conf":
+    owner => root,
+    group => root,
+    mode  => '0644',
+  }
+  concat {"/etc/bind/zones/${name}.conf":
+    owner => root,
+    group => root,
+    mode  => '0644',
+  }
 
-  common::concatfilepart {"bind.zones.${name}":
+  concat::fragment {"bind.zones.${name}":
     ensure  => $ensure,
+    target  => "/etc/bind/zones/${name}.conf",
     notify  => Service["bind9"],
-    file    => "/etc/bind/zones/${name}.conf",
     require => Package["bind9"],
   }
 
-  common::concatfilepart {"named.local.zone.${name}":
+  concat::fragment {"named.local.zone.${name}":
     ensure  => $ensure,
-    notify  => Service["bind9"],
-    file    => "/etc/bind/named.conf.local",
+    target  => "/etc/bind/named.conf.local",
     content => "include \"/etc/bind/zones/${name}.conf\";\n",
+    notify  => Service["bind9"],
     require => Package["bind9"],
   }
 
@@ -49,7 +61,7 @@ define bind::zone($ensure=present,
     if !$zone_masters {
       fail "No master defined for ${name}!"
     }
-    Common::Concatfilepart["bind.zones.${name}"] {
+    Concat::Fragment["bind.zones.${name}"] {
       content => template("bind/zone-slave.erb"),
     }
 ## END of slave
@@ -67,21 +79,21 @@ define bind::zone($ensure=present,
       fail "No ttl defined for ${name}!"
     }
 
-    Common::Concatfilepart["bind.zones.${name}"] {
+    Concat::Fragment["bind.zones.${name}"] {
       content => template("bind/zone-master.erb"),
     }
 
-    common::concatfilepart {"00.bind.${name}":
-      ensure => $ensure,
-      file   => "/etc/bind/pri/${name}.conf",
+    concat::fragment {"00.bind.${name}":
+      ensure  => $ensure,
+      target  => "/etc/bind/pri/${name}.conf",
       content => template("bind/zone-header.erb"),
       require => Package["bind9"],
     }
 
     file {"/etc/bind/pri/${name}.conf.d":
-      ensure => directory,
-      mode   => 0700,
-      purge  => true,
+      ensure  => absent,
+      mode    => 0700,
+      purge   => true,
       recurse => true,
       backup  => false,
       force   => true,