Puppet Function: openldap::flatten_syncrepl
- Defined in:
- functions/flatten_syncrepl.pp
- Function type:
- Puppet Language
Overview
Flatten an array of syncrepl directives to an array of strings.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'functions/flatten_syncrepl.pp', line 11
function openldap::flatten_syncrepl(Optional[Array[OpenLDAP::Syncrepl, 1]] $values) {
$values ? {
undef => undef,
default => $values.map |OpenLDAP::Syncrepl $s| {
join([sprintf('rid=%03d', $s['rid'])] + $s.filter |$x| {
$x[0] != 'rid'
}.map |$x| {
case $x[0] {
'binddn', 'logbase', 'logfilter', 'searchbase': {
"${x[0]}=\"${x[1]}\""
}
'retry': {
"${x[0]}=\"${join(flatten($x[1]), ' ')}\""
}
'schemachecking': {
"${x[0]}=${bool2str($x[1], 'on', 'off')}"
}
default: {
"${x[0]}=${x[1]}"
}
}
}, ' ')
},
}
}
|