community.general.gitlab_project_approvals module – Manage project-level merge request approvals settings on GitLab Server
Note
This module is part of the community.general collection (version 13.1.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.gitlab_project_approvals.
New in community.general 13.1.0
Synopsis
This module allows to manage project-level merge request approval configurations.
Requirements
The below requirements are needed on the host that executes this module.
python-gitlab python module
requests (Python library https://pypi.org/project/requests/)
Parameters
Parameter |
Comments |
|---|---|
GitLab CI job token for logging in. |
|
GitLab OAuth token for logging in. |
|
The password to use for authentication against the API. |
|
GitLab access token with API permissions. |
|
The resolvable endpoint for the API. |
|
The username to use for authentication against the API. |
|
The number of approvals required before a merge request can be merged. Deprecated in GitLab 12.3. |
|
The CA certificates bundle to use to verify GitLab server certificate. |
|
Disable overriding approvers per merge request. Choices:
|
|
Allow authors to self-approve merge requests. Choices:
|
|
Prevent committers from approving merge requests. Choices:
|
|
The name or full path of the GitLab project. |
|
Require password reauthentication to approve a merge request. Deprecated in GitLab 16.9. Choices:
|
|
Require user reauthentication to approve a merge request. Choices:
|
|
Reset approvals on new commit. Choices:
|
|
Reset approvals from Code Owners if their files are changed. Choices:
|
|
Whether or not to validate SSL certs when supplying a HTTPS endpoint. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: none |
Returns details on what has changed (or possibly needs changing in |
Examples
- name: Configure GitLab Project approval settings
community.general.gitlab_project_approvals:
api_url: https://gitlab.example.com/
api_token: "{{ api_token }}"
project: my_group/my_project
reset_approvals_on_push: true
merge_requests_author_approval: false
merge_requests_disable_committers_approval: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The updated GitLab project approval settings. Returned: always Sample: |