generate bind configs from LDAP
This commit is contained in:
parent
f400a5817c
commit
ec3c4244ad
2 changed files with 134 additions and 0 deletions
|
@ -173,6 +173,45 @@ class dns::server {
|
|||
}
|
||||
}
|
||||
|
||||
# Generate named config from LDAP
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# Put templates you want to generate to master.in directory.
|
||||
# See dnsdump.py for example template tags.
|
||||
|
||||
class dns::server::ldap inherits dns::server {
|
||||
|
||||
include ldap::client::python
|
||||
|
||||
file { "/usr/local/sbin/dnsdump.py":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/dns/dnsdump.py",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
}
|
||||
|
||||
file { "/var/named/master.in":
|
||||
ensure => directory,
|
||||
source => "puppet:///files/dns/master.in",
|
||||
recurse => true,
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
purge => true,
|
||||
}
|
||||
|
||||
exec { "generate-dns-conf":
|
||||
path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||
command => "dnsdump.py --notest /var/named/master.in /var/named/master",
|
||||
require => File["/usr/local/sbin/dnsdump.py"],
|
||||
unless => "dnsdump.py --test /var/named/master.in /var/named/master",
|
||||
notify => Service["named"]
|
||||
}
|
||||
}
|
||||
|
||||
# Configure DNS zone.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue