cdist/cdist/conf/type/__grafana_dashboard/manifest

47 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-07-15 20:16:25 +00:00
#!/bin/sh -e
os=$(cat "$__global/explorer/os")
os_version=$(cat "$__global/explorer/os_version")
2017-06-02 13:28:52 +00:00
2018-10-07 08:20:08 +00:00
require=""
2017-06-02 13:28:52 +00:00
case $os in
debian|devuan)
2017-06-09 16:40:47 +00:00
case $os_version in
8*|jessie)
# Differntation not needed anymore
apt_source_distribution=stable
;;
9*|ascii/ceres|ascii)
# Differntation not needed anymore
apt_source_distribution=stable
;;
10*|11*)
# Differntation not needed anymore
apt_source_distribution=stable
;;
2017-06-09 16:40:47 +00:00
*)
2018-03-11 09:52:25 +00:00
echo "Don't know how to install Grafana on $os $os_version. Send us a pull request!" >&2
2017-06-09 16:40:47 +00:00
exit 1
2018-03-11 09:52:25 +00:00
;;
2017-06-09 16:40:47 +00:00
esac
2018-03-11 09:52:25 +00:00
__apt_key_uri grafana \
--name 'Grafana Release Signing Key' \
--uri https://packages.grafana.com/gpg.key
2018-03-11 09:52:25 +00:00
require="$require __apt_key_uri/grafana" __apt_source grafana \
--uri https://packages.grafana.com/oss/deb \
2018-03-11 09:52:25 +00:00
--distribution $apt_source_distribution \
--component main
__package apt-transport-https
require="$require __apt_source/grafana" __apt_update_index
require="$require __package/apt-transport-https __apt_update_index" __package grafana
2018-03-11 09:52:25 +00:00
require="$require __package/grafana" __start_on_boot grafana-server
require="$require __start_on_boot/grafana-server" __process grafana-server --start "service grafana-server start"
;;
2017-06-02 13:28:52 +00:00
*)
2018-03-11 09:52:25 +00:00
echo "Don't know how to install Grafana on $os. Send us a pull request!" >&2
2017-06-02 13:28:52 +00:00
exit 1
2018-03-11 09:52:25 +00:00
;;
2017-06-02 13:28:52 +00:00
esac