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
37
38
39
40
|
# File 'manifests/database/mysql.pp', line 11
class grafana::database::mysql (
String $database,
Variant[Bodgitlib::Host, Tuple[Bodgitlib::Host, Bodgitlib::Port]] $host,
String $user,
Optional[String] $password = undef,
) {
if ! defined(Class['::grafana']) {
fail('You must include the grafana base class before using the grafana::database::mysql class')
}
$_host = type($host) ? {
Type[Tuple] => join([bodgitlib::enclose_ipv6($host[0]), $host[1]], ':'),
default => bodgitlib::enclose_ipv6($host),
}
$config = delete_undef_values({
'database/type' => 'mysql',
'database/host' => $_host,
'database/name' => $database,
'database/user' => $user,
'database/password' => $password,
})
$config.each |String $setting, Any $value| {
grafana_ini_setting { $setting:
value => $value,
}
}
}
|