grafana.grafana.dashboard module – Manage Dashboards in Grafana
Note
This module is part of the grafana.grafana collection (version 0.0.6).
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
.
To use it in a playbook, specify: grafana.grafana.dashboard
.
New in version 0.0.1: of grafana.grafana
Synopsis
Create, Update and delete Dashboards using Ansible.
Parameters
Parameter |
Comments |
---|---|
CLoud API Key to authenticate with Grafana Cloud. |
|
JSON source code for dashboard |
|
Name of the Grafana Cloud stack to which the notification policies will be added |
|
State for the Grafana CLoud stack. Choices:
|
Examples
- name: Create/Update a dashboard
dashboard:
datasource: "{{ lookup('file', 'dashboard.json') }}"
stack_slug: "{{ stack_slug }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
state: present
- name: Delete dashboard
dashboard:
datasource: "{{ lookup('file', 'dashboard.json') }}"
stack_slug: "{{ stack_slug }}"
cloud_api_key: "{{ grafana_cloud_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 |
|
The message returned after the operation on the dashboard Returned: state is absent and on success |
|
The slug for the dashboard Returned: state is present and on success |
|
The status of the dashboard Returned: state is present and on success |
|
The name of the dashboard Returned: state is absent and on success |
|
The UID for the dashboard Returned: state is present and on success |
|
The endpoint for the dashboard Returned: state is present and on success |
|
The version of the dashboard Returned: state is present and on success |