aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ansible/roles')
-rw-r--r--docker/ansible/roles/run_grafana/tasks/main.yml13
1 files changed, 11 insertions, 2 deletions
diff --git a/docker/ansible/roles/run_grafana/tasks/main.yml b/docker/ansible/roles/run_grafana/tasks/main.yml
index 97012495..ea4ca8b9 100644
--- a/docker/ansible/roles/run_grafana/tasks/main.yml
+++ b/docker/ansible/roles/run_grafana/tasks/main.yml
@@ -31,6 +31,15 @@
- rm_grafana_image
when: rm_images|default(false)|bool == true
+- set_fact:
+ influxdb_host_ip_mapping: "{ '{{ influxdb_hostname }}': '{{ influxdb_host_ip }}' }"
+
+- name: Cleanup barometer-grafana cache directory under host
+ file:
+ path: /var/lib/grafana
+ state: absent
+ when: clean_grafana_cache|default(true)|bool == true
+
- name: launch barometer-grafana container
docker_container:
name: bar-grafana
@@ -40,9 +49,9 @@
ports:
- 3000:3000
env:
- "{{ influxdb_host }}": "{{ influxdb_hostname }}"
+ influxdb_host: "{{ influxdb_hostname }}"
etc_hosts:
- "{{ influxdb_hostname }}": "{{ influxdb_host_ip }}"
+ "{{ influxdb_host_ip_mapping }}"
detach: yes
restart: yes
network_mode: host