39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'manifests/remote.pp', line 39
class unbound::remote (
Boolean $enable = $unbound::control_enable,
Array $interface = ['::1', '127.0.0.1'],
Integer $port = 8953,
Boolean $control_use_cert = true,
String $server_key_file = "${unbound::confdir}/unbound_server.key",
String $server_cert_file = "${unbound::confdir}/unbound_server.pem",
String $control_key_file = "${$unbound::confdir}/unbound_control.key",
String $control_cert_file = "${$unbound::confdir}/unbound_control.pem",
$group = $unbound::group,
$confdir = $unbound::confdir,
$config_file = $unbound::config_file,
$control_setup_path = $unbound::control_setup_path,
) {
concat::fragment { 'unbound-remote':
order => '10',
target => $config_file,
content => template('unbound/remote.erb'),
}
unless $control_setup_path.empty {
exec { 'unbound-control-setup':
command => "${control_setup_path} -d ${confdir}",
creates => $server_key_file,
}
file { [$server_key_file, $server_cert_file, $control_key_file, $control_cert_file]:
owner => 'root',
group => $group,
mode => '0640',
require => Exec['unbound-control-setup'],
}
}
}
|