community.grafana.grafana_folder module – Manage Grafana folders
Note
This module is part of the community.grafana collection (version 2.1.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 community.grafana
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.grafana.grafana_folder
.
New in community.grafana 1.0.0
Synopsis
Create/update/delete Grafana folders through the folders API.
Requirements
The below requirements are needed on the host that executes this module.
The folders API is only available starting Grafana 5 and the module will fail if the server version is lower than version 5.
Parameters
Parameter |
Comments |
---|---|
PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, client_key is not required |
|
PEM formatted file that contains your private key to be used for SSL client authentication. If client_cert contains both the certificate and key, this option is not required. |
|
The Grafana API key. If set, |
|
The title of the Grafana folder. |
|
Grafana organization ID in which the datasource should be created. Not used when Mutually exclusive with Default: |
|
Grafana organization name in which the datasource should be created. Not used when Mutually exclusive with |
|
The parent folder UID. Available with subfolder feature of Grafana 11. |
|
Skip Grafana version check and try to reach api endpoint anyway. This parameter can be useful if you enabled Choices:
|
|
Delete the members not found in the list of members found on the folder. Choices:
|
|
The folder UID. |
|
The Grafana URL. |
|
The Grafana password for API authentication. Default: |
|
The Grafana user for API authentication. Default: |
|
If Choices:
|
|
If This should only set to Choices:
|
Examples
---
- name: Create a folder
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_group"
state: present
- name: Delete a folder
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_group"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Information about the folder Returned: On success |
|
Boolean specifying if current user can admin in folder Returned: always Sample: |
|
Boolean specifying if current user can edit in folder Returned: always Sample: |
|
Boolean specifying if current user can save in folder Returned: always Sample: |
|
The folder creation date Returned: always Sample: |
|
The name of the user who created the folder Returned: always Sample: |
|
Boolean specifying if folder has acl Returned: always Sample: |
|
The folder identifier Returned: always Sample: |
|
The organization id Returned: always Sample: |
|
The parent folders uid Returned: always as subfolder Sample: |
|
The folder title Returned: always Sample: |
|
The folder uid Returned: always Sample: |
|
The date the folder was last updated Returned: always Sample: |
|
The name of the user who last updated the folder Returned: always Sample: |
|
The folder url Returned: always Sample: |
|
The folder version Returned: always Sample: |