From 74e1171063980e6885b33607c97df53925cf4bd9 Mon Sep 17 00:00:00 2001 From: "tommaso.piccioli" Date: Tue, 10 May 2016 16:31:42 +0200 Subject: [PATCH] new Grafana host --- tick/grafana/defaults/main.yml | 7 +++++++ tick/grafana/tasks/main.yml | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tick/grafana/defaults/main.yml create mode 100644 tick/grafana/tasks/main.yml diff --git a/tick/grafana/defaults/main.yml b/tick/grafana/defaults/main.yml new file mode 100644 index 00000000..a6c7efd0 --- /dev/null +++ b/tick/grafana/defaults/main.yml @@ -0,0 +1,7 @@ +--- +grafana_repo_key: https://packagecloud.io/gpg.key +grafana_repo: 'deb https://packagecloud.io/grafana/testing/debian/ wheezy main' +grafana_packages: + - grafana + +grafana_enabled: True diff --git a/tick/grafana/tasks/main.yml b/tick/grafana/tasks/main.yml new file mode 100644 index 00000000..2eb4a066 --- /dev/null +++ b/tick/grafana/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Install the grafana repo key + apt_key: url={{ grafana_repo_key }} state=present + tags: [ 'grafana', 'tick' ] + +- name: Install the grafana deb repository + apt_repository: repo='{{ grafana_repo }}' state=present update_cache=yes + tags: [ 'grafana', 'tick' ] + +- name: Install the grafana deb packages + apt: name='{{ item }}' state=present + with_items: '{{ grafana_packages }}' + tags: [ 'grafana', 'tick' ] + +- name: Ensure that grafana is enabled and running + service: name=grafana-server state=started enabled=yes + when: grafana_enabled + tags: [ 'grafana', 'tick' ] +