community.general.gitlab_milestone module – Creates/updates/deletes GitLab Milestones belonging to project or group
Note
This module is part of the community.general collection (version 9.4.0).
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_milestone
.
New in community.general 8.3.0
Synopsis
When a milestone does not exist, it will be created.
When a milestone does exist, its value will be updated when the values are different.
Milestones can be purged.
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 CA certificates bundle to use to verify GitLab server certificate. |
|
The path of the group. Either this or |
|
A list of dictionaries that represents gitlab project’s or group’s milestones. Default: |
|
Milestone’s description. |
|
Milestone due date in YYYY-MM-DD format. |
|
Milestone start date in YYYY-MM-DD format. |
|
The name of the milestone. |
|
The path and name of the project. Either this or |
|
When set to Choices:
|
|
Create or delete milestone. 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 |
Will return details on what has changed (or possibly needs changing in |
Examples
# same project's task can be executed for group
- name: Create one milestone
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
milestones:
- title: milestone_one
start_date: "2024-01-04"
state: present
- name: Create many group milestones
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
group: "group1"
milestones:
- title: milestone_one
start_date: "2024-01-04"
description: this is a milestone
due_date: "2024-02-04"
- title: milestone_two
state: present
- name: Create many project milestones
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
milestones:
- title: milestone_one
start_date: "2024-01-04"
description: this is a milestone
due_date: "2024-02-04"
- title: milestone_two
state: present
- name: Set or update some milestones
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
milestones:
- title: milestone_one
start_date: "2024-05-04"
state: present
- name: Add milestone in check mode
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
milestones:
- title: milestone_one
start_date: "2024-05-04"
check_mode: true
- name: Delete milestone
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
milestones:
- title: milestone_one
state: absent
- name: Purge all milestones
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
purge: true
- name: Delete many milestones
community.general.gitlab_milestone:
api_url: https://gitlab.com
api_token: secret_access_token
project: "group1/project1"
state: absent
milestones:
- title: milestone-abc123
- title: milestone-two
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Four lists of the milestones which were added, updated, removed or exist. Returned: success |
|
A list of milestones which were created. Returned: always Sample: |
|
A list of milestones which were deleted. Returned: always Sample: |
|
A list of milestones which exist. Returned: always Sample: |
|
A list pre-existing milestones whose values have been set. Returned: always Sample: |
|
API object. Returned: success |