You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the dashboard's json file contents and the dashboard state were unchanged - receive the ok after running the module, indicating that no changes are necessary.
ACTUAL RESULTS
Module run fails, since it attempts to create the dashboard as if it didn't exist or was changed, while overwrite was set to no.
TASK [prometheus : Install Grafana dashboards - Scylla folder] *****************************************************************************************************************************************************************************
failed: [prometheus] (item=grafana_dashboards/scylla/scylla_advanced.json) => {"ansible_loop_var": "item", "changed": false, "item": "grafana_dashboards/scylla/scylla_advanced.json", "msg": "error : Unable to update the dashboard advanced-4-5 : The dashboard has been changed by someone else (HTTP: 412)"}
failed: [prometheus] (item=grafana_dashboards/scylla/scylla_cql.json) => {"ansible_loop_var": "item", "changed": false, "item": "grafana_dashboards/scylla/scylla_cql.json", "msg": "error : Unable to update the dashboard cql-4-5 : The dashboard has been changed by someone else (HTTP: 412)"}
failed: [prometheus] (item=grafana_dashboards/scylla/scylla_detailed.json) => {"ansible_loop_var": "item", "changed": false, "item": "grafana_dashboards/scylla/scylla_detailed.json", "msg": "error : Unable to update the dashboard detailed-4-5 : The dashboard has been changed by someone else (HTTP: 412)"}
failed: [prometheus] (item=grafana_dashboards/scylla/scylla_keyspace.json) => {"ansible_loop_var": "item", "changed": false, "item": "grafana_dashboards/scylla/scylla_keyspace.json", "msg": "error : Unable to update the dashboard ks-4-5 : The dashboard has been changed by someone else (HTTP: 412)"}
failed: [prometheus] (item=grafana_dashboards/scylla/scylla_overview.json) => {"ansible_loop_var": "item", "changed": false, "item": "grafana_dashboards/scylla/scylla_overview.json", "msg": "error : Unable to update the dashboard overview-4-5 : The dashboard has been changed by someone else (HTTP: 412)"}
The text was updated successfully, but these errors were encountered:
SUMMARY
In modern Grafana versions (I am using 8.3.4), the dashboard difference check is being performed incorrectly, if the dashboard is not in the default folder with ID 0 (such dashboards will always be marked as changed). The problem is likely to be here https://github.com/ansible-collections/community.grafana/blob/main/plugins/modules/grafana_dashboard.py#L281 - this condition will always be false, since the
folderId
key is located in themeta
dictionary, which is being deleted at https://github.com/ansible-collections/community.grafana/blob/main/plugins/modules/grafana_dashboard.py#L276Therefore, the key is always being added to the downloaded JSON schema, and the equality check at https://github.com/ansible-collections/community.grafana/blob/main/plugins/modules/grafana_dashboard.py#L290 will always fail for dashboards with a non-default
folderId
.ISSUE TYPE
COMPONENT NAME
community.grafana.grafana_dashboard
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04, Grafana v8.3.4
STEPS TO REPRODUCE
community.grafana.grafana_dashboard
module's argumentpath
folder
argument to actual folder name the dashboard from step 1 was createdoverwrite
parameter set tono
EXPECTED RESULTS
If the dashboard's json file contents and the dashboard state were unchanged - receive the
ok
after running the module, indicating that no changes are necessary.ACTUAL RESULTS
Module run fails, since it attempts to create the dashboard as if it didn't exist or was changed, while
overwrite
was set tono
.The text was updated successfully, but these errors were encountered: