]> gitweb.fluxo.info Git - puppet-bind.git/commitdiff
lint + cosmetics
authorMathieu Bornoz <mathieu.bornoz@camptocamp.com>
Thu, 2 Aug 2012 09:24:52 +0000 (11:24 +0200)
committerMathieu Bornoz <mathieu.bornoz@camptocamp.com>
Thu, 2 Aug 2012 09:24:52 +0000 (11:24 +0200)
12 files changed:
manifests/a.pp
manifests/aaaa.pp
manifests/base.pp
manifests/cname.pp
manifests/debian.pp
manifests/init.pp
manifests/mx.pp
manifests/ns.pp
manifests/ptr.pp
manifests/record.pp
manifests/txt.pp
manifests/zone.pp

index 41fdee869cd57259cc413b5cd5a9d2ca37afc5ea..d457413bcd8c2480e7e562dd879794ed8e24c0f7 100644 (file)
@@ -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,
     }
   }
+
 }
index 80291c2c8be4a43ec506a22693976ec66dac9369..9466d0f513d36b10f0ea4170837348a855467828 100644 (file)
@@ -1,27 +1,27 @@
-/*
-
-= Definition: bind::aaaa
-Creates an IPv6 AAAA 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.
-
-*/
-define bind::aaaa($ensure=present,
-    $zone,
-    $owner=false,
-    $host,
-    $ttl=false) {
+# = Definition: bind::aaaa
+#
+# Creates an IPv6 AAAA 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.
+#
+define bind::aaaa (
+  $zone,
+  $host,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = 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 => 'AAAA',
   }
 
index 752ed580bc5b1c1926f73955562d3d38228eb5f1..63eefbcdd6a832d403f546e6e3477971ef5c5cbe 100644 (file)
@@ -1,12 +1,9 @@
-/*
-
-= Class: bind::base
-
-Declares some basic resources.
-You should NOT include this class as is, as it won't work at all!
-Please refer to Class["bind"].
-
-*/
+# = Class: bind::base
+#
+# Declares some basic resources.
+# You should NOT include this class as is, as it won't work at all!
+# Please refer to Class['bind'].
+#
 class bind::base {
 
   include concat::setup
@@ -17,25 +14,26 @@ class bind::base {
     mode  => '0644',
   }
 
-  package {"bind9":
+  package {'bind9':
     ensure => present,
   }
 
-  service {"bind9":
+  service {'bind9':
     ensure  => running,
     enable  => true,
-    require => Package["bind9"],
+    require => Package['bind9'],
   }
 
   file {'/etc/bind/zones':
     ensure  => directory,
     owner   => root,
     group   => root,
-    mode    => 0755,
-    require => Package["bind9"],
+    mode    => '0755',
     purge   => true,
     force   => true,
     recurse => true,
-    source  => "puppet:///modules/bind/empty",
+    source  => 'puppet:///modules/bind/empty',
+    require => Package['bind9'],
   }
+
 }
index c8baeec0710513a800062416415a3a0640dc3f71..f8eca40ce0e7ab62ce1fe24a5a551c92e0c6ef92 100644 (file)
@@ -1,27 +1,28 @@
-/*
-
-= Definition: bind::cname
-Creates a CNAME 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.
-
-*/
-define bind::cname($ensure=present,
-    $zone,
-    $owner=false,
-    $host,
-    $ttl=false) {
+# = Definition: bind::cname
+#
+# Creates a CNAME 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.
+#
+define bind::cname (
+  $zone,
+  $host,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = 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 => 'CNAME',
   }
+
 }
index 7b752aededdc422924e2940ef43e504e0f8e6985..41e356eff7fde9a13e172271596f7bb5a97da87d 100644 (file)
@@ -1,14 +1,13 @@
-/*
-
-= Class: bind::debian
-Special debian class - inherits from bind::base
-
-You should not include this class - please refer to Class["bind"]
-
-*/
+# = Class: bind::debian
+# Special debian class - inherits from bind::base
+#
+# You should not include this class - please refer to Class["bind"]
+#
 class bind::debian inherits bind::base {
-  Service["bind9"] {
-    pattern => "/usr/sbin/named",
-    restart => "/etc/init.d/bind9 reload",
+
+  Service['bind9'] {
+    pattern => '/usr/sbin/named',
+    restart => '/etc/init.d/bind9 reload',
   }
+
 }
index f81874a5137bb09b1766a6a00d14a0dbb63fbe17..ff8873793b0ba40c2919044707caa81a8f6ec9f7 100644 (file)
@@ -1,51 +1,53 @@
-/*
-
-= Class: bind
-Include this class to install bind9 server on your node.
-
-Bind documentation:
-http://www.bind9.net/manuals
-
-Limitations:
-This modules is valid for Bind 9.7.1 (squeeze version).
-For 9.7.2, it will be really limited (no view nor ACL support).
-
-
-Example:
-
-node "ns1.domain.ltd" {
-  include bind
-  bind::zone {"domain.ltd":
-    ensure => present,
-    zone_contact => "contact.domain.ltd",
-    zone_ns      => $fqdn,
-    zone_serial  => "2010110804",
-    zone_ttl     => "604800",
-  }
-
-  bind::a {"ns $fqdn":
-    zone  => "domain.ltd",
-    owner => "${fqdn}.",
-    host  => $ipaddress,
-  }
+# = Class: bind
+# Include this class to install bind9 server on your node.
+#
+# Bind documentation:
+# http://www.bind9.net/manuals
+#
+# Limitations:
+# This modules is valid for Bind 9.7.1 (squeeze version).
+# For 9.7.2, it will be really limited (no view nor ACL support).
+#
+#
+# Example:
+#
+# node 'ns1.domain.ltd' {
+#
+#   include bind
+#
+#   bind::zone {'domain.ltd':
+#     ensure       => present,
+#     zone_contact => "contact.domain.ltd",
+#     zone_ns      => $fqdn,
+#     zone_serial  => '2010110804',
+#     zone_ttl     => '604800',
+#   }
+#
+#   bind::a {"ns $fqdn":
+#     zone  => 'domain.ltd',
+#     owner => "${fqdn}.",
+#     host  => $ipaddress,
+#   }
+#
+#   bind::a {'mail.domain.ltd':
+#     zone  => 'domain.ltd',
+#     owner => 'mail',
+#     host  => '6.6.6.6',
+#   }
+#
+#   bind::mx {'mx1':
+#     zone     => 'domain.ltd',
+#     owner    => '@',
+#     priority => 1,
+#     host     => 'mail.domain.ltd',
+#   }
+# }
+#
+class bind {
 
-  bind::a {"mail.domain.ltd":
-    zone  => "domain.ltd",
-    owner => "mail",
-    host  => "6.6.6.6",
+  case $::operatingsystem {
+    'Debian','Ubuntu': { include bind::debian }
+    default          : { fail "Unknown ${::operatingsystem}" }
   }
 
-  bind::mx {"mx1":
-    zone     => "domain.ltd",
-    owner    => "@",
-    priority => 1,
-    host     => "mail.domain.ltd",
-  }
-}
-*/
-class bind {
-  case $operatingsystem {
-    "Debian","Ubuntu": { include bind::debian }
-    default: { fail "Unknown $operatingsystem" }
-  }
 }
index 433c8ead28ffa1ba29125c7959c0a31ed95ac844..4404a83cb1dc1ed28fd95a15d00e9fae2c0bc3ea 100644 (file)
@@ -1,22 +1,21 @@
-/*
-
-= Definition: bind::mx
-Creates an MX record.
-
-Arguments:
- *$zone*:     Bind::Zone name
- *$owner*:    owner of the Resource Record
- *$priority*: MX record priority
- *$host*:     target of the Resource Record
- *$ttl*:      Time to Live for the Resource Record. Optional.
-
-*/
-define bind::mx($ensure=present,
-    $zone,
-    $owner=false,
-    $priority,
-    $host,
-    $ttl=false) {
+# = Definition: bind::mx
+# Creates an MX record.
+#
+# Arguments:
+#  *$zone*:     Bind::Zone name
+#  *$owner*:    owner of the Resource Record
+#  *$priority*: MX record priority
+#  *$host*:     target of the Resource Record
+#  *$ttl*:      Time to Live for the Resource Record. Optional.
+#
+define bind::mx (
+  $zone,
+  $host,
+  $priority,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = false
+) {
 
   if $owner {
     $_owner = $owner
@@ -27,9 +26,10 @@ define bind::mx($ensure=present,
   concat::fragment {"bind.${name}":
     ensure  => $ensure,
     target  => "/etc/bind/pri/${zone}.conf",
-    content => template("bind/mx-record.erb"),
-    notify  => Service["bind9"],
+    content => template('bind/mx-record.erb'),
+    notify  => Service['bind9'],
     require => [Bind::Zone[$zone], Bind::A[$host]],
   }
+
 }
 
index 3d07aea30e85f82a164cb99734f62aff0f0ba875..e0fbeefed74103a618781d8b7010ade6f5c85f06 100644 (file)
@@ -1,27 +1,28 @@
-/*
-
-= Definition: bind::ns
-Creates an NS 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.
-
-*/
-define bind::ns($ensure=present,
-    $zone,
-    $owner=false,
-    $host,
-    $ttl=false) {
+# = Definition: bind::ns
+#
+# Creates an NS 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.
+#
+define bind::ns (
+  $zone,
+  $host,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = 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 => 'NS',
   }
+
 }
index 1904c5d8f6df946e55511cde425bef829420dcb2..d4bb05271c86c214f96d50071eb3fffc7720383c 100644 (file)
@@ -1,27 +1,28 @@
-/*
-
-= Definition: bind::ptr
-Creates a PTR record.
-
-Arguments:
- *$zone*:  Bind::Zone name
- *$owner*: number of the Resource Record
- *$host*:  target of the Resource Record
- *$ttl*:   Time to Live for the Resource Record. Optional.
-
-*/
-define bind::ptr($ensure=present,
-    $zone,
-    $owner=false,
-    $host,
-    $ttl=false) {
+# = Definition: bind::ptr
+#
+# Creates a PTR record.
+#
+# Arguments:
+#  *$zone*:  Bind::Zone name
+#  *$owner*: number of the Resource Record
+#  *$host*:  target of the Resource Record
+#  *$ttl*:   Time to Live for the Resource Record. Optional.
+#
+define bind::ptr(
+  $zone,
+  $host,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = 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 => 'PTR',
   }
+
 }
index ef53833bed448bdb23113597b0af25259a8b8aae..dc43aaa3bfec798ecaa3b40ce0d5f0cf2faa0aa3 100644 (file)
@@ -1,24 +1,24 @@
-/*
-
-= Definition: bind::record
-Helper to create any record you want (but NOT MX, please refer to Bind::Mx)
-
-Arguments:
- *$zone*:        Bind::Zone name
- *$owner*:       owner of the Resource Record
- *$host*:        target of the Resource Record
- *$record_type°:  resource record type
- *$record_class*: resource record class. Default "IN".
- *$ttl*:          Time to Live for the Resource Record. Optional.
-
-*/
-define bind::record($ensure=present,
-    $zone,
-    $owner=false,
-    $host,
-    $record_type,
-    $record_class='IN',
-    $ttl=false) {
+# = Definition: bind::record
+#
+# Helper to create any record you want (but NOT MX, please refer to Bind::Mx)
+#
+# Arguments:
+#  *$zone*:        Bind::Zone name
+#  *$owner*:       owner of the Resource Record
+#  *$host*:        target of the Resource Record
+#  *$record_type°:  resource record type
+#  *$record_class*: resource record class. Default "IN".
+#  *$ttl*:          Time to Live for the Resource Record. Optional.
+#
+define bind::record (
+  $zone,
+  $host,
+  $record_type,
+  $ensure       = present,
+  $owner        = false,
+  $record_class = 'IN',
+  $ttl          = false
+) {
 
   if $owner {
     $_owner = $owner
@@ -29,7 +29,8 @@ define bind::record($ensure=present,
   concat::fragment {"${zone}.${record_type}.${name}":
     ensure  => $ensure,
     target  => "/etc/bind/pri/${zone}.conf",
-    content => template("bind/default-record.erb"),
-    notify  => Service["bind9"],
+    content => template('bind/default-record.erb'),
+    notify  => Service['bind9'],
   }
+
 }
index 31dd1896f20dac4ab493eb108dd4e1b23724c46e..92b3ba4079b7bcc06eff12d29fee29ddf1d8c6f4 100644 (file)
@@ -1,27 +1,28 @@
-/*
-
-= Definition: bind::txt
-Creates an IPv4 record.
-
-Arguments:
- *$zone*:  Bind::Zone name
- *$owner*: owner of the Resource Record
- *$text*:  target of the Resource Record
- *$ttl*:   Time to Live for the Resource Record. Optional.
-
-*/
-define bind::txt($ensure=present,
-    $zone,
-    $owner=false,
-    $text,
-    $ttl=false) {
+# = Definition: bind::txt
+#
+# Creates an IPv4 record.
+#
+# Arguments:
+#  *$zone*:  Bind::Zone name
+#  *$owner*: owner of the Resource Record
+#  *$text*:  target of the Resource Record
+#  *$ttl*:   Time to Live for the Resource Record. Optional.
+#
+define bind::txt (
+  $zone,
+  $text,
+  $ensure = present,
+  $owner  = false,
+  $ttl    = false
+) {
 
   bind::record {$name:
-    ensure => $ensure,
-    zone   => $zone,
-    owner  => $owner,
-    host   => $text,
-    ttl    => $ttl,
+    ensure      => $ensure,
+    zone        => $zone,
+    owner       => $owner,
+    host        => $text,
+    ttl         => $ttl,
     record_type => 'TXT',
   }
+
 }
index 68295695d6a530fd75e13b2da4f0fb8b25ba35f0..eb07746d29a625e5ebf5b86f0279c71885284234 100644 (file)
@@ -1,41 +1,41 @@
-/*
+# = Definition: bind::zone
+#
+# Creates a valid Bind9 zone.
+#
+# Arguments:
+#  *$is_slave*: Boolean. Is your zone a slave or a master? Default false
+#  *$zone_ttl*: Time period. Time to live for your zonefile (master only)
+#  *$zone_contact*: Valid contact record (master only)
+#  *$zone_serial*: Integer. Zone serial (master only)
+#  *$zone_refresh*: Time period. Time between each slave refresh (master only)
+#  *$zone_retry*: Time period. Time between each slave retry (master only)
+#  *$zone_expiracy*: Time period. Slave expiracy time (master only)
+#  *$zone_ns*: Valid NS for this zone (master only)
+#  *$zone_xfers*: IPs. Valid xfers for zone (master only)
+#  *$zone_masters*: IPs. Valid master for this zone (slave only)
+#  *$zone_origin*: The origin of the zone
+#
+define bind::zone (
+  $ensure        = present,
+  $is_slave      = false,
+  $zone_ttl      = false,
+  $zone_contact  = false,
+  $zone_serial   = false,
+  $zone_refresh  = '3h',
+  $zone_retry    = '1h',
+  $zone_expiracy = '1w',
+  $zone_ns       = false,
+  $zone_xfers    = false,
+  $zone_masters  = false,
+  $zone_origin   = false
+) {
 
-= Definition: bind::zone
-Creates a valid Bind9 zone.
-
-Arguments:
-  *$is_slave*:          Boolean. Is your zone a slave or a master? Default false
-  *$zone_ttl*:          Time period. Time to live for your zonefile (master only)
-  *$zone_contact*:      Valid contact record (master only)
-  *$zone_serial*:       Integer. Zone serial (master only)
-  *$zone_refresh*:      Time period. Time between each slave refresh (master only)
-  *$zone_retry*:        Time period. Time between each slave retry (master only)
-  *$zone_expiracy*:     Time period. Slave expiracy time (master only)
-  *$zone_ns*:           Valid NS for this zone (master only)
-  *$zone_xfers*:        IPs. Valid xfers for zone (master only)
-  *$zone_masters*:      IPs. Valid master for this zone (slave only)
-  *$zone_origin*:       The origin of the zone
-
-*/
-define bind::zone($ensure=present,
-    $is_slave=false,
-    $zone_ttl=false,
-    $zone_contact=false,
-    $zone_serial=false,
-    $zone_refresh="3h",
-    $zone_retry="1h",
-    $zone_expiracy="1w",
-    $zone_ns=false,
-    $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,
@@ -45,16 +45,16 @@ define bind::zone($ensure=present,
   concat::fragment {"bind.zones.${name}":
     ensure  => $ensure,
     target  => "/etc/bind/zones/${name}.conf",
-    notify  => Service["bind9"],
-    require => Package["bind9"],
+    notify  => Service['bind9'],
+    require => Package['bind9'],
   }
 
   concat::fragment {"named.local.zone.${name}":
     ensure  => $ensure,
-    target  => "/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"],
+    notify  => Service['bind9'],
+    require => Package['bind9'],
   }
 
   if $is_slave {
@@ -62,7 +62,7 @@ define bind::zone($ensure=present,
       fail "No master defined for ${name}!"
     }
     Concat::Fragment["bind.zones.${name}"] {
-      content => template("bind/zone-slave.erb"),
+      content => template('bind/zone-slave.erb'),
     }
 ## END of slave
   } else {
@@ -80,23 +80,24 @@ define bind::zone($ensure=present,
     }
 
     Concat::Fragment["bind.zones.${name}"] {
-      content => template("bind/zone-master.erb"),
+      content => template('bind/zone-master.erb'),
     }
 
     concat::fragment {"00.bind.${name}":
       ensure  => $ensure,
       target  => "/etc/bind/pri/${name}.conf",
-      content => template("bind/zone-header.erb"),
-      require => Package["bind9"],
+      content => template('bind/zone-header.erb'),
+      require => Package['bind9'],
     }
 
     file {"/etc/bind/pri/${name}.conf.d":
       ensure  => absent,
-      mode    => 0700,
+      mode    => '0700',
       purge   => true,
       recurse => true,
       backup  => false,
       force   => true,
     }
   }
+
 }