community / community.general / 1.3.11 / module / github_webhook Manage GitHub webhooks Authors: Chris St. Pierre (@stpierre)community.general.github_webhook (1.3.11) — module
Install with ansible-galaxy collection install community.general:==1.3.11
collections: - name: community.general version: 1.3.11
Create and delete GitHub webhooks
- name: create a new webhook that triggers on push (password auth) community.general.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) community.general.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) community.general.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 type: str user: description: - User to authenticate to GitHub as required: true type: str state: choices: - absent - present default: present description: - Whether the hook should be present or absent required: false type: str token: description: - Token to authenticate to GitHub with required: false type: str 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) ' elements: str required: false type: list secret: description: - The shared secret between GitHub and the payload URL. required: false type: str password: description: - Password to authenticate to GitHub with required: false type: str github_url: default: https://api.github.com description: - Base URL of the GitHub API required: false type: str repository: aliases: - repo description: - Full name of the repository to configure a hook for required: true type: str content_type: choices: - form - json default: form description: - The media type used to serialize the payloads required: false type: str 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