community.general.gitlab_issue module – Create, update, or delete GitLab issues
Note
This module is part of the community.general collection (version 8.6.4).
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_issue
.
New in community.general 8.1.0
Synopsis
Creates an issue if it does not exist.
When an issue does exist, it will be updated if the provided parameters are different.
When an issue does exist and
state=absent
, the issue will be deleted.When multiple issues are detected, the task fails.
Existing issues are matched based on
title
andstate_filter
filters.
Requirements
The below requirements are needed on the host that executes this module.
python-gitlab >= 2.3.0
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. |
|
A list of assignee usernames omitting Set to an empty array to unassign all assignees. |
|
The CA certificates bundle to use to verify GitLab server certificate. |
|
A description of the issue. Gets overridden by a content of file specified at |
|
A path of file containing issue’s description. Accepts MarkDown formatted files. |
|
Type of the issue. Choices:
|
|
A list of label names. Set to an empty array to remove all labels. |
|
The path or numeric ID of the group hosting desired milestone. |
|
The name of the milestone. Set to empty string to unassign milestone. |
|
The path or name of the project. |
|
Create or delete issue. Choices:
|
|
Filter specifying state of issues while searching. Choices:
|
|
A title for the issue. The title is used as a unique identifier to ensure idempotency. |
|
Whether or not to validate SSL certs when supplying a HTTPS endpoint. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Create Issue
community.general.gitlab_issue:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
title: "Ansible demo Issue"
description: "Demo Issue description"
labels:
- Ansible
- Demo
assignee_ids:
- testassignee
state_filter: "opened"
state: present
- name: Delete Issue
community.general.gitlab_issue:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
title: "Ansible demo Issue"
state_filter: "opened"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
API object. Returned: success |
|
Success or failure message. Returned: always Sample: |