mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
add a custom module for managing group membership in gitlab (#844)
* add a custom module for managing group membership in gitlab * add integration test & modify the module * modify the module * modify the module * remove whitespace * add aliases file & modify the module * minor and suggested modifications * suggested modifications * more minor modifications * modified the module to use gitlabAuth * removed api_url from the doc * remove api_token * add update access level for an existing user * remove access level if statement
This commit is contained in:
parent
2b3c8f4582
commit
905239f530
5 changed files with 295 additions and 0 deletions
1
tests/integration/targets/gitlab_group_members/aliases
Normal file
1
tests/integration/targets/gitlab_group_members/aliases
Normal file
|
@ -0,0 +1 @@
|
|||
unsupported
|
|
@ -0,0 +1,25 @@
|
|||
# Test code for gitlab_group_members module
|
||||
#
|
||||
# Copyright: (c) 2020, Zainab Alsaffar <Zainab.Alsaffar@mail.rit.edu>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
- 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
|
|
@ -0,0 +1,5 @@
|
|||
gitlab_server_url: https://gitlabserver.example.com
|
||||
gitlab_api_access_token: 126hngbscx890cv09b
|
||||
gitlab_group_name: groupname1
|
||||
username: username1
|
||||
gitlab_access_level: developer
|
Loading…
Add table
Add a link
Reference in a new issue