Puppet Function: bind::zonefile_path
- Defined in:
-
functions/zonefile_path.pp
- Function type:
- Puppet Language
Summary
Generate the zonefile name from zone
Overview
bind::zonefile_path(String $zone, Optional[String] $view = '') ⇒ String
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'functions/zonefile_path.pp', line 17
function bind::zonefile_path(String $zone, Optional[String] $view = '') >> String {
$names = split($zone, '[.]')
if (length($names) > 1) {
$tld = $names[-1]
$dom = $names[-2]
$dir = "${tld}/${dom}"
$part = $tld ? {
'arpa' => join(reverse($names[0, -3]), '.'),
default => $zone,
}
}
else {
$dir = $zone
$part = $zone
}
($view =~ NotUndef and $view != '') ? {
true => "${dir}/db.${part}_${view}",
default => "${dir}/db.${part}",
}
}
|