zulip/puppet/kandra/manifests/prometheus/redis.pp

34 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2022-05-03 20:51:01 +02:00
# @summary Prometheus monitoring of redis servers
#
class kandra::prometheus::redis {
include kandra::prometheus::base
include zulip::supervisor
2022-05-03 20:51:01 +02:00
$version = $zulip::common::versions['redis_exporter']['version']
$dir = "/srv/zulip-redis_exporter-${version}"
$bin = "${dir}/redis_exporter"
zulip::external_dep { 'redis_exporter':
version => $version,
url => "https://github.com/oliver006/redis_exporter/releases/download/v${version}/redis_exporter-v${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "redis_exporter-v${version}.linux-${zulip::common::goarch}",
bin => [$bin],
cleanup_after => [Service[supervisor]],
2022-05-03 20:51:01 +02:00
}
kandra::firewall_allow { 'redis_exporter': port => '9121' }
2022-05-03 20:51:01 +02:00
file { "${zulip::common::supervisor_conf_dir}/prometheus_redis_exporter.conf":
ensure => file,
require => [
User[zulip],
Package[supervisor],
File[$bin],
2022-05-03 20:51:01 +02:00
],
owner => 'root',
group => 'root',
mode => '0644',
content => template('kandra/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb'),
2022-05-03 20:51:01 +02:00
notify => Service[supervisor],
}
}