Skip to content

Commit

Permalink
gitlab_project: add option issues_access_level to enable/disable pr…
Browse files Browse the repository at this point in the history
…oject
  • Loading branch information
julien-lecomte committed Aug 15, 2024
1 parent e1b5ddb commit cce12d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- gitlab_project - add option ``issues_access_level`` to enable/disable project issues (https://github.com/ansible-collections/community.general/pull/8760).
15 changes: 15 additions & 0 deletions plugins/modules/gitlab_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,20 @@
type: bool
default: false
version_added: "4.0.0"
issues_access_level:
description:
- V(private) means that accessing issues tab is allowed only to project members.
- V(disabled) means that accessing issues tab is disabled.
- V(enabled) means that accessing issues tab is enabled.
- O(issues_access_level) and O(issues_enabled) are mutually exclusive.
type: str
choices: ["private", "disabled", "enabled"]
version_added: "9.4.0"
issues_enabled:
description:
- Whether you want to create issues or not.
- Possible values are true and false.
- O(issues_access_level) and O(issues_enabled) are mutually exclusive.
type: bool
default: true
lfs_enabled:
Expand Down Expand Up @@ -432,6 +442,7 @@ def create_or_update_project(self, module, project_name, namespace, options):
'feature_flags_access_level': options['feature_flags_access_level'],
'forking_access_level': options['forking_access_level'],
'infrastructure_access_level': options['infrastructure_access_level'],
'issues_access_level': options['issues_access_level'],
'issues_enabled': options['issues_enabled'],
'lfs_enabled': options['lfs_enabled'],
'merge_method': options['merge_method'],
Expand Down Expand Up @@ -605,6 +616,7 @@ def main():
import_url=dict(type='str'),
infrastructure_access_level=dict(type='str', choices=['private', 'disabled', 'enabled']),
initialize_with_readme=dict(type='bool', default=False),
issues_access_level=dict(type='str', choices=['private', 'disabled', 'enabled']),
issues_enabled=dict(type='bool', default=True),
lfs_enabled=dict(default=False, type='bool'),
merge_method=dict(type='str', default='merge', choices=["merge", "rebase_merge", "ff"]),
Expand Down Expand Up @@ -641,6 +653,7 @@ def main():
['api_token', 'api_oauth_token'],
['api_token', 'api_job_token'],
['group', 'username'],
['issues_access_level', 'issues_enabled'],
],
required_together=[
['api_username', 'api_password'],
Expand Down Expand Up @@ -668,6 +681,7 @@ def main():
import_url = module.params['import_url']
infrastructure_access_level = module.params['infrastructure_access_level']
initialize_with_readme = module.params['initialize_with_readme']
issues_access_level = module.params['issues_access_level']
issues_enabled = module.params['issues_enabled']
lfs_enabled = module.params['lfs_enabled']
merge_method = module.params['merge_method']
Expand Down Expand Up @@ -751,6 +765,7 @@ def main():
"import_url": import_url,
"infrastructure_access_level": infrastructure_access_level,
"initialize_with_readme": initialize_with_readme,
"issues_access_level": issues_access_level,
"issues_enabled": issues_enabled,
"lfs_enabled": lfs_enabled,
"merge_method": merge_method,
Expand Down

0 comments on commit cce12d0

Please sign in to comment.