theforeman.foreman.webhook (4.0.0) — module

Manage Webhooks

| "added in version" 4.0.0 of theforeman.foreman"

Authors: Griffin Sullivan (@Griffin-Sullivan)

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==4.0.0


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 4.0.0

Description

Manage Webhooks


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: 'Create Webhook'
  theforeman.foreman.webhook:
    username: 'admin'
    password: 'secret_password'
    server_url: 'https://foreman.example.com'
    name: 'test-webhook'
    target_url: 'https://google.com'
    http_method: 'GET'
    event: 'actions.katello.content_view.promote_succeeded'
    enabled: true
    organizations:
      - 'MyOrg'
    locations:
      - 'DC1'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: 'Remove Webhook'
  theforeman.foreman.webhook:
    username: 'admin'
    password: 'secret_password'
    server_url: 'https://foreman.example.com'
    name: 'test-webhook'
    state: 'absent'

Inputs

    
name:
    description:
    - Name of the Webhook
    required: true
    type: str

event:
    description:
    - Name of the event that shall trigger the webhook
    - Required when creating a new webhook
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the entity
    type: str

enabled:
    description:
    - Enable or disable the webhook
    type: bool

password:
    description:
    - Password of the user accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD)
      will be used instead.
    required: true
    type: str

username:
    description:
    - Username accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME)
      will be used instead.
    required: true
    type: str

locations:
    description: List of locations the entity should be assigned to
    elements: str
    type: list

server_url:
    description:
    - URL of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL)
      will be used instead.
    required: true
    type: str

target_url:
    description:
    - The URL to call when the webhook is triggered
    - Required when creating a new webhook
    type: str

verify_ssl:
    description:
    - Verify SSL certs for the webhook
    type: bool

http_method:
    choices:
    - POST
    - GET
    - PUT
    - DELETE
    - PATCH
    description:
    - The HTTP method used in the webhook
    type: str

http_headers:
    description:
    - HTTP headers for the webhook
    type: str

ssl_ca_certs:
    description:
    - X509 Certification Authorities concatenated in PEM format
    type: str

organizations:
    description: List of organizations the entity should be assigned to
    elements: str
    type: list

validate_certs:
    default: true
    description:
    - Whether or not to verify the TLS certificates of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS)
      will be used instead.
    type: bool

webhook_password:
    description:
    - Password for the webhook, if required
    type: str

webhook_template:
    description:
    - Name of the webhook template
    type: str

webhook_username:
    description:
    - Username for the webhook, if required
    type: str

http_content_type:
    description:
    - The HTTP content type for the webhook
    type: str

proxy_authorization:
    description:
    - Authorize with client certificate and validate CA from Settings
    type: bool

Outputs

entity:
  contains:
    webhooks:
      description: List of webhooks.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict