From 2462acfd5d5a90403fd542ad4afd15e0a04da99f Mon Sep 17 00:00:00 2001 From: binary Date: Fri, 22 Jan 2021 21:37:30 +0100 Subject: Enforce grafana data dir --- roles/grafana/tasks/main.yml | 8 ++++++++ roles/grafana/vars/main.yml | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'roles') diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 5df8fa3..919f15e 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -7,6 +7,14 @@ - name: install grafana package: name=grafana state=present +- name: ensure grafana dir exists + file: + path: "{{ grafana_dir }}" + owner: "{{ grafana_user }}" + group: "{{ grafana_group }}" + mode: 0640 + state: directory + - name: generate grafana configuration template: src: grafana.ini.j2 diff --git a/roles/grafana/vars/main.yml b/roles/grafana/vars/main.yml index b980ba8..9e15d9c 100644 --- a/roles/grafana/vars/main.yml +++ b/roles/grafana/vars/main.yml @@ -4,10 +4,11 @@ --- +grafana_dir: /data/grafana grafana_port: 3001 grafana_port_out: 3000 -grafana_user: grafana -grafana_group: grafana +grafana_user: _grafana +grafana_group: _grafana grafana_db: sqlite grafana_instance_name: "rgoncalves.se monitoring" -- cgit v1.2.3