Defined Type: grafana::datasources

Defined in:
modules/grafana/manifests/datasources.pp

Summary

installs a Grafana data source configuration file, see https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: present)
  • source (Optional[Stdlib::Filesource]) (defaults to: undef)
  • content (Optional[String]) (defaults to: undef)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'modules/grafana/manifests/datasources.pp', line 4

define grafana::datasources (
  Wmflib::Ensure               $ensure  = present,
  Optional[Stdlib::Filesource] $source  = undef,
  Optional[String]             $content = undef,
) {
  file { "/etc/grafana/provisioning/datasources/${title}.yaml":
    ensure  => stdlib::ensure($ensure, 'file'),
    source  => $source,
    content => $content,
    owner   => 'root',
    group   => 'grafana',
    mode    => '0440',
    require => Package['grafana'],
    notify  => Service['grafana-server'],
  }
}