community / community.general / 0.2.1 / module / github_webhook Manage GitHub webhooks Authors: Chris St. Pierre (@stpierre)community.general.github_webhook (0.2.1) — module
Install with ansible-galaxy collection install community.general:==0.2.1
collections: - name: community.general version: 0.2.1
Create and delete GitHub webhooks
- name: create a new webhook that triggers on push (password auth) github_webhook: repository: ansible/ansible url: https://www.example.com/hooks/ events: - push user: "{{ github_user }}" password: "{{ github_password }}"
- name: Create a new webhook in a github enterprise installation with multiple event triggers (token auth) github_webhook: repository: myorg/myrepo url: https://jenkins.example.com/ghprbhook/ content_type: json secret: "{{ github_shared_secret }}" insecure_ssl: True events: - issue_comment - pull_request user: "{{ github_user }}" token: "{{ github_user_api_token }}" github_url: https://github.example.com
- name: Delete a webhook (password auth) github_webhook: repository: ansible/ansible url: https://www.example.com/hooks/ state: absent user: "{{ github_user }}" password: "{{ github_password }}"
url: description: - URL to which payloads will be delivered required: true user: description: - User to authenticate to GitHub as required: true state: choices: - absent - present default: present description: - Whether the hook should be present or absent required: false token: description: - Token to authenticate to GitHub with required: false active: default: true description: - Whether or not the hook is active required: false type: bool events: description: - 'A list of GitHub events the hook is triggered for. Events are listed at U(https://developer.github.com/v3/activity/events/types/). Required unless C(state) is C(absent) ' required: false secret: description: - The shared secret between GitHub and the payload URL. required: false password: description: - Password to authenticate to GitHub with required: false github_url: default: https://api.github.com description: - Base URL of the GitHub API required: false repository: aliases: - repo description: - Full name of the repository to configure a hook for required: true content_type: choices: - form - json default: form description: - The media type used to serialize the payloads required: false insecure_ssl: default: false description: - 'Flag to indicate that GitHub should skip SSL verification when calling the hook. ' required: false type: bool
hook_id: description: The GitHub ID of the hook created/updated returned: when state is 'present' sample: 6206 type: int