-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata.json
45 lines (38 loc) · 16.9 KB
/
metadata.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"name": "grafana",
"description": "Installs/Configures grafana",
"long_description": "Grafana Cookbook [](https://travis-ci.org/JonathanTron/chef-grafana)\n================\n\nA stand-alone cookbook for Grafana. The 2.x versions of this cookbook work with the 2.x versions of Grafana. There is no backward compatibility for pre-2.0 versions of Grafana in the 2.x versions of this cookbook.\n\nIf you would like to configure pre-2.0 versions of Grafana, please use the 1.x branch and 1.x versions of this cookbook in the supermarket. There is a 1.x tag for PRs or Issues related to the 1.x branch.\n\nRequirements\n------------\n- apt\n- yum\n- nginx\n\nAttributes\n----------\nAs with most cookbooks, this one is hopefully flexible enough to be wrapped by allowing you to override as much as possible. Please let us know if you find a value that is not configurable.\n\n#### grafana::default\n\n| Attribute | Default | Description |\n|----------------------------------------------|:--------------------------------------:|-----------------------------------|\n| `node['grafana']['install_type']` | `'file'` | The type of install: `file`, `package` or `source`. *Note*: `source` is not currently supported. |\n| `node['grafana']['version']` | `'2.1.2'` | The version to install. For the most recent versions use `'latest'`. |\n| `node['grafana']['file']['url']` | `'https://grafanarel.s3.amazonaws.com/builds/grafana'` | The file URL for Grafana builds |\n| `node['grafana']['file']['checksum']['deb']` | `'57f52cc8e510f395f7f15caac841dc31e67527072fcbf5cc2d8351404989b298'` | The SHA256 checksum of Grafana .deb file |\n| `node['grafana']['file']['checksum']['rpm']` | `'618f5361e594b101a4832a67a9d82f1179c35ff158ef4288dc1f8b6e8de67bb8'` | The SHA256 checksum of Grafana .rpm file |\n| `node['grafana']['package']['repo']` | `'https://packagecloud.io/grafana/stable/'` | The grafana package repo |\n| `node['grafana']['package']['key']` | `'https://packagecloud.io/gpg.key'` | The package repo GPG key |\n| `node['grafana']['package']['components']` | `['main']` | The package repo components |\n| `node['grafana']['user']` | `'grafana'` | The grafana user |\n| `node['grafana']['group']` | `'grafana'` | The grafana group |\n| `node['grafana']['home']` | `'/usr/share/grafana'` | The value set to GRAFANA_HOME |\n| `node['grafana']['data_dir']` | `'/var/lib/grafana'` | The path grafana can use to store temp files, sessions, and the sqlite3 db |\n| `node['grafana']['log_dir']` | `'/var/log/grafana'` | Grafana's log directory |\n| `node['grafana']['env_dir']` | `'/etc/default'` or `'/etc/sysconfig'` | The location for environment variables - autoconfigured for rhel and debian systems |\n| `node['grafana']['conf_dir']` | `'/etc/grafana'` | The location to store the `grafana.ini` file |\n| `node['grafana']['webserver']` | `'nginx'` | Which webserver to use: `'nginx'` or `''` |\n| `node['grafana']['webserver_hostname']` | `node.name` | The server_name used in the webserver config |\n| `node['grafana']['webserver_aliases']` | `[node['ipaddress']]` | Array of any secondary hostnames that are valid vhosts |\n| `node['grafana']['webserver_listen']` | `node['ipaddress']` | The ip address the web server will listen on |\n| `node['grafana']['webserver_port']` | `80` | The port the webserver will listen on |\n\n##### grafana.ini\nFor the ini configuration file, parameters can be specified as this: `node['grafana']['ini'][SECTION_NAME][KEY] = [VALUE]`. Here's an example:\n\n```ruby\ndefault['grafana']['ini']['server']['protocol'] = 'http'\n```\n\nIt is also possible to specify a comment that will precede the parameter and to comment the parameter as well.\n\n```ruby\ndefault['grafana']['ini']['database']['ssl_mode'] = {\n comment: 'For \"postgres\" only, either \"disable\", \"require\" or \"verify-full\"',\n disable: true,\n value: 'disable'\n}\n```\n\nSee attributes/default.rb file for more details and examples.\n\n#### grafana::nginx\n\n| Attribute | Default | Description |\n|-------------------------------------------------|:--------------------------:|-----------------------------------|\n| `node['grafana']['nginx']['template']` | `'grafana-nginx.conf.erb'` | The template file to use for the nginx site configuration |\n| `node['grafana']['nginx']['template_cookbook']` | `'grafana'` | The cookbook containing said template |\n\nUsage\n-----\n#### grafana::default\nThe default recipe will:\n\n- install Grafana via downloaded system package\n- install `nginx` to proxy the grafana application\n\nIf you want to install the Grafana package repository, update `node['grafana']['install_type']` attribute to `package`. Additionally, the `node['grafana']['version']` can be set to `'latest'` so that the very latest Grafana build is used instead of the default release.\n\nNginx is used to proxy Grafana to run on port 80. If you don't want this cookbook to handle the webserver config simply set `node['grafana']['webserver']` to `''` in a role/environment/node somewhere.\n\n\n**NOTE**\nThere is **NO** security enabled by default on any of the content being served.\nIf you would like to modify the `nginx` parameters, you should:\n\n- create your own cookbook i.e. `my-grafana`\n- copy the template for the webserver you wish to use to your cookbook\n- modify the template as you see fit (add auth, setup ssl)\n- use the appropriate webserver template attributes to point to your cookbook and template\n\nResources\n---------\nIt's important to note that Grafana must be running for these resources to be used because they utilitze Grafana's HTTP API. In your recipe, you'll simply need to make sure that you include the default recipe that starts Grafana before using these.\n\n### grafana_datasource\nYou can control Grafana dataSources via the `grafana_datasource` LWRP. Due to the varying nature of the potental data sources, the information used to create the datasource is consumed by the resource as a Hash (the `source` attribute). The examples should illustrate the flexibility. The full breadth of options are (or will be) documented on the [Grafana website](http://docs.grafana.org/reference/http_api/#data-sources), however you can discover undocumented parameters by inspecting the HTTP requests your browser makes to the Grafana server.\n\n#### Attributes\n| Attribute | Type | Default Value | Description |\n|----------------|:--------:|:-----------------:|-----------------------------------|\n| `host` | `String` | `'localhost'` | The host grafana is running on |\n| `port` | `Integer`| `3000` | The port grafana is running on |\n| `user` | `String` | `'admin'` | A grafana user with admin privileges |\n| `password` | `String` | `'admin'` | The grafana user's password |\n| `source_name` | `String` | | The Data Source name as it will appear in Grafana. Defaults to the name unsed in the resource invocation. |\n| `source` | `Hash ` | `{}` | A Hash of the values to create the datasource. Examples below. |\n| `action` | `String` | `create` | Valid actions are `create`, `create_if_missing`, and `delete`. Create will update the datasource if it already exists. |\n\n\n#### Examples\nYou can create a data source for Graphite as follows:\n\n```ruby\ngrafana_datasource 'graphite-test' do\n source(\n type: 'graphite',\n url: 'http://10.0.0.15:8080',\n access: 'direct'\n )\nend\n```\n\nYou can create a data source for InfluxDB 0.8.x and make it the default dashboard as follows:\n\n```ruby\ngrafana_datasource 'influxdb-test' do\n source(\n type: 'influxdb_08',\n url: 'http://10.0.0.10:8086',\n access: 'proxy',\n database: 'metrics',\n user: 'dashboard',\n password: 'dashpass',\n isdefault: true\n )\n action :create_if_missing\nend\n```\n\n### grafana_dashboard\nDashboards in Grafana are always going to be incredibly specific to the application, but you may want to be able to create a new dashboard along with a newly provisioned stack. This resource assumes you have a static json file that displays the information that will be flowing from the newly created stack.\n\nThis resource currently makes an assumption that the name used in invocation matches the name of the dashboard. This will obviously have limitations, and could change in the future. More documentation on creating Grafana dashboards via the HTTP API can be found [here](http://docs.grafana.org/reference/http_api/#dashboards).\n\n#### Attributes\n| Attribute | Type | Default Value | Description |\n|----------------|:--------:|:-------------------:|-----------------------------------|\n| `host` | `String` | `'localhost'` | The host grafana is running on |\n| `port` | `Integer`| `3000` | The port grafana is running on |\n| `user` | `String` | `'admin'` | A grafana user with admin privileges |\n| `password` | `String` | `'admin'` | The grafana user's password |\n| `source_name` | `String` | | The extensionless name of the dashboard json file, and should match the dashboard title in the json (lower-cased and with hyphens for spaces) if `source` is not provided. Defaults to the name used in the resource invocation. |\n| `source` | `String` | `nil` | If you would like to override the name of the json file, use this attribute. |\n| `cookbook` | `String` | `nil` | The cookbook name to pull the file from if not this one |\n| `path` | `String` | `nil` | _Overrides `cookbook` and `source`_. The absolute path to the json file on disk. |\n| `overwrite` | `boolean`| `true` | Whether you want to overwrite existing dashboard with newer version or with same dashboard title |\n| `action` | `String` | `create_if_missing` | Valid actions are `create`, `create_if_missing`, and `delete`. Create will update the dashboard, so be careful! |\n\n#### Examples\nAssuming you have a `files/default/simple-dashboard.json`:\n\n```ruby\ngrafana_dashboard 'simple-dashboard'\n```\n\nIf you'd like to use a `my-dashboard.json` with the title `\"title\": \"Test Dash\"`:\n\n```ruby\ngrafana_dashboard 'test-dash' do\n source 'my-dashboard'\n overwrite false\nend\n```\n\nIf the dashboard you would like to import is already on disk with the title `\"title\": \"On Disk Dash\"`:\n\n```ruby\ngrafana_dashboard 'on-disk-dash' do\n path '/opt/grafana/dashboards/local-dash.json'\nend\n```\n\n### grafana_organization\nThis resource will allow you to create organizations within Grafana. This resource is minimally viable and only supports the addition of a new organization by name. It does check to see if an organization of the same name already exists, but it does not currently support adding address or city information.\n\nMore information about creating Grafana organizations via the HTTP API can be found [here](http://docs.grafana.org/reference/http_api/#organizations).\n\n#### Attributes\n| Attribute | Type | Default Value | Description |\n|----------------|:--------:|:-------------------:|-----------------------------------|\n| `host` | `String` | `'localhost'` | The host grafana is running on |\n| `port` | `Integer`| `3000` | The port grafana is running on |\n| `user` | `String` | `'admin'` | A grafana user with admin privileges |\n| `password` | `String` | `'admin'` | The grafana user's password |\n| `name` | `String` | | The name of the organization you would like to add. Defaults to the name used in the resource invocation. |\n| `action` | `String` | `create_if_missing` | Valid actions are `create_if_missing`. Delete and create are not currently supported. |\n\n#### Examples\nAssuming you would like to create a new organization called `Second Org.`:\n\n```ruby\ngrafana_organization 'Second Org.'\n```\n\n### grafana_user\nThis resource will allow you to create global users within Grafana. This resource is minimally viable and only supports the addition of global non-admin users. Contribution to the funcationality would be appreciated.\n\nMore information about creating Grafana users via the HTTP API can be found [here](http://docs.grafana.org/reference/http_api/#users).\n\n#### Attributes\n| Attribute | Type | Default Value | Description |\n|----------------|:--------:|:-------------------:|-----------------------------------|\n| `host` | `String` | `'localhost'` | The host grafana is running on |\n| `port` | `Integer`| `3000` | The port grafana is running on |\n| `user` | `String` | `'admin'` | A grafana user with admin privileges |\n| `password` | `String` | `'admin'` | The grafana user's password |\n| `global` | `boolean`| `true` | Whether you want the user to be a global user. _Currently only global `true` is supported._ |\n| `admin` | `boolean`| `false` | Whether or not the user should be a global admin. _Currently only admin `false` is supported._ |\n| `login` | `String` | | The login for this user. Defaults to the name used in the resource invocation. |\n| `full_name` | `String` | | The common, human-readable name used for the user |\n| `email` | `String` | | The email address for this user |\n| `passwd` | `String` | | The password to use for this user |\n| `action` | `String` | `create_if_missing` | Valid actions are `create_if_missing`. Delete and create are not currently supported. |\n\n#### Examples\nAssuming you would like to create a new user...\n\n```ruby\ngrafana_user 'person2' do\n full_name 'John Smith'\n email 'test@example.com'\n passwd 'test123'\nend\n```\n\nTesting\n-------\n#### Foodcritic & Rubocop\n\n```\n$ bundle exec foodcritic -X spec -f any ./\n$ bundle exec rubocop\n```\n\n#### ChefSpec\n\n```\n$ bundle exec rspec\n```\n\n#### kitchen-test\n\nRequires Vagrant >= 1.7.\n\n```\n$ bundle install\n$ bundle exec kitchen test\n```\n\nContributing\n------------\n- Fork the repository on Github\n- Create a named feature branch (like `add_component_x`)\n- Write your change\n- Write tests for your change (if applicable)\n- Run the tests, ensuring they all pass -- `bundle exec strainer test`\n- Submit a Pull Request using Github\n\nLicense and Authors\n-------------------\nPrimary authors:\n\n- Jonathan Tron <jonathan@tron.name>\n- Mike Lanyon <lanyonm@gmail.com>\n\nContributors:\n\n- Grégoire Seux (@kamaradclimber)\n- Anatoliy D. (@anatolijd)\n- Greg Fitzgerald (@gregf)\n- Fred Hatfull (@fhats)\n- Tim Smith (@tas50)\n- Jonathon W. Marshall (@jwmarshall)\n- Andrew Goktepe (@andrewgoktepe)\n- Miguel Landaeta (@nomadium)\n- Bernhard Köhler (@drywheat)\n- Olivier Bazoud (@obazoud)\n- @osigida\n- @BackSlasher\n- Helio Campos Mello de Andrade (@HelioCampos)\n- Arif Akram Khan (@arifcse019)\n\nBased on `chef-kibana` cookbook by:\n\n- John E. Vincent <lusis.org+github.com@gmail.com>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"maintainer": "Jonathan Tron",
"maintainer_email": "jonathan@tron.name",
"license": "Apache 2.0",
"platforms": {
"ubuntu": ">= 12.04",
"debian": ">= 7.0",
"centos": ">= 6.4"
},
"dependencies": {
"apt": ">= 0.0.0",
"yum": ">= 0.0.0",
"nginx": ">= 0.0.0"
},
"recommendations": {
},
"suggestions": {
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
"grafana::default": "Installs and configures Grafana with a web server proxy"
},
"version": "2.1.3",
"source_url": "",
"issues_url": ""
}