add option to populate google_analytics_4_id value
google_analytics_4_id isn't populated in the current j2 grafana.ini template
cf. https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#google_analytics_4_id (note: other values might be needed)
cc @gardar
A way to bypass is to manually add a task after the role to edit the file with community.general.ini_file
- name: Grafana.ini google_analytics_4_id setup
become: true
community.general.ini_file:
path: /etc/grafana/grafana.ini
section: analytics
option: google_analytics_4_id
value: "{{ lookup('ansible.builtin.env', 'VAR_google_analytics_4_id') }}"
backup: true
@gardar , is there anything I can help with to have this merged ? Thanks in advance !
Hello, has this been removed from the 6.0.1 version of the role ? I see a failure at preflight when grafana_analytics is defined.
Use grafana_ini.analytics.google_analytics_4_id.
Any grafana.ini setting can now be set via grafana_ini, no explicit support is required by ansible role.
Example:
roles:
- name: grafana.grafana.grafana
vars:
grafana_ini:
analytics:
google_analytics_4_id: XXXX