diff options
author | Cédric Jeanneret <cedric.jeanneret@camptocamp.com> | 2010-11-08 16:15:43 +0100 |
---|---|---|
committer | Cédric Jeanneret <cedric.jeanneret@camptocamp.com> | 2010-11-15 14:21:11 +0100 |
commit | e0f517634bb58ec8e9f396ff489eb8a9efc73ee0 (patch) | |
tree | be170e0483c52b6bd36a085a957f20ea30975482 /manifests/definitions/bind-zone.pp | |
download | puppet-bind-e0f517634bb58ec8e9f396ff489eb8a9efc73ee0.tar.gz puppet-bind-e0f517634bb58ec8e9f396ff489eb8a9efc73ee0.tar.bz2 |
(bind) initial import
Doc will be added later.
Diffstat (limited to 'manifests/definitions/bind-zone.pp')
-rw-r--r-- | manifests/definitions/bind-zone.pp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/manifests/definitions/bind-zone.pp b/manifests/definitions/bind-zone.pp new file mode 100644 index 0000000..137bcd8 --- /dev/null +++ b/manifests/definitions/bind-zone.pp @@ -0,0 +1,58 @@ +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) { + + common::concatfilepart {"bind.zones.${name}": + ensure => $ensure, + notify => Service["bind9"], + file => "/etc/bind/zones/${name}.conf", + } + + common::concatfilepart {"named.local.zone.${name}": + ensure => $ensure, + notify => Service["bind9"], + file => "/etc/bind/named.conf.local", + content => "include \"/etc/bind/zones/${name}.conf\";\n", + } + + if $is_slave { + if !$zone_masters { + fail "No master defined for ${name}!" + } + Common::Concatfilepart["bind.zones.${name}"] { + content => template("bind/zone-slave.erb"), + } +## END of slave + } else { + if !$zone_contact { + fail "No contact defined for ${name}!" + } + if !$zone_ns { + fail "No ns defined for ${name}!" + } + if !$zone_serial { + fail "No serial defined for ${name}!" + } + if !$zone_ttl { + fail "No ttl defined for ${name}!" + } + + Common::Concatfilepart["bind.zones.${name}"] { + content => template("bind/zone-master.erb"), + } + + common::concatfilepart {"bind.00.${name}": + ensure => $ensure, + file => "/etc/bind/pri/${name}.conf", + content => template("bind/zone-header.erb"), + } + } +} |