1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'modules/profile/manifests/redis/instance.pp', line 1
define profile::redis::instance(
$port=$title,
$settings={},
$slaveof=undef,
$aof=false,
) {
$slaveof_actual = $slaveof ? {
/^\S+$/ => "${slaveof} ${port}",
default => undef
}
$base_settings = {
dbfilename => "${::hostname}-${title}.rdb",
slaveof => $slaveof_actual,
}
if $aof {
$aof_settings = {
appendfilename => "${::hostname}-${title}.aof",
}
} else {
$aof_settings = {}
}
::redis::instance { $title:
settings => merge($base_settings, $aof_settings, $settings)
}
}
|