aboutsummaryrefslogtreecommitdiffstats
path: root/modules/bind/manifests/init.pp
blob: 4b668d523ad24a2adac8eb9002534eb4e53b84bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class bind {
    class bind_base {
        package { bind:
            ensure => installed
        }

        service { named:
            ensure => running,
            path => "/etc/init.d/named",
            subscribe => [ Package["bind"]]
        }

        file { '/etc/named.conf':
            ensure => "/var/lib/named/etc/named.conf",
            owner => root,
            group => root,
            mode => 644,
            require => Package[bind]
        } 
    }


    file { '/var/lib/named/etc/named.conf':
        ensure => present,
        owner => root,
        group => root,
        mode => 644,
        require => Package["bind"],
        content => "",
        notify => [Service['named']]
    }

    define zone_master {
        file { "/var/lib/named/var/named/master/$name.zone":
            ensure => present,
            owner => root,
            group => root,
            mode => 644,
            content => template("bind/zones/$name.zone"),
            require => Package[bind],
            notify => Service[named]
        }
    }

    class bind_master inherits bind_base {
        file { '/var/lib/named/etc/named.conf':
            content => template("bind/named_base.conf", "bind/named_master.conf"),
        }
    }

    class bind_slave inherits bind_base {
        file { '/var/lib/named/etc/named.conf':
            content => template("bind/named_base.conf", "bind/named_slave.conf"),
        }
    }

}