Closed bucovaina closed 1 year ago
The file was on the controller node. I tried scp-ing the acr10r.json file to the controlled node and low and behold, it works ...
Please go ahead and close as PEBKAC
I was wondering how the corresponding code could actually fail :D
community.grafana 1.1.0
Latest on ansible galaxy is 1.5.4
, you may want to bump your version.
Thanks for the suggestion, I might have a look at that :)
Yes, I don't know, maybe it's my lack of experience but it was not clear to me that the file had to be on the controlled node, not on the controller node. Is it worth mentioning that in the documentation or should any reasonable person know you have to scp/push the file first to the controlled node, then install it with this module? :D.
At least, I won't forget now, have been breaking my head over this for a few hours :)
SUMMARY
I'm trying to upload a dashboard with the file acr10r.json but I can't make the module install the dashboard. For some reason the module can't find the file. I have tried various things to make it work to no avail. The file originally resided in myansiblerepo/roles/rolename/files/acr10r.json (same rolename as the tasks/main.yml file that contains the task). First the path was set to "acr10r.json" like you would do with the Ansible builtin copy module. That didn't work, I had to specify the path. Then I tried, "files/acr10r.json", "../files/acr10r.json" and the entire path /home/user/Documents/.../.../rolename/files/acr10r.json), Then I tried moving the file to /tmp/ and chmod it to 777. But nothing seems to be working. I tried with the path surrounded by "", ' ' and without also to no avail.
ISSUE TYPE
COMPONENT NAME
grafana_dashboard
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible controller node: Debian 11.6.1 latest at time of writing Ansible controlled node: Idem but it's an LXC container in Proxmox, not a VM/bare metal machine.
STEPS TO REPRODUCE
So I run my ansible playbook as followd. The API key is freshly made with admin rights. I have tried various things with
path: '/tmp/acr10r.json'
. With/without apostrophe or double quotes. Full path relative path to main.yml, ... In this example, the file was effectively in /tmp/acr10r.json with 777 as permission bits to make absolutely sure it's not a permission problem.EXPECTED RESULTS
The dashboard to be installed like when I upload the exact same .json file to the web interface of the exact same instance and I can access it. Or at least an authentication failure that the API key is incorrect. My best guess is that the failure happens before the API key is tried.
ACTUAL RESULTS