29
30
31
32
33
34
35
36
37
38
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/controls/inet.pp', line 29
define bind::controls::inet (
Bind::AddressMatchList $allow = [],
Array[String] $keys = [],
Boolean $read_only = false,
String $address = $name,
Optional[Stdlib::Port] $port = undef,
) {
# The base class must be included first
unless defined(Class['bind']) {
fail('You must include the bind base class before using any bind defined resources')
}
# Ignore control channel definition unless control_channels_enable is true
if $bind::control_channels_enable {
$_allow = empty($allow) ? {
true => undef,
default => $allow.reduce('') |$memo,$k| { "${memo}${k}; " },
}
$_keys = empty($keys) ? {
true => undef,
default => $keys.reduce('') |$memo,$k| { "${memo}\"${k}\"; " },
}
$params = {
'allow' => $_allow,
'keys' => $_keys,
'read_only' => $read_only,
'address' => $address,
'port' => $port,
}
$content = epp("${module_name}/controls-inet.epp", $params)
concat::fragment { "named.conf.controls-inet-${title}":
target => 'named.conf.options',
order => '92',
content => "${content};",
}
# Include controls fragments from main config
Concat::Fragment <| tag == 'named.conf.controls' |> {}
}
}
|