community / community.general / 3.8.10 / module / gitlab_project Creates/updates/deletes GitLab Projects Authors: Werner Dijkerman (@dj-wasabi), Guillaume Martinez (@Lunik)community.general.gitlab_project (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
When the project does not exist in GitLab, it will be created.
When the project does exists and I(state=absent), the project will be deleted.
When changes are made to the project, the project will be updated.
- name: Create GitLab Project community.general.gitlab_project: api_url: https://gitlab.example.com/ api_token: "{{ api_token }}" name: my_first_project group: "10481470"
- name: Delete GitLab Project community.general.gitlab_project: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" validate_certs: False name: my_first_project state: absent delegate_to: localhost
- name: Create GitLab Project in group Ansible community.general.gitlab_project: api_url: https://gitlab.example.com/ validate_certs: True api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_project group: ansible issues_enabled: False merge_method: rebase_merge wiki_enabled: True snippets_enabled: True import_url: http://git.example.com/example/lab.git state: present delegate_to: localhost
name: description: - The name of the project. required: true type: str path: description: - The path of the project you want to create, this will be server_url/<group>/path. - If not supplied, name will be used. type: str group: description: - Id or the full path of the group of which this projects belongs to. type: str state: choices: - present - absent default: present description: - Create or delete project. - Possible values are present and absent. type: str api_url: description: - The resolvable endpoint for the API type: str username: description: - Used to create a personal project under a user's name. type: str version_added: 3.3.0 version_added_collection: community.general api_token: description: - GitLab token for logging in. type: str import_url: description: - Git repository which will be imported into gitlab. - GitLab server needs read access to this git repository. required: false type: str visibility: aliases: - visibility_level choices: - private - internal - public default: private description: - C(private) Project access must be granted explicitly for each user. - C(internal) The project can be cloned by any logged in user. - C(public) The project can be cloned without any authentication. type: str description: description: - An description for the project. type: str lfs_enabled: default: false description: - Enable Git large file systems to manages large files such as audio, video, and graphics files. required: false type: bool version_added: 2.0.0 version_added_collection: community.general api_password: description: - The password to use for authentication against the API type: str api_username: description: - The username to use for authentication against the API type: str merge_method: choices: - ff - merge - rebase_merge default: merge description: - What requirements are placed upon merges. - Possible values are C(merge), C(rebase_merge) merge commit with semi-linear history, C(ff) fast-forward merges only. type: str version_added: 1.0.0 version_added_collection: community.general wiki_enabled: default: true description: - If an wiki for this project should be available or not. type: bool squash_option: choices: - never - always - default_off - default_on description: - Squash commits when merging. type: str version_added: 3.4.0 version_added_collection: community.general ci_config_path: description: - Custom path to the CI configuration file for this project. type: str version_added: 3.7.0 version_added_collection: community.general issues_enabled: default: true description: - Whether you want to create issues or not. - Possible values are true and false. type: bool validate_certs: default: true description: - Whether or not to validate SSL certs when supplying a https endpoint. type: bool packages_enabled: description: - Enable GitLab package repository. type: bool version_added: 3.4.0 version_added_collection: community.general snippets_enabled: default: true description: - If creating snippets should be available or not. type: bool merge_requests_enabled: default: true description: - If merge requests can be made or not. - Possible values are true and false. type: bool shared_runners_enabled: description: - Enable shared runners for this project. type: bool version_added: 3.7.0 version_added_collection: community.general allow_merge_on_skipped_pipeline: description: - Allow merge when skipped pipelines exist. type: bool version_added: 3.4.0 version_added_collection: community.general remove_source_branch_after_merge: description: - Remove the source branch after merge. type: bool version_added: 3.4.0 version_added_collection: community.general only_allow_merge_if_pipeline_succeeds: description: - Only allow merges if pipeline succeeded. type: bool version_added: 3.4.0 version_added_collection: community.general only_allow_merge_if_all_discussions_are_resolved: description: - All discussions on a merge request (MR) have to be resolved. type: bool version_added: 3.4.0 version_added_collection: community.general
error: description: the error message returned by the GitLab API. returned: failed sample: '400: path is already in use' type: str msg: description: Success or failure message. returned: always sample: Success type: str project: description: API object. returned: always type: dict result: description: json parsed response from the server. returned: always type: dict