From b1caa7db46c517b9283688cf58c8fd32f41216c6 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Fri, 20 Dec 2024 16:48:56 +0100 Subject: [PATCH] Fix sectionless items edge case --- roles/grafana/templates/grafana.ini.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2 index e0b7cdeb..8ed33dd7 100644 --- a/roles/grafana/templates/grafana.ini.j2 +++ b/roles/grafana/templates/grafana.ini.j2 @@ -3,6 +3,12 @@ # 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 }}] @@ -17,8 +23,6 @@ {{ sub_key }} = {{ sub_value }} {% endif %} {% endfor %} -{% else %} -{{ section }} = {{ items }} {% endif %} {% endfor %}