Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 1 | {%- if pillar.grafana.server.enabled %} |
| 2 | |
| 3 | include: |
| 4 | - git |
| 5 | - nodejs |
| 6 | |
| 7 | /srv/grafana: |
| 8 | file: |
| 9 | - directory |
| 10 | - mode: 755 |
| 11 | - makedirs: true |
| 12 | |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 13 | {% if pillar.grafana.server.source.type == 'git' %} |
| 14 | |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 15 | grafana_repository: |
| 16 | git.latest: |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 17 | - name: {{ pillar.grafana.server.source.address }} |
| 18 | - rev: {{ pillar.grafana.server.source.rev }} |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 19 | - target: /srv/grafana/site |
| 20 | - require: |
| 21 | - file: /srv/grafana |
| 22 | - pkg: git_packages |
| 23 | |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 24 | grafana_install: |
| 25 | cmd.run: |
Ales Komarek | 16e4725 | 2014-02-25 09:40:21 +0100 | [diff] [blame] | 26 | - names: |
| 27 | - npm install |
| 28 | - npm install -g grunt-cli |
| 29 | - grunt build |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 30 | - cwd: /srv/grafana/site |
| 31 | - unless: test -e /srv/grafana/site/node_modules |
| 32 | - require: |
| 33 | - git: grafana_repository |
| 34 | |
| 35 | {% endif %} |
| 36 | |
| 37 | /srv/grafana/site/src/config.js: |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 38 | file: |
| 39 | - managed |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 40 | - source: salt://grafana/conf/config.js |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 41 | - template: jinja |
Ales Komarek | 3efe39a | 2014-02-25 10:04:23 +0100 | [diff] [blame] | 42 | - require: |
| 43 | - cmd: grafana_install |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 44 | |
| 45 | {%- endif %} |