diff options
author | Mathieu Bornoz <mathieu.bornoz@camptocamp.com> | 2012-08-02 11:24:52 +0200 |
---|---|---|
committer | Mathieu Bornoz <mathieu.bornoz@camptocamp.com> | 2012-08-02 11:24:52 +0200 |
commit | d8f231f802e967bdf5c30bbee61fab05a7621dc6 (patch) | |
tree | b30a9f20b284d5b44ec46140bb48468bfb3674d2 /manifests/zone.pp | |
parent | e9c9acdd15579bcb10ca9509c032819d3f808e53 (diff) | |
download | puppet-bind-d8f231f802e967bdf5c30bbee61fab05a7621dc6.tar.gz puppet-bind-d8f231f802e967bdf5c30bbee61fab05a7621dc6.tar.bz2 |
lint + cosmetics
Diffstat (limited to 'manifests/zone.pp')
-rw-r--r-- | manifests/zone.pp | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/manifests/zone.pp b/manifests/zone.pp index 6829569..eb07746 100644 --- a/manifests/zone.pp +++ b/manifests/zone.pp @@ -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, } } + } |