/[adm]/puppet/modules/bind/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/bind/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1822 - (hide annotations) (download)
Fri Jul 8 00:16:55 2011 UTC (12 years, 9 months ago) by misc
File size: 2248 byte(s)
fix syntax

1 misc 30 class bind {
2     class bind_base {
3     package { bind:
4     ensure => installed
5     }
6 misc 27
7 misc 30 service { named:
8     ensure => running,
9 misc 1821 restart => "service named restart",
10 misc 30 subscribe => [ Package["bind"]]
11     }
12 misc 40
13     file { '/etc/named.conf':
14     ensure => "/var/lib/named/etc/named.conf",
15     owner => root,
16     group => root,
17 misc 457 mode => 644,
18     require => Package[bind]
19 misc 1821 }
20    
21     exec { "named_reload":
22 misc 1822 command => "service named reload",
23 misc 1821 refreshonly => true,
24 misc 40 }
25 misc 30 }
26 misc 27
27 misc 40 file { '/var/lib/named/etc/named.conf':
28 misc 27 ensure => present,
29     owner => root,
30     group => root,
31     mode => 644,
32 misc 30 require => Package["bind"],
33     content => "",
34     notify => [Service['named']]
35 misc 27 }
36    
37 misc 774 define zone_base($content = false) {
38     if ! $content {
39     $zone_content = template("bind/zones/$name.zone")
40     } else {
41     $zone_content = $content
42     }
43     file { "/var/lib/named/var/named/$zone_subdir/$name.zone":
44 misc 30 ensure => present,
45     owner => root,
46     group => root,
47     mode => 644,
48 misc 774 content => $zone_content,
49 misc 30 require => Package[bind],
50 misc 1821 notify => Exec[named_reload]
51 misc 30 }
52 misc 27 }
53    
54 misc 1757 define zone_master($content = false) {
55 misc 774 $zone_subdir = "master"
56     zone_base { $name :
57     content => $content
58 misc 492 }
59     }
60    
61 misc 1757 define zone_reverse($content = false) {
62 misc 774 $zone_subdir = "reverse"
63     zone_base { $name :
64     content => $content
65     }
66     }
67 misc 492
68 misc 774
69 misc 30 class bind_master inherits bind_base {
70 misc 1806 Tld_redirections::Domain <<| |>>
71    
72     $managed_tlds = list_exported_ressources('Tld_redirections::Domain')
73 misc 42 file { '/var/lib/named/etc/named.conf':
74 misc 30 content => template("bind/named_base.conf", "bind/named_master.conf"),
75     }
76 misc 27 }
77    
78 misc 30 class bind_slave inherits bind_base {
79 misc 1806 $managed_tlds = list_exported_ressources('Tld_redirections::Domain')
80 misc 42 file { '/var/lib/named/etc/named.conf':
81 misc 30 content => template("bind/named_base.conf", "bind/named_slave.conf"),
82     }
83     }
84 misc 27
85 misc 30 }

  ViewVC Help
Powered by ViewVC 1.1.30