ansible-debops-infrastructure

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit 8dca887a5810d8e372bfc2b8b85d8da155f278af
parent c890217ad8c35068614fb5dedc845b807a802e1d
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Thu, 15 Feb 2018 01:59:22 +0200

Initialize grafana role

Diffstat:
ansible/inventory/group_vars/grafana/all.yml | 5+++++
ansible/inventory/group_vars/influxdb/all.yml | 1+
ansible/inventory/host_vars/spinny/haproxy.yml | 3+++
ansible/roles/grafana/tasks/main.yml | 18++++++++++++++++++
ansible/roles/influxdb/tasks/main.yml | 2+-
5 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/ansible/inventory/group_vars/grafana/all.yml b/ansible/inventory/group_vars/grafana/all.yml @@ -0,0 +1,5 @@ +--- + +grafana__volume: '/data/volumes/grafana' +grafana__admin_user: '{{ lookup("password", secret + "/credentials/grafana/admin_user") }}' +grafana__admin_password: '{{ lookup("password", secret + "/credentials/grafana/admin_password") }}' diff --git a/ansible/inventory/group_vars/influxdb/all.yml b/ansible/inventory/group_vars/influxdb/all.yml @@ -1,5 +1,6 @@ --- +influxdb__name: 'influx-collectd' influxdb__volume: '/data/volumes/influxdb' influxdb__collectd_db: 'collectd0' influxdb__admin_user: '{{ lookup("password", secret + "/credentials/influxdb/admin_user") }}' diff --git a/ansible/inventory/host_vars/spinny/haproxy.yml b/ansible/inventory/host_vars/spinny/haproxy.yml @@ -0,0 +1,3 @@ +--- + +haproxy__grafana_backend_port: 18083 diff --git a/ansible/roles/grafana/tasks/main.yml b/ansible/roles/grafana/tasks/main.yml @@ -0,0 +1,18 @@ +--- + +- name: Grafana container + docker_container: + name: grafana + image: grafana/grafana + state: started + restart_policy: always + pull: true + ports: + - "127.0.0.1:{{ haproxy__grafana_backend_port }}:3000" + volumes: + - "{{ grafana__volume }}:/var/lib/grafana" + links: + - "{{ influxdb__name}}:influx" + env: + GF_SECURITY_ADMIN_USER="{{ grafana__admin_user }}" + GF_SECURITY_ADMIN_PASSWORD="{{ grafana__admin_password }}" diff --git a/ansible/roles/influxdb/tasks/main.yml b/ansible/roles/influxdb/tasks/main.yml @@ -18,7 +18,7 @@ - name: InfluxDB container docker_container: - name: influx-collectd + name: "{{ influxdb__name }}" image: influxdb state: started restart_policy: always