community.grafana.grafana_user module – Manage Grafana User
Note
This module is part of the community.grafana collection (version 1.5.4).
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
.
To use it in a playbook, specify: community.grafana.grafana_user
.
New in community.grafana 1.0.0
Synopsis
Create/update/delete Grafana User through the users and admin API.
Tested with Grafana v6.4.3
Password update is not supported at the time
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 email of the Grafana User. |
|
The Grafana User is an admin. Choices:
|
|
The login of the Grafana User. |
|
The name of the Grafana User. |
|
The password of the Grafana User. At the moment, this field is not updated yet. |
|
State if the user should be present in Grafana or not Choices:
|
|
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:
|
Notes
Note
Unlike other modules from the collection, this module does not support `grafana_api_key` authentication type. The Grafana API endpoint for users management requires basic auth and admin privileges.
Examples
---
- name: Create or update a Grafana user
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
name: "Bruce Wayne"
email: [email protected]
login: batman
password: robin
is_admin: true
state: present
- name: Delete a Grafana user
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
login: batman
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Information about the User Returned: when state present |
|
The User email address Returned: always Sample: |
|
The User id Returned: always Sample: |
|
The Grafana account status Returned: always Sample: |
|
The Grafana account information on external user provider Returned: always Sample: |
|
The Grafana user permission for admin Returned: always Sample: |
|
The User login Returned: always Sample: |
|
The organization id that the team is part of. Returned: always Sample: |
|
The Grafana theme Returned: always Sample: |