{"id":14972048,"url":"https://github.com/bodgit/puppet-grafana","last_synced_at":"2025-10-26T17:31:23.337Z","repository":{"id":57664165,"uuid":"71831921","full_name":"bodgit/puppet-grafana","owner":"bodgit","description":"Puppet Module for managing Grafana","archived":false,"fork":false,"pushed_at":"2020-05-21T11:20:01.000Z","size":40,"stargazers_count":0,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T21:52:47.695Z","etag":null,"topics":["grafana","puppet"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-24T21:02:58.000Z","updated_at":"2020-07-25T19:29:29.000Z","dependencies_parsed_at":"2022-09-10T08:40:55.845Z","dependency_job_id":null,"html_url":"https://github.com/bodgit/puppet-grafana","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fpuppet-grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fpuppet-grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fpuppet-grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fpuppet-grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodgit","download_url":"https://codeload.github.com/bodgit/puppet-grafana/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238375200,"owners_count":19461568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grafana","puppet"],"created_at":"2024-09-24T13:46:17.644Z","updated_at":"2025-10-26T17:31:18.061Z","avatar_url":"https://github.com/bodgit.png","language":"Ruby","readme":"# grafana\n\nTested with Travis CI\n\n[![Build Status](https://travis-ci.org/bodgit/puppet-grafana.svg?branch=master)](https://travis-ci.org/bodgit/puppet-grafana)\n[![Coverage Status](https://coveralls.io/repos/bodgit/puppet-grafana/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/bodgit/puppet-grafana?branch=master)\n[![Puppet Forge](http://img.shields.io/puppetforge/v/bodgit/grafana.svg)](https://forge.puppetlabs.com/bodgit/grafana)\n[![Dependency Status](https://gemnasium.com/bodgit/puppet-grafana.svg)](https://gemnasium.com/bodgit/puppet-grafana)\n\n#### Table of Contents\n\n1. [Overview](#overview)\n2. [Module Description - What the module does and why it is useful](#module-description)\n3. [Setup - The basics of getting started with grafana](#setup)\n    * [What grafana affects](#what-grafana-affects)\n    * [Beginning with grafana](#beginning-with-grafana)\n4. [Usage - Configuration options and additional functionality](#usage)\n    * [Classes and Defined Types](#classes-and-defined-types)\n        * [Class: grafana](#class-grafana)\n        * [Class: grafana::ldap](#class-grafanaldap)\n        * [Defined Type: grafana::plugin](#defined-type-grafanaplugin)\n    * [Native Types](#native-types)\n        * [Native Type: grafana_ini_setting](#native-type-grafana_ini_setting)\n        * [Native Type: package](#native-type-package)\n    * [Examples](#examples)\n5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)\n5. [Limitations - OS compatibility, etc.](#limitations)\n6. [Development - Guide for contributing to the module](#development)\n\n## Overview\n\nThis module manages the Grafana UI for Graphite.\n\n## Module Description\n\nThis module installs the Grafana package, managing the package repository if\nrequired, configures it and optionally enables and configures LDAP\nauthentication. It can also install publicly available plugins.\n\n## Setup\n\nIf running on Puppet 3.x you will need to have the future parser enabled.\n\n### What graphite affects\n\n* The package providing the Grafana software.\n* The `/etc/grafana/grafana.ini` configuration file.\n* The `/etc/grafana/ldap.toml` LDAP configuration file.\n* Plugins installed under `/var/lib/grafana`.\n* The service controlling Grafana.\n\n### Beginning with grafana\n\n```puppet\nclass { '::grafana':\n  admin_password =\u003e 'admin',\n  secret_key     =\u003e 'abc123',\n}\n```\n\n## Usage\n\n### Classes and Defined Types\n\n#### Class: `grafana`\n\n**Parameters within `grafana`:**\n\n##### `admin_password`\n\nMaps to the `security/admin_password` setting.\n\n##### `secret_key`\n\nMaps to the `security/secret_key` setting.\n\n##### `admin_user`\n\nMaps to the `security/admin_user` setting.\n\n##### `allow_sign_up`\n\nMaps to the `users/allow_sign_up` setting.\n\n##### `allow_org_create`\n\nMaps to the `users/allow_org_create` setting.\n\n##### `check_for_updates`\n\nMaps to the `analytics/check_for_updates` setting.\n\n##### `conf_dir`\n\nThe root configuration directory, defaults to `/etc/grafana`.\n\n##### `conf_file`\n\nThe main configuration file, defaults to `${conf_dir}/grafana.ini`.\n\n##### `data_dir`\n\nThe root data directory, defaults to `/var/lib/grafana`.\n\n##### `grafana_home`\n\nThe root directory of the web application, defaults to `/usr/share/grafana`.\n\n##### `group`\n\nThe group to run as, defaults to `grafana`.\n\n##### `log_dir`\n\nThe log directory, defaults to `/var/log/grafana`.\n\n##### `manage_repo`\n\nWhether to manage the external repository for package installation.\n\n##### `max_open_files`\n\nMaximum number of open files, defaults to 10,000.\n\n##### `package_name`\n\nThe name of the package to install, defaults to `grafana`.\n\n##### `plugins_dir`\n\nThe plugins directory, defaults to `${data_dir}/plugins`.\n\n##### `restart_on_upgrade`\n\nControls whether package upgrades trigger an automatic restart.\n\n##### `service_name`\n\nThe name of the service, defaults to `grafana-server`.\n\n##### `url`\n\nMaps to the `grafana_net/url` setting.\n\n##### `user`\n\nThe user to run as, defaults to `grafana`.\n\n#### Class: `grafana::ldap`\n\n**Parameters within `grafana::ldap`:**\n\n##### `bind_dn`\n\nThe distinguished name used to bind to LDAP with.\n\n##### `hosts`\n\nAn array of hostnames or IP addresses of LDAP servers to use.\n\n##### `search_base_dns`\n\nAn array of LDAP search bases to try for locating the user.\n\n##### `search_filter`\n\nAn LDAP search filter to apply to user searches.\n\n##### `attributes`\n\nA hash of LDAP attribute mappings. Required keys are `name`, `surname`,\n`username`, `member_of`, and `email`. Values for each are the appropriate\nLDAP attribute name.\n\n##### `bind_password`\n\nThe password to use when binding to LDAP.\n\n##### `conf_file`\n\nThe LDAP configuration file, defaults to `${::grafana::conf_dir}/ldap.toml`.\n\n##### `group_mappings`\n\nAn array of mappings, each mapping being a hash containing the required keys\n`group_dn` and `org_role` which contain the plain or distinguished name of\nthe group, (or `*` as a catch-all), and one of `Admin`, `Editor` or `Viewer`\nrespectively. An optional `org_id` key can be passed to map to the desired\nGrafana organisation ID.\n\n##### `group_search_base_dns`\n\nAn array of LDAP search bases to try for group lookups.\n\n##### `group_search_filter`\n\nAn LDAP search filter to apply to group searches.\n\n##### `group_search_filter_user_attribute`\n\nUsed with recursive group membership lookups.\n\n##### `port`\n\nPort to use for LDAP connections, defaults to 389.\n\n##### `root_ca_cert`\n\nPath to root CA certificate for verifying SSL/TLS LDAP connections.\n\n##### `ssl_skip_verify`\n\nBoolean for SSL/TLS verification.\n\n##### `start_tls`\n\nWhether to use STARTTLS.\n\n##### `use_ssl`\n\nWhether to use SSL/TLS, usually with port 636.\n\n##### `verbose_logging`\n\nEnable verbose LDAP logging.\n\n#### Defined Type: `grafana::plugin`\n\n**Parameters within `grafana::plugin`:**\n\n##### `name`\n\nThe name of the plugin to install.\n\n##### `ensure`\n\nOne of `present`, `absent` or `latest`.\n\n### Native Types\n\n#### Native Type: `grafana_ini_setting`\n\n```puppet\ngrafana_ini_setting { 'auth.ldap/config_file':\n  ensure =\u003e present,\n  value  =\u003e '/etc/grafana/ldap.toml',\n}\n\ngrafana_ini_setting { 'auth.ldap/enabled':\n  ensure =\u003e absent,\n}\n```\n\n**Parameters within `grafana_ini_setting`:**\n\n##### `name`\n\nThe name of the setting, of the form `\u003csection\u003e/\u003csetting\u003e`.\n\n##### `ensure`\n\nOne of `present` or `absent`.\n\n##### `value`\n\nThe value of the setting.\n\n#### Native Type: `package`\n\n```puppet\npackage { 'grafana-piechart-panel':\n  ensure   =\u003e present,\n  provider =\u003e grafana,\n}\n```\n\n**Parameters within `package`:**\n\nSee the standard Puppet package type.\n\n### Examples\n\nInstall Grafana:\n\n```puppet\nclass { '::grafana':\n  admin_password =\u003e 'admin',\n  secret_key     =\u003e 'abc123',\n}\n```\n\nExtend the above to also install a piechart plugin:\n\n```puppet\nclass { '::grafana':\n  admin_password =\u003e 'admin',\n  secret_key     =\u003e 'abc123',\n}\n\n::grafana::plugin { 'grafana-piechart-panel':\n  ensure =\u003e present,\n}\n```\n\nExtend the above to also configure LDAP authentication:\n\n```puppet\ninclude ::openldap\ninclude ::openldap::client\nclass { '::openldap::server':\n  root_dn              =\u003e 'cn=Manager,dc=example,dc=com',\n  root_password        =\u003e 'secret',\n  suffix               =\u003e 'dc=example,dc=com',\n  access               =\u003e [\n    'to attrs=userPassword by self =xw by anonymous auth',\n    'to * by dn.base=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage by users read',\n  ],\n  ldap_interfaces      =\u003e ['127.0.0.1'],\n  local_ssf            =\u003e 256,\n}\n::openldap::server::schema { 'cosine':\n  position =\u003e 1,\n}\n::openldap::server::schema { 'inetorgperson':\n  position =\u003e 2,\n}\n::openldap::server::schema { 'nis':\n  position =\u003e 3,\n}\n\nclass { '::grafana':\n  admin_password =\u003e 'admin',\n  secret_key     =\u003e 'abc123',\n}\n\n::grafana::plugin { 'grafana-piechart-panel':\n  ensure =\u003e present,\n}\n\nclass { '::grafana::ldap':\n  bind_dn               =\u003e 'cn=Manager,dc=example,dc=com',\n  bind_password         =\u003e 'secret',\n  group_search_base_dns =\u003e ['ou=groups,dc=example,dc=com'],\n  group_search_filter   =\u003e '(\u0026(objectClass=posixGroup)(memberUid=%s))',\n  hosts                 =\u003e ['127.0.0.1'],\n  search_base_dns       =\u003e ['ou=people,dc=example,dc=com'],\n  search_filter         =\u003e '(uid=%s)',\n  attributes            =\u003e {\n    'name'      =\u003e 'givenName',\n    'surname'   =\u003e 'sn',\n    'username'  =\u003e 'uid',\n    'member_of' =\u003e 'cn',\n    'email'     =\u003e 'mail',\n  },\n  group_mappings        =\u003e [\n    {\n      'group_dn' =\u003e 'alice',\n      'org_role' =\u003e 'Admin',\n    },\n  ],\n  require               =\u003e Class['::openldap::server'],\n}\n```\n\n## Reference\n\n### Classes\n\n#### Public Classes\n\n* [`grafana`](#class-grafana): Main class for managing Grafana.\n* [`grafana::ldap`](#class-grafanaldap): Main class for managing LDAP support\n  in Grafana.\n\n#### Private Classes\n\n* `grafana::install`: Handles Grafana installation.\n* `grafana::config`: Handles Grafana configuration.\n* `grafana::params`: Different configuration data for different systems.\n* `grafana::service`: Handles running the Grafana service.\n* `grafana::ldap::config`: Handles Grafana LDAP configuration.\n\n### Defined Types\n\n#### Public Defined Types\n\n* [`grafana::plugin`](#defined-type-grafanaplugin): Handles plugin\n  installation.\n\n### Native Types\n\n* [`grafana_ini_setting`](#native-type-grafana_ini_setting): Manages\n  configuration settings in `/etc/grafana/grafana.ini`.\n* [`package`](#native-type-package): Package provider for managing Grafana\n  plugins.\n\n## Limitations\n\nThis module has been built on and tested against Puppet 3.0 and higher.\n\nThe module has been tested on:\n\n* RedHat/CentOS Enterprise Linux 6/7\n\nTesting on other platforms has been light and cannot be guaranteed.\n\n## Development\n\nPlease log issues or pull requests at\n[github](https://github.com/bodgit/puppet-grafana).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodgit%2Fpuppet-grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodgit%2Fpuppet-grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodgit%2Fpuppet-grafana/lists"}