community / community.general / 6.6.8 / module / gitlab_group Creates/updates/deletes GitLab Groups Authors: Werner Dijkerman (@dj-wasabi), Guillaume Martinez (@Lunik)community.general.gitlab_group (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
When the group does not exist in GitLab, it will be created.
When the group does exist and state=absent, the group will be deleted.
- name: "Delete GitLab Group" community.general.gitlab_group: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" validate_certs: false name: my_first_group state: absent
- name: "Create GitLab Group" community.general.gitlab_group: api_url: https://gitlab.example.com/ validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_group path: my_first_group state: present
# The group will by created at https://gitlab.dj-wasabi.local/super_parent/parent/my_first_group - name: "Create GitLab SubGroup" community.general.gitlab_group: api_url: https://gitlab.example.com/ validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_group path: my_first_group state: present parent: "super_parent/parent"
# Other group which only allows sub-groups - no projects - name: "Create GitLab Group for SubGroups only" community.general.gitlab_group: api_url: https://gitlab.example.com/ validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_main_group path: my_main_group state: present project_creation_level: noone auto_devops_enabled: false subgroup_creation_level: maintainer
name: description: - Name of the group you want to create. required: true type: str path: description: - The path of the group you want to create, this will be api_url/group_path - If not supplied, the group_name will be used. type: str state: choices: - present - absent default: present description: - create or delete group. - Possible values are present and absent. type: str parent: description: - Allow to create subgroups - Id or Full path of parent group in the form of group/name type: str api_url: description: - The resolvable endpoint for the API type: str api_token: description: - GitLab access token with API permissions. type: str visibility: choices: - private - internal - public default: private description: - Default visibility of the group type: str avatar_path: description: - Absolute path image to configure avatar. File size should not exceed 200 kb. - This option is only used on creation, not for updates. type: path version_added: 4.2.0 version_added_collection: community.general description: description: - A description for the group. 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 api_job_token: description: - GitLab CI job token for logging in. type: str version_added: 4.2.0 version_added_collection: community.general validate_certs: default: true description: - Whether or not to validate SSL certs when supplying a https endpoint. type: bool api_oauth_token: description: - GitLab OAuth token for logging in. type: str version_added: 4.2.0 version_added_collection: community.general auto_devops_enabled: description: - Default to Auto DevOps pipeline for all projects within this group. type: bool version_added: 3.7.0 version_added_collection: community.general project_creation_level: choices: - developer - maintainer - noone description: - Determine if developers can create projects in the group. type: str version_added: 3.7.0 version_added_collection: community.general subgroup_creation_level: choices: - maintainer - owner description: - Allowed to create subgroups. type: str version_added: 3.7.0 version_added_collection: community.general require_two_factor_authentication: description: - Require all users in this group to setup two-factor authentication. type: bool version_added: 3.7.0 version_added_collection: community.general
error: description: the error message returned by the GitLab API returned: failed sample: '400: path is already in use' type: str group: description: API object returned: always type: dict msg: description: Success or failure message returned: always sample: Success type: str result: description: json parsed response from the server returned: always type: dict