SUMMARY
Having the option to directly pass the dashboard content would eliminate the need to first create a file on the local filesystem.
ISSUE TYPE
COMPONENT NAME
community.grafana.grafana_dashboard
ADDITIONAL INFORMATION
The dashboard definition could come from a ansible var (object or JSON string) or directly passed to the task.
- name: Import Grafana dashboard foo from ansible var object
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
state: present
content: "{{ foo_dashboard }}"
- name: Import Grafana dashboard foo from json string
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
state: present
content: >
{
"title": "Foo",
"style": "dark",
...
}
# looks useless, but needs to be supported if the ansible var could be type object instead of JSON string
- name: Import Grafana dashboard foo from yaml
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
state: present
content:
title: Foo
style: dark
...
SUMMARY
Having the option to directly pass the dashboard content would eliminate the need to first create a file on the local filesystem.
ISSUE TYPE
COMPONENT NAME
community.grafana.grafana_dashboard
ADDITIONAL INFORMATION
The dashboard definition could come from a ansible var (object or JSON string) or directly passed to the task.