Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/grafana/backend.pp
- This file was added.
# install the grafana stack | |||||
class profile::grafana::backend { | |||||
$db = lookup('grafana::db::database') | |||||
$db_username = lookup('grafana::db::username') | |||||
$db_password = lookup('grafana::db::password') | |||||
$config = lookup('grafana::config') | |||||
include ::postgresql::server | |||||
::postgresql::server::db {$db: | |||||
user => $db_username, | |||||
password => postgresql::postgresql_password($db_username, $db_password), | |||||
} | |||||
class {'::grafana': | |||||
install_method => 'repo', | |||||
provisioning_dashboards => { | |||||
apiVersion => 1, | |||||
providers => [ | |||||
{ | |||||
name => 'default', | |||||
orgId => 1, | |||||
folder => '', | |||||
type => 'file', | |||||
disableDeletion => true, | |||||
options => { | |||||
path => '/var/lib/grafana/dashboards', | |||||
puppetsource => 'puppet:///modules/profile/grafana/dashboards', | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
cfg => $config + { | |||||
database => { | |||||
type => 'postgres', | |||||
host => '127.0.0.1:5432', | |||||
name => $db, | |||||
user => $db_username, | |||||
password => $db_password | |||||
} | |||||
} | |||||
} | |||||
grafana_plugin {'grafana-piechart-panel': | |||||
ensure => present, | |||||
notify => Service['grafana-server'], | |||||
} | |||||
# this class depends on the reverse proxy availability | |||||
include ::profile::grafana::objects | |||||
} |