I’m using OSS version 10.2.3 and I have exported the templates like they should be; however, I’m using ansible to deploy the dashboard to a production environment where the end user cannot modify the dashboard and should note be able too for contract reasons.
The problem is that when they are imported I get the error because in the Variables section of the bashboard the Query option datasource is not populated. But when I select the correct one I get an error: “This dashboard cannot be saved from the Grafana UI because it has been provisioned from another source.” Which is expected.
If I manually import the dashboard, which cannot be done in production and select the correct datasource for each of the variables everything works as it should.
The way I do the import with ansible is to copy the dashboard to the /opt/grafana-dashboard/VMware/dashboard.json location and copy a dashboard folder layout file to /etc/grafana/provisioning/dashboards/dashboard.yml, then restart the service and the folders are created and the dashboards are imported.
Anyway, I have the correct information for the datasources in the dashboard.json file, but it is not getting populated correctly:
"__inputs": [
{
"name": "DS_INFLUXDBV2-FLUX-VMWARE",
"label": "influxdbv2-flux-vmware",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
},
{
"name": "DS_INFLUXDBV2-FLUX-LINUX",
"label": "influxdbv2-flux-linux",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
],
If I scroll down the in the file I see this:
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDBV2-FLUX-VMWARE}"
},
....................
I’m thinking it would pick up the correct datasource value, but it is not getting populated.
No sure where else in the dashboard.json file I would need to modify it so when it is imported the correct datasources are loaded or if I have to figure out another approach.
Thanks for any insight.