When your JSON file contain a id field, Grafana API will search for a 
dashboard with this id, and if it does not exists it return a 404. Hence 
delete this from your JSON file and run your playbook.

Op woensdag 8 januari 2020 14:35:09 UTC+1 schreef anilkumar panditi:
>
> I am trying to import a Grafana dashboard(JSON) to Grafana. Following is 
> the ansible playbook
>
> ---
> - name: task to parameterise grafana template
>   hosts: localhost
>   become: true
>   user: root
>   tasks:
>     - name: Import Grafana dashboard
>       grafana_dashboard:
>         grafana_url: http://<host-ip>:3000
>         state: present
>         message: Updated by ansible
>         uid: edO3sTlipu
>         overwrite: yes
>         path: "/home/centos/Kubernetes_cluster_monitoring.json"
>
> And i am getting error below.
>
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "error : Unable to 
> create the new dashboard None : 404 - {'status': 404, 'body': 
> '{\"message\":\"Dashboard not found\",\"status\":\"not-found\"}', 
> 'content-length': '54', 'url': 'http://<IP>:3000/api/dashboards/db', 
> 'expires': '-1', 'msg': 'HTTP Error 404: Not Found', 'connection': 'close', 
> 'pragma': 'no-cache', 'cache-control': 'no-cache', 'date': 'Wed, 08 Jan 2020 
> 12:19:31 GMT', 'x-frame-options': 'deny', 'content-type': 
> 'application/json'}."}
>
> can you help please
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e814ca4d-9bcc-4eb9-ad79-26b9bb2363d0%40googlegroups.com.

Reply via email to