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
When importing dashboards via provisioning (ie, grafana_use_provisioning is true and there are JSON files in grafana_dashboards_dir) the Grafana role will swap ownership of these files on the remote host between the "grafana" and root user, with the result that the role will always report some tasks as "changed", even when run twice in a row.
The "Import grafana dashboards" task's copy module sets the files owner to root (from "grafana") and then notifies "provisioned dashboards changed"; the "Set privileges on provisioned dashboards" handler will respond to that notification and use the file module to set the files' owner to "grafana" (from root). If you run the role again, it happens again.
We discovered this because we have Molecule testing of our own role (that imports this Grafana role) that asserts that the role is idempotent: that after running it once, running it again on the same host results in no tasks reporting that they made any changes.
We had been using an older version of this role which did not exhibit this problem; the difference seems to be that in the "Import grafana dashboards" task, the copy module did not set an owner: so the module would simply allow the current owner ("grafana") to persist and report "ok" instead of "changed" (and thus also not notify the handler).
It appears #167 added the additional configuration for owner: (and group:) to the copy module to fix what the PR calls a "small ownership issue" but I couldn't find any other details about what circumstances prompted the change.
The text was updated successfully, but these errors were encountered:
When importing dashboards via provisioning (ie,
grafana_use_provisioning
is true and there are JSON files ingrafana_dashboards_dir
) the Grafana role will swap ownership of these files on the remote host between the "grafana" and root user, with the result that the role will always report some tasks as "changed", even when run twice in a row.The "Import grafana dashboards" task's
copy
module sets the files owner to root (from "grafana") and then notifies "provisioned dashboards changed"; the "Set privileges on provisioned dashboards" handler will respond to that notification and use thefile
module to set the files' owner to "grafana" (from root). If you run the role again, it happens again.We discovered this because we have Molecule testing of our own role (that imports this Grafana role) that asserts that the role is idempotent: that after running it once, running it again on the same host results in no tasks reporting that they made any changes.
We had been using an older version of this role which did not exhibit this problem; the difference seems to be that in the "Import grafana dashboards" task, the
copy
module did not set anowner:
so the module would simply allow the current owner ("grafana") to persist and report "ok" instead of "changed" (and thus also not notify the handler).It appears #167 added the additional configuration for
owner:
(andgroup:
) to thecopy
module to fix what the PR calls a "small ownership issue" but I couldn't find any other details about what circumstances prompted the change.The text was updated successfully, but these errors were encountered: