github_hooks – Manages GitHub service hooks — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# github_hooks – Manages GitHub service hooks

- DEPRECATED
- Synopsis
- Parameters
- Examples
- Status

## DEPRECATED

Removed in Ansible:
| version: 2.12
Why: | Replaced by more granular modules
Alternative: | Use github_webhook and github_webhook_info instead.

## Synopsis

- Adds service hooks and removes service hooks that have an error status.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
action - / required | Choices: create cleanall list clean504 | This tells the githooks module what you want it to do.
content_type - | Choices: json ← form | Content type to use for requests made to the webhook
hookurl - |  | 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 - / required |  | The oauth key provided by GitHub. It can be found/generated on GitHub under "Edit Your Profile" >> "Developer settings" >> "Personal Access Tokens"
repo - / 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 - / required |  | GitHub username.
validate_certs boolean | Choices: no yes ← | 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.

## Examples

    # Example creating a new service hook. It ignores duplicates.
    - 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.
    - github_hooks:
        action: cleanall
        user: '{{ gituser }}'
        oauthkey: '{{ oauthkey }}'
        repo: '{{ repo }}'
      delegate_to: localhost

## Status

- This module will be removed in version 2.12. [deprecated]
- For more information see DEPRECATED.

### Authors

- Phillip Gentry, CX Inc (@pcgentry)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.