Skip to content
Snippets Groups Projects
Commit 965669b4 authored by Kevin TIBI's avatar Kevin TIBI Committed by Kevin Tibi
Browse files

Custom configuration for grafana

Add custom configuration for grafana

Change-Id: I03e3ab57ce538c0f86d1442c7bd30d3ce9012637
parent 378b8dd9
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,12 @@
- item.value.enabled | bool
with_dict: "{{ grafana_services }}"
- name: Check if extra configuration file exists
local_action: find path="{{ node_custom_config }}/grafana/"
changed_when: False
run_once: True
register: check_extra_conf_grafana
- name: Copying over config.json files
template:
src: "{{ item.key }}.json.j2"
......@@ -38,6 +44,21 @@
notify:
- Restart grafana container
- name: Copying over extra configuration file
become: true
vars:
service_name: "{{ item.0 }}"
template:
src: "{{ item.path }}"
dest: "{{ node_config_directory }}/grafana/{{ item.path | basename }}"
mode: "0660"
when:
- item is defined
with_items:
- "{{ check_extra_conf_grafana.files }}"
notify:
- Restart grafana container
- name: Check if custom grafana home dashboard exists
local_action: "stat path={{ node_custom_config }}/grafana/grafana_home_dashboard.json"
register: grafana_custom_dashboard_file
......
......@@ -7,6 +7,14 @@
"owner": "grafana",
"perm": "0600"
},
{% if check_extra_conf_grafana is defined %}{% if check_extra_conf_grafana.matched > 0 %}{% for plugin in check_extra_conf_grafana.files %}
{
"source": "{{ container_config_directory }}/{{ plugin.path | basename }}",
"dest": "/etc/grafana/{{ plugin.path | basename }}",
"owner": "grafana",
"perm": "0600",
},
{% endfor %}{% endif %}{% endif %}
{
"source": "{{ container_config_directory }}/grafana_home_dashboard.json",
"dest": "/usr/share/grafana/public/dashboards/home.json",
......
---
features:
- |
Add support of custom configuration files for grafana.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment