Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

feat: manage organization users #18

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
390a850
feat: manage organization users
Nemental Oct 17, 2023
9f36358
style: comments
Nemental Oct 17, 2023
8bee405
refactor: split task files for orga user mgmt
Nemental Oct 17, 2023
41e687d
docs: orga users
Nemental Oct 17, 2023
85a74ad
refactor: simplify vars and reorganize tags
Nemental Oct 18, 2023
f03c6dc
fix: include task apply tags and file
Nemental Oct 18, 2023
3e5d5f6
fix: list length conditional
Nemental Oct 18, 2023
10df450
chore: org users default var
Nemental Oct 18, 2023
a73376c
fix: get orgs loop, get users loop, error handling org user mgmt
Nemental Oct 18, 2023
66371b2
fix: include tasks tag handling and conditonal
Nemental Oct 18, 2023
f6c7eff
docs: org user mgmt params and notice
Nemental Oct 18, 2023
28abbab
Merge branch 'main' into feature/orga-users
Nemental Nov 1, 2023
37f8440
chore(deps): increase community.grafana version
Nemental Nov 3, 2023
8ae4004
docs: fix table
Nemental Nov 3, 2023
420527b
feat: enable org users with org_id
Nemental Nov 3, 2023
b2ef53c
docs: org_name or _id
Nemental Nov 3, 2023
acd3e96
refactor: removed org_name URI user mgmt in favour of community.grafa…
Nemental Nov 3, 2023
c5368b3
Merge branch 'telekom-mms:main' into feature/orga-users
Nemental Nov 29, 2023
5aa9131
test(molecule): org users
Nemental Nov 29, 2023
ef2a465
Merge remote-tracking branch 'upstream/main' into feature/orga-users
Nemental Nov 29, 2023
621f3d3
Merge branch 'main' into feature/orga-users
Nemental Dec 8, 2023
1693be3
fix: remove url params
Nemental Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use
| grafana_url | yes |
| grafana_username | yes |
| grafana_password | yes |

| [**grafana_users**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_user_module.html)
| [**grafana_users**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_user_module.html) |
| name | yes |
| email | no |
| login | yes |
| password | no |
| is_admin | no |
| state | no |
| [**grafana_organizations**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_organization_module.html)
| [**grafana_organizations**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_organization_module.html) |
| name | yes |
| state | no |
| [**grafana_teams**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_team_module.html)
| [**grafana_teams**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_team_module.html) |
| name | yes |
| email | no |
| members | no |
| state | no |
| enforce_members | no |
| skip_version_check | no |
| [**grafana_datasources**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_datasource_module.html)
| [**grafana_datasources**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_datasource_module.html) |
| tls_skip_verify | no |
| org_id | no |
| name | yes |
Expand All @@ -50,11 +49,11 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use
| password | no |
| additional_json_data | no |
| additional_secure_json_data | no |
| [**grafana_folders**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_folder_module.html)
| [**grafana_folders**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_folder_module.html) |
| name | yes |
| state | no |
| skip_version_check | no |
| [**grafana_dashboards**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_dashboard_module.html)
| [**grafana_dashboards**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_dashboard_module.html) |
| org_id | no |
| folder | no |
| state | no |
Expand All @@ -65,6 +64,11 @@ Configure Grafana organizations, dashboards, folders, datasources, teams and use
| dashboard_id | no |
| dashboard_revision | no |
| commit_message | no |
| [**grafana_organization_users**](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_organization_user_module.html) |
| login | yes |
| role | no |
| state | no |
| org_id / org_name | no |

## Example Playbook

Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
grafana_organizations: []
grafana_organization_users: []
grafana_users: []
grafana_teams: []
grafana_datasources: []
Expand Down
6 changes: 6 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
password: supersecure!123
email: [email protected]

grafana_organization_users:
- login: testuser
org_id: 1
- login: testuser
org_name: my_org

grafana_dashboards:
- folder: my_service
path: test_dashboard.json
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
collections: [{name: community.grafana, version: 1.5.4}]
collections: [{name: community.grafana, version: 1.6.0}]
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@
loop_control: {loop_var: user}
tags: user

- name: Manage organization users
community.grafana.grafana_organization_user:
login: "{{ organization_user.login }}"
role: "{{ organization_user.role | default(omit) }}"
state: "{{ organization_user.state | default(omit) }}"
org_id: "{{ organization_user.org_id | default(omit) }}"
org_name: "{{ organization_user.org_name | default(omit) }}"
loop: "{{ grafana_organization_users }}"
loop_control: {loop_var: organization_user}
tags: organization_user

- name: Manage dashboard
community.grafana.grafana_dashboard:
org_id: "{{ dashboard.org_id | default(omit) }}"
Expand Down
Loading