community.general.gitlab_group_members (1.3.14) — module

Manage group members on GitLab Server

| "added in version" 1.2.0 of community.general"

Authors: Zainab Alsaffar (@zanssa)

Install collection

Install with ansible-galaxy collection install community.general:==1.3.14


Add to requirements.yml

  collections:
    - name: community.general
      version: 1.3.14

Description

This module allows to add and remove members to/from a group, or change a member's access level in a group on GitLab.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a user to a GitLab Group
  community.general.gitlab_group_members:
    api_url: 'https://gitlab.example.com'
    api_token: 'Your-Private-Token'
    gitlab_group: groupname
    gitlab_user: username
    access_level: developer
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a user from a GitLab Group
  community.general.gitlab_group_members:
    api_url: 'https://gitlab.example.com'
    api_token: 'Your-Private-Token'
    gitlab_group: groupname
    gitlab_user: username
    state: absent

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the member in the group.
    - On C(present), it adds a user to a GitLab group.
    - On C(absent), it removes a user from a GitLab group.
    type: str

api_url:
    description:
    - The resolvable endpoint for the API
    type: str

api_token:
    description:
    - A personal access token to authenticate with the GitLab API.
    required: true
    type: str

gitlab_user:
    description:
    - The username of the member to add to/remove from the GitLab group.
    required: true
    type: str

access_level:
    choices:
    - guest
    - reporter
    - developer
    - maintainer
    - owner
    description:
    - The access level for the user.
    - Required if I(state=present), user state is set to present.
    type: str

api_password:
    description:
    - The password to use for authentication against the API
    type: str

api_username:
    description:
    - The username to use for authentication against the API
    type: str

gitlab_group:
    description:
    - The name of the GitLab group the member is added to/removed from.
    required: true
    type: str

validate_certs:
    default: true
    description:
    - Whether or not to validate SSL certs when supplying a https endpoint.
    type: bool