Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

grafana (110) Versions 1.5.4

Installs/Configures Grafana Server

Policyfile
Berkshelf
Knife
cookbook 'grafana', '= 1.5.4', :supermarket
cookbook 'grafana', '= 1.5.4'
knife supermarket install grafana
knife supermarket download grafana
README
Dependencies
Changelog
Quality 100%

Build Status

grafana Cookbook

A stand-alone cookbook for Grafana

Requirements

  • apt
  • nginx
  • git

Attributes

As with most cookbooks I write, this one is hopefully flexible enough to be wrapped by allowing you to override as much as possible

grafana::default

Attribute Default Description
node['grafana']['install_type'] 'file' The type of install we are going to use either git or file
node['grafana']['git']['url'] 'https://github.com/grafana/grafana' The url for the git repo to use for Grafana
node['grafana']['git']['branch'] 'master' The sha or branch name to use
node['grafana']['file']['type'] 'tar.gz' the type of archive file. zip or tar.gz.
node['grafana']['file']['version'] '1.9.1' the version to install.
node['grafana']['file']['url'] 'http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz' The file URL for the latest Grafana build
node['grafana']['file']['checksum'] 'c328c7a002622f672affbcaabd5e64ae279be1051ee27c62ba22bfed63680508' The sha256 of the Grafana file
node['grafana']['install_path'] '/srv/apps' The root directory where Grafana will be installed
node['grafana']['install_dir'] '/srv/apps/grafana' The directory to checkout into. A current symlink will be created in this directory as well.
node['grafana']['admin_password'] '' This is a password used when saving dashboard
node['grafana']['es_server'] '127.0.0.1' The ipaddress or hostname of your elasticsearch server
node['grafana']['es_port'] '9200' The port of your elasticsearch server's http interface
node['grafana']['es_role'] 'elasticsearch_server' eventually for wiring up discovery of your elasticsearch server, set to nil to prevent any search
node['grafana']['es_scheme'] 'http://' Scheme helper if elasticsearch is outside of this cookbook http:// or https://
node['grafana']['es_user'] '' Elasticsearch authentication user
node['grafana']['es_password'] '' Elasticsearch authentication password
node['grafana']['graphite_server'] '127.0.0.1' The ipaddress or hostname of your graphite server
node['grafana']['graphite_port'] '80' The port of your graphite server's http interface
node['grafana']['graphite_role'] 'graphite_server' eventually for wiring up discovery of your graphite server, set to nil to prevent any search
node['grafana']['graphite_scheme'] 'http://' Scheme helper if graphite is outside of this cookbook http:// or https://
node['grafana']['graphite_user'] '' Graphite authentication user
node['grafana']['graphite_password'] '' Graphite authentication password
node['grafana']['user'] '' The user who will own the files from the git checkout.
node['grafana']['config_template'] 'config.js.erb' The template to use for Grafana's config.js
node['grafana']['config_cookbook'] 'grafana' The cookbook that contains said config template
node['grafana']['webserver'] 'nginx' Which webserver to use: nginx or ''
node['grafana']['webserver_hostname'] node.name The primary vhost the web server will use for Grafana
node['grafana']['webserver_aliases'] [node['ipaddress']] Array of any secondary hostnames that are valid vhosts
node['grafana']['webserver_listen'] node['ipaddress'] The ip address the web server will listen on
node['grafana']['webserver_port'] 80 The port the webserver will listen on
node['grafana']['webserver_scheme'] 'http://' Scheme helper if webserver is outside of this cookbook http:// or https://
node['grafana']['default_route'] '/dashboard/file/default.json' Default route config, set start dashboard
node['grafana']['timezone_offset'] 'null' Timezone offset config, example: "-0500" (for UTC-5 hours)
node['grafana']['grafana_index'] 'grafana-index' Elasticsearch index to use for Grafana
node['grafana']['unsaved_changes_warning'] 'true' Enable disable unsaved changes warning in UI
node['grafana']['playlist_timespan'] '1m' Playlist timespan config
node['grafana']['window_title_prefix'] 'Grafana - ' Window title prefix config
node['grafana']['search_max_results'] 20 Search maximuyum result config
node['grafana']['datasources'] see below Grafana (> 1.7.0) data sources configuration

