New in version 2.1.
When the project does not exists 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.
- pyapi-gitlab python module
parameter | required | default | choices | comments |
---|---|---|---|---|
description |
no | An description for the project. | ||
group |
no | The name of the group of which this projects belongs to. When not provided, project will belong to user which is configured in 'login_user' or 'login_token' When provided with username, project will be created for this user. 'login_user' or 'login_token' needs admin rights. | ||
import_url |
no | Git repository which will me imported into gitlab. Gitlab server needs read access to this git repository. | ||
issues_enabled |
no | True | Whether you want to create issues or not. Possible values are true and false. | |
login_password |
no | Gitlab password for login_user | ||
login_token |
no | Gitlab token for logging in. | ||
login_user |
no | Gitlab user name. | ||
merge_requests_enabled |
no | True | If merge requests can be made or not. Possible values are true and false. | |
name |
yes | The name of the project | ||
path |
no | The path of the project you want to create, this will be server_url/<group>/path If not supplied, name will be used. | ||
public |
no | If the project is public available or not. Setting this to true is same as setting visibility_level to 20. Possible values are true and false. | ||
server_url |
yes | Url of Gitlab server, with protocol (http or https). | ||
snippets_enabled |
no | True | If creating snippets should be available or not. Possible values are true and false. | |
state |
no | present |
|
create or delete project. Possible values are present and absent. |
validate_certs |
no | True | When using https if SSL certificate needs to be verified. aliases: verify_ssl | |
visibility_level |
no | Private. visibility_level is 0. Project access must be granted explicitly for each user. Internal. visibility_level is 10. The project can be cloned by any logged in user. Public. visibility_level is 20. The project can be cloned without any authentication. Possible values are 0, 10 and 20. | ||
wiki_enabled |
no | True | If an wiki for this project should be available or not. Possible values are true and false. |
- name: "Delete Gitlab Project" local_action: gitlab_project server_url="http://gitlab.dj-wasabi.local" validate_certs=false login_token="WnUzDsxjy8230-Dy_k" name=my_first_project state=absent - name: "Create Gitlab Project in group Ansible" local_action: gitlab_project server_url="https://gitlab.dj-wasabi.local" validate_certs=true login_user=dj-wasabi login_password="MySecretPassword" name=my_first_project group=ansible issues_enabled=false wiki_enabled=true snippets_enabled=true import_url="http://git.example.com/example/lab.git" state=present
For more information on what this means please read Extras Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.