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
41
42
43
44
|
# File 'manifests/init.pp', line 11
class unpoller (
String $loki_url,
String $loki_user,
String $loki_password,
String $unifi_url,
String $unifi_user,
String $unifi_password,
String $ip = '172.17.0.6',
String $prometheus_server_ip = '0.0.0.0/0',
) {
file { '/etc/unpoller.conf':
ensure => file,
content => template('unpoller/unpoller.conf.erb'),
}
~> docker::container { 'unpoller':
image => 'ghcr.io/unpoller/unpoller:latest',
args => [
"--ip ${ip}",
'-v /etc/unpoller.conf:/etc/unpoller/up.conf',
],
cmd => '',
}
firewall { '100 dnat for prometheus unpoller metrics':
chain => 'DOCKER_EXPOSE',
jump => 'DNAT',
proto => 'tcp',
source => $prometheus_server_ip,
dport => 6130,
todest => "${ip}:6130",
table => 'nat',
}
}
|