####Table of Contents
- Overview
- Module Description
- Setup
- Usage
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- License
##Overview The grafana puppet module allows one to setup and configure the grafana dashboard.
##Module Description This module should cover all configuration options for grafana v1.9.x.
This module checks out the grafana source directly from github and requires git to be installed. By default this module will install git via the puppetlabs/git module. This behavior can be disabled.
Grafana requires a webserver to serve its content. By default this module will install apache via the puppetlabs/apache module. This behavior can be disabled.
##Setup
The grafana module requires that config_datasources
be specified. For a description of the different granafa configuration options see grafana's documentation. To disable managing of git or apache see options below.
###Examples To install grafana accepting all default options:
class { 'grafana':
config_datasources => {
graphite => {
type => 'graphite',
url => 'http://my.graphite.server.com:8080',
},
elasticsearch => {
type => 'elasticsearch',
url => 'http://my.elastic.server.com:9200',
index => 'grafana-dash',
grafanaDB => true,
}
}
}
To disable webserver and git management:
class { 'grafana':
config_datasources => { ... },
manage_ws => false,
manage_git => false,
}
##Usage
###Classes
####Class: grafana
#####config_admin_password
Data Type: string
Default: ''
The purpose of this password is not security, but to stop some users from accidentally changing dashboards.
#####config_datasources
Data Type: hash
Default: undef
The datasources property defines your metric, annotation and dashboard storage backends. See grafana documentation.
#####config_default_route
Data Type: string
Default: /dashboard/file/default.json
The default start dashboard.
#####config_playlist_timespan
Data Type: string
Default: 1m
Set the default timespan for the playlist feature. Example: "1m", "1h"
#####config_plugins_dependencies
Data Type: array
Default: []
requirejs modules in plugins folder that should be loaded; for example custom datasources.
#####config_plugins_panels
Data Type: array
Default: []
List of plugin panels.
#####config_search_max_results
Data Type: string
Default: 100
Specify the limit for dashboard search results.
#####config_template
Data Type: string
Default: grafana/config.js.erb
The erb template to build config.js.
#####config_unsaved_changes_warning
Data Type: bool
Default: true
Set to false to disable unsaved changes warning.
#####config_window_title_prefix
Data Type: string
Default: _Grafana - _
Change window title prefix from 'Grafana - '.
Data Type: string Default: https://github.com/grafana/grafana.git URL for the grafana git repo.
#####graf_folder_owner
Data Type: string
Default: undef
The owner of the grafana install located at graf_install_folder
. If graf_folder_owner
remains 'undef' it defaults to one of two cases:
- if
manage_ws => false
thengraf_folder_owner => 'root'
- if
manage_ws => true
thengraf_folder_owner => $::apache::params::user
#####graf_install_folder
Data Type: string
Default: /opt/grafana
The folder to install grafana into.
#####graf_release
Data Type: string
Default: v1.9.1
A tag or branch from the grafana repo.
#####manage_git
Data Type: bool
Default: true
Should the module manage git.
#####manage_git_repository
Data Type: bool
Default: true
Should the module manage grafana git repository.
#####manage_ws
Data Type: bool
Default: true
Should the module manage the webserver.
#####ws_default_vhost
Data Type: bool
Default: false
Attempt to make the grafana vhost the default. Only taken into account if manage_ws => true
.
#####ws_port
Data Type: string
Default: 80
Change the default port for the webserver to a custom value. Only taken into account if manage_ws => true
.
#####ws_servername
Data Type: string
Default: grafana
Change the default servername for the apache vhost. Only taken into account if manage_ws => true
.
##Limitations
- Tested and built on Ubuntu 12.04.
- Tested with grafana v1.9.1.
##Contributing Pull requests are welcome. Please document and include rspec tests.
##License See LICENSE file.