This commit is contained in:
Nate Riffe 2012-09-04 23:45:28 -05:00
parent 47c223eadd
commit 107fe10194
3 changed files with 24 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class bind (
notify => Service[$bind::params::bind_service], notify => Service[$bind::params::bind_service],
} }
file { "${confdir}/zones": file { [ "${confdir}/zones", "${confdir}/keys" ]:
ensure => directory, ensure => directory,
owner => 'root', owner => 'root',
group => $bind::params::bind_group, group => $bind::params::bind_group,

18
manifests/key.pp Normal file
View File

@ -0,0 +1,18 @@
define bind::key (
$algorithm => 'hmac-sha256',
$secret,
) {
file { "${bind::confdir}/keys/${name}.conf":
ensure => present,
owner => 'root',
group => $bind::params::bind_group,
mode => '0640',
content => template('bind/key.conf.erb'),
notify => Service[$bind::params::bind_service],
}
concat::fragment { "bind-key-${name}":
order => '10',
target => "${bind::confdir}/named.conf",
content => "include \"${bind::confdir}/keys/${name}.conf\";\n",
}
}

5
templates/key.erb Normal file
View File

@ -0,0 +1,5 @@
key "<%= name %>" {
algorithm <%= algorithm %>;
secret "<%= secret %>";
};