community.general.gitlab_hook – Manages GitLab project hooks.¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gitlab_hook
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
python-gitlab python module
Parameters¶
Examples¶
- name: "Adding a project hook"
community.general.gitlab_hook:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
project: "my_group/my_project"
hook_url: "https://my-ci-server.example.com/gitlab-hook"
state: present
push_events: yes
tag_push_events: yes
hook_validate_certs: no
token: "my-super-secret-token-that-my-ci-server-will-check"
- name: "Delete the previous hook"
community.general.gitlab_hook:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
project: "my_group/my_project"
hook_url: "https://my-ci-server.example.com/gitlab-hook"
state: absent
- name: "Delete a hook by numeric project id"
community.general.gitlab_hook:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
project: 10
hook_url: "https://my-ci-server.example.com/gitlab-hook"
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Marcus Watkins (@marwatk)
Guillaume Martinez (@Lunik)