2020-07-24 00:05:25 +02:00
|
|
|
# @summary Observability using Grafana
|
|
|
|
#
|
|
|
|
class zulip_ops::profile::grafana {
|
|
|
|
include zulip_ops::profile::base
|
|
|
|
include zulip::supervisor
|
|
|
|
|
2021-12-09 05:03:47 +01:00
|
|
|
$version = '8.3.1'
|
2020-07-24 00:05:25 +02:00
|
|
|
zulip::sha256_tarball_to { 'grafana':
|
2021-12-06 18:43:29 +01:00
|
|
|
url => "https://dl.grafana.com/oss/release/grafana-${version}.linux-${::architecture}.tar.gz",
|
2021-12-09 05:03:47 +01:00
|
|
|
sha256 => '097d85eb2ca6982becea8eccb72855ac11abf43e894af6a46d64bbc77922339b',
|
2020-07-24 00:05:25 +02:00
|
|
|
install => {
|
|
|
|
"grafana-${version}/" => "/srv/grafana-${version}/",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
file { '/srv/grafana':
|
|
|
|
ensure => 'link',
|
|
|
|
target => "/srv/grafana-${version}/",
|
|
|
|
require => Zulip::Sha256_tarball_to['grafana'],
|
|
|
|
}
|
|
|
|
|
|
|
|
group { 'grafana':
|
|
|
|
ensure => present,
|
|
|
|
gid => '1070',
|
|
|
|
}
|
|
|
|
user { 'grafana':
|
|
|
|
ensure => present,
|
|
|
|
uid => '1070',
|
|
|
|
gid => '1070',
|
|
|
|
shell => '/bin/bash',
|
|
|
|
home => '/srv/grafana',
|
|
|
|
managehome => false,
|
|
|
|
}
|
|
|
|
file { '/var/lib/grafana':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'grafana',
|
|
|
|
group => 'grafana',
|
|
|
|
require => [ User[grafana], Group[grafana] ],
|
|
|
|
}
|
|
|
|
file { '/var/log/grafana':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'grafana',
|
|
|
|
group => 'grafana',
|
|
|
|
}
|
|
|
|
|
|
|
|
zulip_ops::teleport::application { 'monitoring': port => '3000' }
|
|
|
|
zulip_ops::firewall_allow { 'grafana': port => '3000' }
|
2021-06-11 22:37:36 +02:00
|
|
|
file { "${zulip::common::supervisor_conf_dir}/grafana.conf":
|
2020-07-24 00:05:25 +02:00
|
|
|
ensure => file,
|
|
|
|
require => [
|
|
|
|
Package[supervisor],
|
|
|
|
File['/srv/grafana'],
|
|
|
|
File['/var/lib/grafana'],
|
|
|
|
File['/var/log/grafana'],
|
|
|
|
],
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/supervisor/conf.d/grafana.conf',
|
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/grafana':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
}
|
|
|
|
file { '/etc/grafana/grafana.ini':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/grafana/grafana.ini',
|
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
}
|