Starting with 1.7.0, Grafana uses datasources array in its configuration file
to know about the multiple databases it should read data from (elasticsearch,
graphite, InfluxDB, ...), we're generating this array from
node['grafana']['datasources'], the defaults are:

{
  'graphite' => {
    'type' => "'graphite'",
    'url'  => 'window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/_graphite"',
    'default' => true
  },
  'elasticsearch' => {
    'type' => "'elasticsearch'",
    'url'  => 'window.location.protocol+"//"+window.location.hostname+":"+window.location.port',
    'index' => lambda { "'#{node['grafana']['grafana_index']}'" },
    'grafanaDB' => true
  }
}

NOTE
Any derived attributes should be wrapped in a lambda if you expect to change
the value of the root attribute (see example above).

kibana::nginx

Attribute Default Description
node['grafana']['nginx']['template'] 'grafana-nginx.conf.erb' The template file to use for the nginx site configuration
node['grafana']['nginx']['template_cookbook'] 'grafana' The cookbook containing said template

Removed:

  • node['grafana']['nginx']['enable_default_site'] - use node['nginx']['enable_default_site']

Usage

grafana::default

The default recipe will:

  • install Grafana from master into /opt/grafana/master and create a symlink called current in the same directory to master
  • install nginx and serve the grafana application

If you want to use the file distribution of Grafana update node['grafana']['install_type'] attribute to file. Set node['grafana']['checksum'] to appropriate sha256 value of latest archive file.

If you don't want this cookbook to handle the webserver config simply set node['grafana']['webserver'] to '' in a role/environment/node somewhere.
Please note that in this case you have to set node['grafana']['user'].

Nginx recipe, by default, will configure the appropriate proxy to your ElasticSearch server such that you don't have to expose it to the world.

NOTE
There is NO security enabled by default on any of the content being served.
If you would like to modify the nginx parameters, you should:

  • create your own cookbook i.e. my-grafana
  • copy the template for the webserver you wish to use to your cookbook
  • modify the template as you see fit (add auth, setup ssl)
  • use the appropriate webserver template attributes to point to your cookbook and template

Testing

kitchen-test

Requires Vagrant >= 1.2 with the following plugins :

  • vagrant-berkshef
  • vagrant-omnibus
$ bundle install
$ kitchen test

Contributing

  • Fork the repository on Github
  • Create a named feature branch (like add_component_x)
  • Write you change
  • Write tests for your change (if applicable)
  • Run the tests, ensuring they all pass -- bundle exec strainer test
  • Submit a Pull Request using Github

License and Authors

Primary author:

Contributors:

  • Grégoire Seux (@kamaradclimber)
  • Anatoliy D. (@anatolijd)
  • Greg Fitzgerald (@gregf)
  • Fred Hatfull (@fhats)
  • Tim Smith (@tas50)
  • Jonathon W. Marshall (@jwmarshall)
  • Andrew Goktepe (@andrewgoktepe)
  • Miguel Landaeta (@nomadium)
  • Bernhard Köhler (@drywheat)
  • Olivier Bazoud (@obazoud)
  • @osigida

Based on chef-kibana cookbook by:

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

CHANGELOG for grafana

This file is used to list changes made in each version of grafana.

1.5.4:

  • Update Grafana to 1.9.1 (@osigida) #32
  • Interpolate "version" and "type" attributes to build grafana file url (Bernhard Köhler) #31 and (Olivier Bazoud) #29
  • Add support for lambdas in datasources. This change makes it possible to evaluate derived attributes correctly. (Bernhard Köhler) #30 and #25

1.5.3:

  • Add support for Centos#28

1.5.2:

  • Allow configuration of default_route via attributes (Miguel Landaeta) #26
  • Add support for grafana admin password option (Andrew Goktepe) #23

