diff options
Diffstat (limited to 'modules/bind/manifests/init.pp')
| -rw-r--r-- | modules/bind/manifests/init.pp | 75 |
1 files changed, 15 insertions, 60 deletions
diff --git a/modules/bind/manifests/init.pp b/modules/bind/manifests/init.pp index 230c50d1..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'], } } |
