diff --git a/changelogs/fragments/3379-gitlab_project-ci_cd_properties.yml b/changelogs/fragments/3379-gitlab_project-ci_cd_properties.yml new file mode 100644 index 0000000000..dc68c27541 --- /dev/null +++ b/changelogs/fragments/3379-gitlab_project-ci_cd_properties.yml @@ -0,0 +1,2 @@ +minor_changes: + - gitlab_project - add new properties ``ci_config_path`` and ``shared_runners_enabled`` (https://github.com/ansible-collections/community.general/pull/3379). diff --git a/plugins/modules/source_control/gitlab/gitlab_project.py b/plugins/modules/source_control/gitlab/gitlab_project.py index b3a6ca2064..338da7c072 100644 --- a/plugins/modules/source_control/gitlab/gitlab_project.py +++ b/plugins/modules/source_control/gitlab/gitlab_project.py @@ -145,7 +145,16 @@ options: type: str choices: ["never", "always", "default_off", "default_on"] version_added: "3.4.0" - + ci_config_path: + description: + - Custom path to the CI configuration file for this project. + type: str + version_added: "3.7.0" + shared_runners_enabled: + description: + - Enable shared runners for this project. + type: bool + version_added: "3.7.0" ''' EXAMPLES = r''' @@ -252,6 +261,8 @@ class GitLabProject(object): 'packages_enabled': options['packages_enabled'], 'remove_source_branch_after_merge': options['remove_source_branch_after_merge'], 'squash_option': options['squash_option'], + 'ci_config_path': options['ci_config_path'], + 'shared_runners_enabled': options['shared_runners_enabled'], } # Because we have already call userExists in main() if self.projectObject is None: @@ -364,6 +375,8 @@ def main(): packages_enabled=dict(type='bool'), remove_source_branch_after_merge=dict(type='bool'), squash_option=dict(type='str', choices=['never', 'always', 'default_off', 'default_on']), + ci_config_path=dict(type='str'), + shared_runners_enabled=dict(type='bool'), )) module = AnsibleModule( @@ -402,6 +415,8 @@ def main(): packages_enabled = module.params['packages_enabled'] remove_source_branch_after_merge = module.params['remove_source_branch_after_merge'] squash_option = module.params['squash_option'] + ci_config_path = module.params['ci_config_path'] + shared_runners_enabled = module.params['shared_runners_enabled'] if not HAS_GITLAB_PACKAGE: module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) @@ -466,6 +481,8 @@ def main(): "packages_enabled": packages_enabled, "remove_source_branch_after_merge": remove_source_branch_after_merge, "squash_option": squash_option, + "ci_config_path": ci_config_path, + "shared_runners_enabled": shared_runners_enabled, }): module.exit_json(changed=True, msg="Successfully created or updated the project %s" % project_name, project=gitlab_project.projectObject._attrs)