grafana.grafana.dashboard module – Manage Dashboards in Grafana
Note
This module is part of the grafana.grafana collection (version 5.4.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install grafana.grafana
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: grafana.grafana.dashboard
.
New in grafana.grafana 0.0.1
Synopsis
Create, Update and delete Dashboards using Ansible.
Requirements
The below requirements are needed on the host that executes this module.
requests >= 1.0.0
Parameters
Parameter |
Comments |
---|---|
JSON source code for dashboard. |
|
Grafana API Key to authenticate with Grafana Cloud. |
|
URL of the Grafana instance. |
|
State for the Grafana Dashboard. Choices:
|
Notes
Note
Does not support
check_mode
.Does not support
Idempotency
.
Examples
- name: Create/Update a dashboard
grafana.grafana.dashboard:
dashboard: "{{ lookup('ansible.builtin.file', 'dashboard.json') }}"
grafana_url: "{{ grafana_url }}"
grafana_api_key: "{{ grafana_api_key }}"
state: present
- name: Delete dashboard
grafana.grafana.dashboard:
dashboard: "{{ lookup('ansible.builtin.file', 'dashboard.json') }}"
grafana_url: "{{ grafana_url }}"
grafana_api_key: "{{ grafana_api_key }}"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dict object containing folder information. Returned: On success |
|
The ID for the dashboard. Returned: on success Sample: |
|
The message returned after the operation on the dashboard. Returned: state is absent and on success Sample: |
|
The slug for the dashboard. Returned: state is present and on success Sample: |
|
The status of the dashboard. Returned: state is present and on success Sample: |
|
The name of the dashboard. Returned: state is absent and on success Sample: |
|
The UID for the dashboard. Returned: state is present and on success Sample: |
|
The endpoint for the dashboard. Returned: state is present and on success Sample: |
|
The version of the dashboard. Returned: state is present and on success Sample: |