Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.github_hooks
.
version 2.0.0
Replaced by more granular modules
Use community.general.github_webhook and community.general.github_webhook_info instead.
Parameter | Choices/Defaults | Comments |
---|---|---|
action string / required |
| This tells the githooks module what you want it to do. |
content_type string |
| Content type to use for requests made to the webhook |
hookurl string | When creating a new hook, this is the url that you want GitHub to post to. It is only required when creating a new hook. | |
oauthkey string / required | The oauth key provided by GitHub. It can be found/generated on GitHub under "Edit Your Profile" >> "Developer settings" >> "Personal Access Tokens" | |
repo string / required | This is the API url for the repository you want to manage hooks for. It should be in the form of: https://api.github.com/repos/user:/repo:. Note this is different than the normal repo url. | |
user string / required | GitHub username. | |
validate_certs boolean |
| If no , SSL certificates for the target repo will not be validated. This should only be used on personally controlled sites using self-signed certificates. |
- name: Create a new service hook ignoring duplicates community.general.github_hooks: action: create hookurl: http://11.111.111.111:2222 user: '{{ gituser }}' oauthkey: '{{ oauthkey }}' repo: https://api.github.com/repos/pcgentry/Github-Auto-Deploy # Cleaning all hooks for this repo that had an error on the last update. # Since this works for all hooks in a repo it is probably best that this would be called from a handler. - name: Clean all hooks community.general.github_hooks: action: cleanall user: '{{ gituser }}' oauthkey: '{{ oauthkey }}' repo: '{{ repo }}' delegate_to: localhost
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/github_hooks_module.html