grafana-ansible-collection
grafana-ansible-collection copied to clipboard
Fix "Option '[alerting].enabled' cannot be true. Legacy Alerting is removed" on 11.0.0
When trying to upgrade from a previous grafana version to 11.0.0 the grafana-server service fails to start and the log of the grafana-server service says:
May 17 17:51:26 grafanaXXXXXXXX grafana[100358]: logger=settings t=2024-05-17T17:51:26.688716678+02:00 level=error msg="Option '[alerting].enabled' cannot be true. Legacy Alerting is removed. It is no longer deployed, enhanced, or supported. Delete '[alerting].enabled' and use '[unified_alerting].enabled' to enable Grafana Alerting. For more information, refer to the documentation on upgrading to Grafana Alerting (https://grafana.com/docs/grafana/v10.4/alerting/set-up/migrating-alerts)"
The template grafana.ini.j2 has a fixed alerting section:
# Alerting
[alerting]
{% if grafana_alerting != {} %}
enabled = true
{% for k,v in grafana_alerting.items() %}
{% if k != 'enabled' %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
{% else %}
enabled = false
{% endif %}
Depending of the grafana version this has to be named ``[alerting]or[unified_alerting]`.
I took a look at the source code. https://github.com/grafana/grafana-ansible-collection/blob/afba48928b2a59241b244e822a368f2f46c16cd1/roles/grafana/templates/grafana.ini.j2#L116
As a workaround, you can deploy with alerting disabled by defining grafana_alerting: {}
I validated this works in my own deployment.
If you need to enable Legacy Alerting, there's no way to do so presently I think.
@michaelkebe could you please create PR?
There is PR #203 open
There is PR #203 open
Correct, there is a PR, but it is not ready because it hasn’t adjusted everything required.