1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/gitlab_group_members/tasks/main.yml
patchback[bot] 203747027e
Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068)
* Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt.

* Replace 'Copyright:' with 'Copyright'

sed -i 's|Copyright:\(.*\)|Copyright\1|' $(rg -l 'Copyright:')

Co-authored-by: Maxwell G <gotmax@e.email>
(cherry picked from commit 123c7efe5e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-05 13:17:19 +02:00

74 lines
2.7 KiB
YAML

####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
# Test code for gitlab_group_members module
#
# Copyright (c) 2020, Zainab Alsaffar <Zainab.Alsaffar@mail.rit.edu>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Install required library
pip:
name: python-gitlab
state: present
- name: Add a User to A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_user: '{{ username }}'
access_level: '{{ gitlab_access_level }}'
state: present
- name: Remove a User from A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_user: '{{ username }}'
state: absent
- name: Add a list of Users to A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_user: '{{ userlist }}'
access_level: '{{ gitlab_access_level }}'
state: present
- name: Remove a list of Users to A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_user: '{{ userlist }}'
state: absent
- name: Add a list of Users with Dedicated Access Levels to A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_users_access: '{{ dedicated_access_users }}'
state: present
- name: Remove a list of Users with Dedicated Access Levels to A GitLab Group
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_users_access: '{{ dedicated_access_users }}'
state: absent
- name: Add a user, remove all others which might be on this access level
gitlab_group_members:
api_url: '{{ gitlab_server_url }}'
api_token: '{{ gitlab_api_access_token }}'
gitlab_group: '{{ gitlab_group_name }}'
gitlab_user: '{{ username }}'
access_level: '{{ gitlab_access_level }}'
pruge_users: '{{ gitlab_access_level }}'
state: present