summaryrefslogtreecommitdiffstats
path: root/roles/grafana/templates
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-06-17 18:37:49 +0200
committerAhmed Abdelhalim <[email protected]>2026-06-17 18:42:02 +0200
commitc7a4dfce1ad0b545b05a8043e321ad49e48873a6 (patch)
treefe8a0bfc1bc31dc93a8138cce179df2416875bf4 /roles/grafana/templates
parentd9dcfdd822f90eb65117523d7c15694fae952bd2 (diff)
Refactor pi roles to use .home.arpa subdomains for services
Diffstat (limited to 'roles/grafana/templates')
-rw-r--r--roles/grafana/templates/grafana.ini.j24
-rw-r--r--roles/grafana/templates/grafana.nginx.conf.j210
2 files changed, 13 insertions, 1 deletions
diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2
index 7685bed2..05166994 100644
--- a/roles/grafana/templates/grafana.ini.j2
+++ b/roles/grafana/templates/grafana.ini.j2
@@ -1,6 +1,8 @@
[server]
http_port = {{ grafana_port }}
-root_url = http://localhost:{{ grafana_port }}/
+{% if grafana_hostname | length > 0 %}
+root_url = http://{{ grafana_hostname }}/
+{% endif %}
[database]
type = {{ grafana_database_type }}
diff --git a/roles/grafana/templates/grafana.nginx.conf.j2 b/roles/grafana/templates/grafana.nginx.conf.j2
new file mode 100644
index 00000000..e6e1052c
--- /dev/null
+++ b/roles/grafana/templates/grafana.nginx.conf.j2
@@ -0,0 +1,10 @@
+server {
+ listen 80;
+ listen [::]:80;
+
+ server_name {{ grafana_hostname }};
+
+ location / {
+ proxy_pass http://127.0.0.1:{{ grafana_port }}/;
+ }
+}