community.grafana.grafana_user – Manage Grafana User
community.grafana.grafana_user – Manage Grafana User
Note
This plugin is part of the community.grafana collection (version 1.1.0).
To install it use: ansible-galaxy collection install community.grafana
.
To use it in a playbook, specify: community.grafana.grafana_user
.
New in version 1.0.0: of community.grafana
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 | Choices/Defaults | Comments |
---|---|---|
client_cert path |
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 | |
client_key path |
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. | |
string |
The email of the Grafana User. | |
is_admin boolean |
|
The Grafana User is an admin. |
login string / required |
The login of the Grafana User. | |
name string |
The name of the Grafana User. | |
password string |
The password of the Grafana User. At the moment, this field is not updated yet. | |
state string |
|
State if the user should be present in Grafana or not |
url string / required |
The Grafana URL.
| |
url_password string |
Default: "admin" |
The Grafana password for API authentication.
|
url_username string |
Default: "admin" |
The Grafana user for API authentication.
|
use_proxy boolean |
|
If |
validate_certs boolean |
|
If This should only set to |
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 | Returned | Description | |
---|---|---|---|
user complex |
when state present |
Information about the User
| |
string |
always |
The User email address
Sample: | |
id integer |
always |
The User id
Sample: [42] | |
isDisabled boolean |
always |
The Grafana account status
Sample: [False] | |
isExternal boolean |
always |
The Grafana account information on external user provider
Sample: [False] | |
isGrafanaAdmin boolean |
always |
The Grafana user permission for admin
Sample: [False] | |
login string |
always |
The User login
Sample: ['batman'] | |
orgId integer |
always |
The organization id that the team is part of.
Sample: [1] | |
theme string |
always |
The Grafana theme
Sample: ['light'] |
Authors
- Antoine Tanzilli (@Tailzip)
- Hong Viet LE (@pomverte)
- Julien Alexandre (@jual)
- Marc Cyprien (@LeFameux)
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/grafana/grafana_user_module.html