rrey / rrey.grafana / 1.0.1 / module / grafana_team Manage Grafana Teams | "added in version" 2.10 of rrey.grafana" Authors: Rémi REY (@rrey) preview | supported by communityrrey.grafana.grafana_team (1.0.1) — module
Install with ansible-galaxy collection install rrey.grafana:==1.0.1
collections: - name: rrey.grafana version: 1.0.1
Create/update/delete Grafana Teams through the Teams API.
Also allows to add members in the team (if members exists).
The Teams API is only available starting Grafana 5 and the module will fail if the server version is lower than version 5.
--- - name: Create a team grafana_team: url: "https://grafana.example.com" grafana_api_key: "{{ some_api_token_value }}" name: "grafana_working_group" email: "foo.bar@example.com" state: present
- name: Create a team with members grafana_team: url: "https://grafana.example.com" grafana_api_key: "{{ some_api_token_value }}" name: "grafana_working_group" email: "foo.bar@example.com" members: - john.doe@example.com - jane.doe@example.com state: present
- name: Create a team with members and enforce the list of members grafana_team: url: "https://grafana.example.com" grafana_api_key: "{{ some_api_token_value }}" name: "grafana_working_group" email: "foo.bar@example.com" members: - john.doe@example.com - jane.doe@example.com enforce_members: yes state: present
- name: Delete a team grafana_team: url: "https://grafana.example.com" grafana_api_key: "{{ some_api_token_value }}" name: "grafana_working_group" email: "foo.bar@example.com" state: absent
url: description: - The Grafana URL. required: true type: str name: description: - The name of the Grafana Team. required: true type: str email: description: - The mail address associated with the Team. required: true type: str state: choices: - present - absent default: present description: - Delete the members not found in the C(members) parameters from the - list of members found on the Team. type: str members: description: - List of team members (emails). - The list can be enforced with C(enforce_members) parameter. type: list use_proxy: default: true description: - If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts. type: bool client_key: description: - PEM formatted file that contains your private key to be used for SSL client authentication. - If I(client_cert) contains both the certificate and key, this option is not required. type: path client_cert: description: - 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, I(client_key) is not required type: path url_password: aliases: - grafana_password default: admin description: - The Grafana password for API authentication. type: str url_username: aliases: - grafana_user default: admin description: - The Grafana user for API authentication. type: str validate_certs: default: true description: - If C(no), SSL certificates will not be validated. - This should only set to C(no) used on personally controlled sites using self-signed certificates. - Prior to 1.9.2 the code defaulted to C(no). type: bool enforce_members: default: false description: - Delete the members not found in the C(members) parameters from the - list of members found on the Team. type: bool grafana_api_key: description: - The Grafana API key. - If set, C(url_username) and C(url_password) will be ignored. type: str
team: contains: avatarUrl: description: The url of the Team avatar on Grafana server returned: always sample: - /avatar/a7440323a684ea47406313a33156e5e9 type: str email: description: The Team email address returned: always sample: - foo.bar@example.com type: str id: description: The Team email address returned: always sample: - 42 type: int memberCount: description: The number of Team members returned: always sample: - 42 type: int members: description: The list of Team members returned: always sample: - - john.doe@exemple.com type: list name: description: The name of the team. returned: always sample: - grafana_working_group type: str orgId: description: The organization id that the team is part of. returned: always sample: - 1 type: int description: Information about the Team returned: On success type: complex