1.5.1:

  • Update Grafana to 1.8.1

1.5.0:

  • Update Grafana to 1.8.0

warning

  • Check for the presence of node['grafana']['es_role'] and node['grafana']['graphite_role'] instead of node['grafana']['es_server'] and node['grafana']['graphite_server'] to know if we should search and replace default['grafana']['es_server'] and default['grafana']['graphite_server'] (Jonathon W. Marshall) #22

1.4.2:

  • Fix attributes doc in README

1.4.1:

  • Do not use template resource's helpers method to bring back older Chef compatibility.

1.4.0:

  • Update Grafana to 1.8.0-rc1
  • Add default['grafana']['window_title_prefix'] and default['grafana']['search_max_results'] config attributes.

warnings

  • Grafana 1.8.0-rc1 upgraded to JQuery to 2.1.1 and thus dropped support for Internet Explorer 7 and 8

1.3.4:

  • Update attributes in README for better Supermarket display
  • Update foodcritic and rubocop (Tim Smith) #21
  • Remove mention of zipfile in README and attributes (Thanks to Gref Fitzgerald)
  • Fix default['grafana']['install_type'] documentation to have the correct possible values: git and file (Fred Hatfull) #20
  • Fix default['grafana']['webserver'] documentation not to include apache as possible value. (osigida) #19

1.3.2:

  • Update default Grafana to 1.7.0. (Greg Fitzgerald) #18.

1.3.1:

  • Update Grafana to 1.7.1-rc1. It fixes a regression introduced when merging #16. Thanks to Greg Fitzgerald for reporting it.

1.3.0:

  • Allow attribute configuration for datasources (Grégoire Seux) #16

1.2.0:

breaking changes

  • Update ark dependency to >= 0.7.2 and deprecation warning by using strip_component (Grégoire Seux) #15

minor changes

  • Support newer nginx cookbook by specifying template: false when enabling the grafana site (Grégoire Seux) #15

1.1.1:

  • Update default attributes to install Grafana 1.6.1 (Greg Fitzgerald) #14

1.1.0:

breaking changes

  • config.js data for graphite and elasticsearch changed back to use:

    • window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/_graphite"
    • window.location.protocol+"//"+window.location.hostname+":"+window.location.port

The idea is to allow external access without CORS problems or credential leaks in config.js.

  • Value for default['grafana']['install_path'] changed from /opt to /srv/apps (Greg Fitzgerald) #13
  • Default installation uses zip file instead of git (Greg Fitzgerald) #13

minor changes

  • Major cleanup and additional tests (Greg Fitzgerald) #13

1.0.6:

1.0.5:

breaking changes

  • config.js was unintentionally changed to use node info to configure graphite and elasticsearch index.
  • Value for default['grafana']['grafana_index'] changed from grafana-dash to grafana-index (Greg Fitzgerald) #11
  • Update grafana to 1.6.0 (Greg Fitzgerald) #11

1.0.4:

  • Update config.js based on the one in 1.5.4
  • Update to grafana 1.5.4
  • Update to new download URL

1.0.3:

  • Add some basic specs, foodcritic, knife test and enable TravisCI

  • Fix error with undefined grafana_user variable Thanks to @klamontagne

  • Fix timezone value quoting in config.js (Anatoliy D.) #9

  • Update grafana to 1.5.2 (Grégoire Seux) #7

  • Don't set normal attribute node['nginx']['default_site_enabled'] (Grégoire Seux) #5

  • Remove "use strict"; from config.js as it seems to not be present in
    grafana releases, thanks to @iiro for proposing it in #1

  • Don't search when node['grafana']['es_server'] or node['grafana']['graphite_server']
    is set and don't use normal attributes (Grégoire Seux) #3

  • Refactor and separate install in two recipes: install_git and install_file
    (Grégoire Seux) #2

1.0.2:

  • Update file release to 1.5.1

1.0.1:

  • Update file release to 1.5.0

1.0.0:

  • Initial release of grafana

Foodcritic Metric
            

1.5.4 passed this metric