community / community.general / 1.3.11 / module / gitlab_project Creates/updates/deletes GitLab Projects Authors: Werner Dijkerman (@dj-wasabi), Guillaume Martinez (@Lunik)community.general.gitlab_project (1.3.11) — module
Install with ansible-galaxy collection install community.general:==1.3.11
collections: - name: community.general version: 1.3.11
When the project does not exist in GitLab, it will be created.
When the project does exists and state=absent, the project will be deleted.
When changes are made to the project, the project will be updated.
- 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 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: - Private. Project access must be granted explicitly for each user. - Internal. The project can be cloned by any logged in user. - Public. The project can be cloned without any authentication. type: str description: description: - An description for the project. type: str 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. - Possible values are true and false. type: bool 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 snippets_enabled: default: true description: - If creating snippets should be available or not. - Possible values are true and false. type: bool merge_requests_enabled: default: true description: - If merge requests can be made or not. - Possible values are true and false. type: bool
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