puppet-bind/manifests/key.pp
Nate Riffe 09cf90342b Add bind::updater class
Create a bind::updater class to add support for the dns_rr resource on systems
that will not have a BIND server installed or running.
2014-06-15 10:44:15 -05:00

31 lines
794 B
Puppet

# ex: syntax=puppet si ts=4 sw=4 et
define bind::key (
$algorithm = 'hmac-sha256',
$secret,
$owner = 'root',
$group = $bind::params::bind_group,
) {
$keydir = $::bind::keydir::keydir
file { "${keydir}/${name}":
ensure => present,
owner => $owner,
group => $group,
mode => '0640',
content => template('bind/key.conf.erb'),
}
if (defined(Class['bind'])) {
Package[$bind::params::bind_package] ->
File["${keydir}/${name}"] ~>
Service[$bind::params::bind_service]
concat::fragment { "bind-key-${name}":
order => '10',
target => "${bind::confdir}/keys.conf",
content => "include \"${bind::confdir}/keys/${name}\";\n",
}
}
}