grfana from package
This commit is contained in:
parent
4eecac22d4
commit
a79bbdb2df
2 changed files with 56 additions and 1 deletions
19
README.md
19
README.md
|
@ -23,6 +23,25 @@ A beautiful, easy to use and feature rich Graphite dashboard replacement and gra
|
|||
port: 443
|
||||
user: test
|
||||
|
||||
## Sample pillar with source from stable package
|
||||
|
||||
grafana:
|
||||
server:
|
||||
enabled: true
|
||||
source:
|
||||
type: 'pkg'
|
||||
rev: 1.4.0
|
||||
elasticsearch:
|
||||
host: localhost
|
||||
port: 9200
|
||||
data:
|
||||
- name: metrics1
|
||||
type: graphite
|
||||
host: metrics1.domain.com
|
||||
ssl: true
|
||||
port: 443
|
||||
user: test
|
||||
|
||||
## Read more
|
||||
|
||||
* http://grafana.org/
|
||||
|
|
38
server.sls
38
server.sls
|
@ -10,7 +10,6 @@ include:
|
|||
- mode: 755
|
||||
- makedirs: true
|
||||
|
||||
|
||||
{% if pillar.grafana.server.source.type == 'git' %}
|
||||
|
||||
grafana_repository:
|
||||
|
@ -50,6 +49,43 @@ grafana_grun_build:
|
|||
- git: grafana_repository
|
||||
- file: /srv/grafana/site/src/config.js
|
||||
|
||||
{% elif pillar.grafana.server.source.type == 'pkg' %}
|
||||
|
||||
{% set version = pillar.grafana.server.source.rev %}
|
||||
|
||||
/srv/grafana/site/dist:
|
||||
file:
|
||||
- directory
|
||||
- mode: 755
|
||||
- makedirs: true
|
||||
|
||||
/srv/grafana/site/dist/config.js:
|
||||
file:
|
||||
- managed
|
||||
- source: salt://grafana/conf/config.js
|
||||
- template: jinja
|
||||
- require:
|
||||
- file: /srv/grafana/site/dist
|
||||
|
||||
download_grafana:
|
||||
cmd.run:
|
||||
- names:
|
||||
- wget https://github.com/torkelo/grafana/releases/download/v{{ version }}/grafana-{{ version }}.tar.gz
|
||||
- user: root
|
||||
- cwd: /root
|
||||
- unless: test -e /root/grafana-{{ version }}.tar.gz
|
||||
|
||||
untar_grafana:
|
||||
cmd.run:
|
||||
- names:
|
||||
- tar zxvf /root/grafana-{{ version }}.tar.gz -C /srv/grafana/site/dist
|
||||
- user: root
|
||||
- cwd: /root
|
||||
- unless: test -e /srv/grafana/dist/app
|
||||
- require:
|
||||
- file: /srv/grafana/site/dist/config.js
|
||||
- file: /srv/grafana/site/dist
|
||||
|
||||
{% endif %}
|
||||
|
||||
{%- endif %}
|
||||
|
|
Loading…
Reference in a new issue