servers/roles/grafana/tasks/main.yml
Timotej Lazar 998f2b0598 grafana: fix generated URLs
By setting root_url manually. Also disable some more analytics.
2025-10-21 12:22:06 +02:00

31 lines
994 B
YAML

- name: Install packages
package:
name: grafana
- name: Configure grafana
ini_file:
path: /etc/grafana.ini
section: '{{ item.section | default("") }}'
option: '{{ item.option }}'
value: '{{ item.value }}'
loop:
- { section: server, option: root_url, value: "https://%(domain)s/" }
- { section: analytics, option: check_for_updates, value: "false" }
- { section: analytics, option: check_for_plugin_updates, value: "false" }
- { section: analytics, option: feedback_links_enabled, value: "false" }
- { section: analytics, option: reporting_enabled, value: "false" }
- { section: news, option: news_feed_enabled, value: "false" }
- { section: public_dashboards, option: enabled, value: "false" }
notify: restart grafana
- name: Set up nginx site
template:
dest: '/etc/nginx/http.d/grafana.conf'
src: 'nginx.conf.j2'
notify: reload nginx
- name: Enable grafana
service:
name: grafana
enabled: yes
state: started