Previous iterations and even a release were all broken. The module works again, sorry for the interlude. - Giving up on params and moving to module_data (WIP) - Change the Package and Service references to the static 'bind' name - Add a meager amount of test coverage
29 lines
736 B
Puppet
29 lines
736 B
Puppet
# ex: syntax=puppet si ts=4 sw=4 et
|
|
|
|
define bind::key (
|
|
$secret,
|
|
$algorithm = 'hmac-sha256',
|
|
$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'] -> File["${keydir}/${name}"] ~> Service['bind']
|
|
|
|
concat::fragment { "bind-key-${name}":
|
|
order => '10',
|
|
target => "${bind::confdir}/keys.conf",
|
|
content => "include \"${bind::confdir}/keys/${name}\";\n",
|
|
}
|
|
}
|
|
}
|