diff options
author | Michael Scherer <misc@mageia.org> | 2012-03-20 17:30:33 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-03-20 17:30:33 +0000 |
commit | b433b11029408072497a67a94cc4afc5852a034c (patch) | |
tree | 2641e64711e4ed76c60d38704e19af54a7e4077b /modules | |
parent | 47ef89f1230721a4c47a55e5e3e881ab237ffd2a (diff) | |
download | puppet-b433b11029408072497a67a94cc4afc5852a034c.tar puppet-b433b11029408072497a67a94cc4afc5852a034c.tar.gz puppet-b433b11029408072497a67a94cc4afc5852a034c.tar.bz2 puppet-b433b11029408072497a67a94cc4afc5852a034c.tar.xz puppet-b433b11029408072497a67a94cc4afc5852a034c.zip |
rework the layout of the bind module
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bind/manifests/init.pp | 75 | ||||
-rw-r--r-- | modules/bind/manifests/master.pp | 8 | ||||
-rw-r--r-- | modules/bind/manifests/slave.pp | 6 | ||||
-rw-r--r-- | modules/bind/manifests/zone.pp | 12 | ||||
-rw-r--r-- | modules/bind/manifests/zone/master.pp | 6 | ||||
-rw-r--r-- | modules/bind/manifests/zone/reverse.pp | 6 |
6 files changed, 53 insertions, 60 deletions
diff --git a/modules/bind/manifests/init.pp b/modules/bind/manifests/init.pp index 9664530b..a5d20c09 100644 --- a/modules/bind/manifests/init.pp +++ b/modules/bind/manifests/init.pp @@ -1,70 +1,25 @@ class bind { - class bind_base { - package { 'bind': } + package { 'bind': } - service { 'named': - restart => 'service named restart', - subscribe => Package['bind'], - } - - file { '/etc/named.conf': - ensure => '/var/lib/named/etc/named.conf', - require => Package['bind'], - } - - exec { 'named_reload': - command => 'service named reload', - refreshonly => true, - } - - file { '/var/lib/named/etc/named.conf': - require => Package['bind'], - content => '', - notify => Service['named'], - } - } - - define zone_base($content = false) { - if ! $content { - $zone_content = template("bind/zones/$name.zone") - } else { - $zone_content = $content - } - file { "/var/lib/named/var/named/$zone_subdir/$name.zone": - content => $zone_content, - require => Package['bind'], - notify => Exec['named_reload'] - } + service { 'named': + restart => 'service named restart', + subscribe => Package['bind'], } - define zone_master($content = false) { - $zone_subdir = 'master' - zone_base { $name : - content => $content - } + file { '/etc/named.conf': + ensure => link, + target => '/var/lib/named/etc/named.conf', + require => Package['bind'], } - define zone_reverse($content = false) { - $zone_subdir = 'reverse' - zone_base { $name : - content => $content - } - } - - - class bind_master inherits bind_base { - Tld_redirections::Domain <<| |>> - - $managed_tlds = list_exported_ressources('Tld_redirections::Domain') - File['/var/lib/named/etc/named.conf'] { - content => template('bind/named_base.conf', 'bind/named_master.conf'), - } + exec { 'named_reload': + command => 'service named reload', + refreshonly => true, } - class bind_slave inherits bind_base { - $managed_tlds = list_exported_ressources('Tld_redirections::Domain') - File['/var/lib/named/etc/named.conf'] { - content => template('bind/named_base.conf', 'bind/named_slave.conf'), - } + file { '/var/lib/named/etc/named.conf': + require => Package['bind'], + content => '', + notify => Service['named'], } } diff --git a/modules/bind/manifests/master.pp b/modules/bind/manifests/master.pp new file mode 100644 index 00000000..c5ea1ccc --- /dev/null +++ b/modules/bind/manifests/master.pp @@ -0,0 +1,8 @@ +class bind::master inherits bind { + Tld_redirections::Domain <<| |>> + + $managed_tlds = list_exported_ressources('Tld_redirections::Domain') + File['/var/lib/named/etc/named.conf'] { + content => template('bind/named_base.conf', 'bind/named_master.conf'), + } +} diff --git a/modules/bind/manifests/slave.pp b/modules/bind/manifests/slave.pp new file mode 100644 index 00000000..e446b57a --- /dev/null +++ b/modules/bind/manifests/slave.pp @@ -0,0 +1,6 @@ +class bind::slave inherits bind { + $managed_tlds = list_exported_ressources('Tld_redirections::Domain') + File['/var/lib/named/etc/named.conf'] { + content => template('bind/named_base.conf', 'bind/named_slave.conf'), + } +} diff --git a/modules/bind/manifests/zone.pp b/modules/bind/manifests/zone.pp new file mode 100644 index 00000000..24367206 --- /dev/null +++ b/modules/bind/manifests/zone.pp @@ -0,0 +1,12 @@ +define bind::zone($type, $content = false) { + if ! $content { + $zone_content = template("bind/zones/$name.zone") + } else { + $zone_content = $content + } + file { "/var/lib/named/var/named/$type/$name.zone": + content => $zone_content, + require => Package['bind'], + notify => Exec['named_reload'] + } +} diff --git a/modules/bind/manifests/zone/master.pp b/modules/bind/manifests/zone/master.pp new file mode 100644 index 00000000..460f52c6 --- /dev/null +++ b/modules/bind/manifests/zone/master.pp @@ -0,0 +1,6 @@ +define bind::zone::master($content = false) { + bind::zone { $name : + type => 'master', + content => $content, + } +} diff --git a/modules/bind/manifests/zone/reverse.pp b/modules/bind/manifests/zone/reverse.pp new file mode 100644 index 00000000..400e77f9 --- /dev/null +++ b/modules/bind/manifests/zone/reverse.pp @@ -0,0 +1,6 @@ +define bind::zone::reverse($content = false) { + bind::zone { $name : + type => 'reverse', + content => $content, + } +} |