Merge pull request #530 from ungleich/grafana_dashboard

new type: __grafana_dashboard
This commit is contained in:
Darko Poljak 2017-06-11 13:59:17 +02:00 committed by GitHub
commit b821391f7a
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,43 @@
cdist-type__grafana_dashboard(7)
================================
NAME
----
cdist-type__grafana_dashboard - Install Grafana (https://grafana.com)
DESCRIPTION
-----------
This cdist type adds the Grafana repository, installs the grafana package, and sets the server to start on boot.
This is a singleton type.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
.. code-block:: sh
__grafana_dashboard
AUTHORS
-------
Kamila Součková <kamila@ksp.sk>
COPYING
-------
Copyright \(C) 2017 Kamila Součková. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

View File

@ -0,0 +1,32 @@
os=$(cat $__global/explorer/os)
os_version=$(cat $__global/explorer/os_version)
case $os in
debian|devuan)
case $os_version in
8*|jessie)
__apt_key_uri grafana \
--name 'Grafana Release Signing Key' \
--uri https://packagecloud.io/gpg.key
require="__apt_key_uri/grafana" __apt_source grafana \
--uri https://packagecloud.io/grafana/stable/debian/ \
--distribution jessie \
--component main
__package apt-transport-https
require="__apt_source/grafana __package/apt-transport-https" __package grafana
require="__package/grafana" __start_on_boot grafana-server
;;
*)
echo "Don't know how to install Grafana on $os $os_version. Send us a pull request!"
exit 1
;;
esac
;;
*)
echo "Don't know how to install Grafana on $os. Send us a pull request!"
exit 1
;;
esac