grafana.grafana.user module – Manage Users in Grafana
Note
This module is part of the grafana.grafana collection (version 6.0.1).
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.user
.
New in grafana.grafana 0.0.1
Synopsis
Create, Update and delete Users using Ansible.
Requirements
The below requirements are needed on the host that executes this module.
requests >= 1.0.0
Parameters
Parameter |
Comments |
---|---|
Grafana admin username |
|
Grafana admin password |
|
Email address of the user. |
|
URL of the Grafana instance. |
|
Login of the user |
|
Name of the user. |
|
Password of the user. Should be provided if state=present |
|
State for the Grafana User. Choices:
|
Notes
Note
Does not support
check_mode
.Does not support
Idempotency
.
Examples
- name: Create/Update a user
grafana.grafana.user:
login: "grafana_user"
password: "{{ lookup('ansible.builtin.password') }}"
email: "grafana_user@localhost.local
name: "grafana user"
grafana_url: "{{ grafana_url }}"
admin_name: "admin"
admin_password: "admin"
state: present
- name: Delete user
grafana.grafana.user:
login: "grafana_user"
grafana_url: "{{ grafana_url }}"
admin_name: "admin"
admin_password: "admin"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dict object containing user information and message. Returned: On success |
|
The email for the user. Returned: on success Sample: |
|
The ID for the user. Returned: on success Sample: |
|
The login for the user. Returned: on success Sample: |
|
The name for the user. Returned: on success Sample: |