ansible-grafana icon indicating copy to clipboard operation
ansible-grafana copied to clipboard

grafana_dashboards_dir is checked on target hosts and not on deployer

Open mxbossard opened this issue 5 years ago • 3 comments

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 ?

mxbossard avatar Dec 14 '18 10:12 mxbossard

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.

paulfantom avatar Dec 14 '18 10:12 paulfantom

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.

mxbossard avatar Dec 14 '18 10:12 mxbossard

Please do so :)

paulfantom avatar Dec 14 '18 14:12 paulfantom

This role has been deprecated in favor of a the grafana-ansible-collection collection.

SuperQ avatar May 31 '23 04:05 SuperQ