ansible-grafana
ansible-grafana copied to clipboard
grafana_dashboards_dir is checked on target hosts and not on deployer
Hi if I uderstand well the grafana_dashboards_dir property, the role should pick the dahsboard in this local directory and copied it to a temp directory. Is that the behaviour expeted ?
For now, the task named "Check if there are any dashboards in {{ grafana_dashboards_dir }}" in main.yml to not do this on localhost but on each remote host. It seems to be a mistake.
Moreover, at the end of dashboards.yml, every dashboards are imported through the API. I think that if we choose the provisioning method (grafana_use_provisioning), the files in local /tmp/dashboards should simply be copied in remote /etc/grafana/provisioning/dashboards.
What do you think about it ?
As for {{ grafana_dashboards_dir }}
you are right, this is a bug.
We are importing dashboards through an API since it wasn't previously possible to copy dashboards from grafana.net/dashboards directly to a directory used by grafana provisioning mechanism. That's why there is Set the correct data source name in the dashboard
task. And we went with an API method since we wanted to have a unified way to upload such dashboards and custom dashoards.
I found some other bugs. If you want I may propose a PR to use the grafana provisioning for dashboard, like this is done for datasources.
Please do so :)
This role has been deprecated in favor of a the grafana-ansible-collection collection.