From e43954bdd640756e266139e0cca3db9386a5b3e5 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Mon, 24 Jul 2023 14:32:59 +0200 Subject: [PATCH] templatizing grafana.ini --- tasks/server/grafana-prometheus.yml | 6 +++--- templates/conf/grafana.ini.j2 | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 templates/conf/grafana.ini.j2 diff --git a/tasks/server/grafana-prometheus.yml b/tasks/server/grafana-prometheus.yml index 3b0c6bd..03164f1 100644 --- a/tasks/server/grafana-prometheus.yml +++ b/tasks/server/grafana-prometheus.yml @@ -36,12 +36,12 @@ notify: "grafana-prometheus-restart" - name: "grafana-prometheus | create grafana.ini file" - file: - path: /opt/docker-compose/grafana-prometheus/grafana.ini + template: + src: conf/grafani.ini.j2 + dest: /opt/docker-compose/grafana-prometheus/grafana.ini owner: '1000' group: '1000' mode: '0750' - state: touch notify: "grafana-prometheus-restart" ignore_errors: '{{ ansible_check_mode }}' diff --git a/templates/conf/grafana.ini.j2 b/templates/conf/grafana.ini.j2 new file mode 100644 index 0000000..a066094 --- /dev/null +++ b/templates/conf/grafana.ini.j2 @@ -0,0 +1,3 @@ +[server] +domain = {{ grafana_domain }} +root_url = %(protocol)s://%(domain)s