Skip to content

Commit

Permalink
Update grafana template
Browse files Browse the repository at this point in the history
  • Loading branch information
santilococo committed Dec 5, 2024
1 parent f0a4185 commit 28a75e1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions roles/grafana/templates/grafana.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
# http://docs.grafana.org/installation/configuration
# https://github.com/grafana/grafana/blob/master/conf/sample.ini

{% for k, v in grafana_ini.items() %}
{% if v is not mapping %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}

{% for section, items in grafana_ini.items() %}
{% if items is mapping %}
[{{ section }}]
{% for k,v in items.items() %}
{% for sub_key, sub_value in items.items() %}
{% if sub_value is mapping %}

[{{ section }}.{{ sub_key }}]
{% for k, v in sub_value.items() %}
{{ k }} = {{ v }}
{% endfor %}

{% else %}
{{ sub_key }} = {{ sub_value }}
{% endif %}
{% endfor %}
{% else %}
{{ section }} = {{ items }}
{% endif %}

{% endfor %}

0 comments on commit 28a75e1

Please sign in to comment.