Deprecated

Removed in 2.0.0

i

Reason:Replaced by more granular modules | Alternative:Use M(community.general.github_webhook) and M(community.general.github_webhook_info) instead.

community.general.github_hooks (1.3.14) — module

Manages GitHub service hooks.

Authors: Phillip Gentry, CX Inc (@pcgentry)

Install collection

Install with ansible-galaxy collection install community.general:==1.3.14


Add to requirements.yml

  collections:
    - name: community.general
      version: 1.3.14

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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

Inputs

    
repo:
    description:
    - '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.

      '
    required: true

user:
    description:
    - GitHub username.
    required: true

action:
    choices:
    - create
    - cleanall
    - list
    - clean504
    description:
    - This tells the githooks module what you want it to do.
    required: true

hookurl:
    description:
    - 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.
    required: false

oauthkey:
    description:
    - The oauth key provided by GitHub. It can be found/generated on GitHub under "Edit
      Your Profile" >> "Developer settings" >> "Personal Access Tokens"
    required: true

content_type:
    choices:
    - json
    - form
    default: json
    description:
    - Content type to use for requests made to the webhook
    required: false

validate_certs:
    default: 'yes'
    description:
    - If C(no), SSL certificates for the target repo will not be validated. This should
      only be used on personally controlled sites using self-signed certificates.
    required: false
    type: bool