` for details.
To use it in a playbook, specify: :code:`netbox.netbox.netbox_webhook`.
.. version_added
.. rst-class:: ansible-version-added
New in netbox.netbox 3.6.0
.. contents::
:local:
:depth: 1
.. Deprecated
Synopsis
--------
.. Description
- Creates, updates or removes webhook configuration within NetBox
.. Aliases
.. Requirements
.. _ansible_collections.netbox.netbox.netbox_webhook_module_requirements:
Requirements
------------
The below requirements are needed on the host that executes this module.
- pynetbox
.. Options
Parameters
----------
.. tabularcolumns:: \X{1}{3}\X{2}{3}
.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table
* - Parameter
- Comments
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-cert:
.. rst-class:: ansible-option-title
**cert**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`any`
.. raw:: html
- .. raw:: html
Certificate path
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data:
.. rst-class:: ansible-option-title
**data**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`dictionary` / :ansible-option-required:`required`
.. raw:: html
- .. raw:: html
Defines the custom field
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/additional_headers:
.. rst-class:: ansible-option-title
**additional_headers**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
User-supplied HTTP headers. Supports jinja2 code.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/body_template:
.. rst-class:: ansible-option-title
**body_template**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Body template for webhook. Supports jinja2 code.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/ca_file_path:
.. rst-class:: ansible-option-title
**ca_file_path**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
CA certificate file to use for SSL verification
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/conditions:
.. rst-class:: ansible-option-title
**conditions**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`dictionary`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
A set of conditions which determine whether the webhook will be generated.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/content_types:
.. rst-class:: ansible-option-title
**content_types**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=any`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
The content type(s) to apply this webhook to
Required when :emphasis:`state=present`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/enabled:
.. rst-class:: ansible-option-title
**enabled**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Enable/disable the webhook.
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry:`true`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/http_content_type:
.. rst-class:: ansible-option-title
**http_content_type**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
The HTTP content type.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/http_method:
.. rst-class:: ansible-option-title
**http_method**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`any`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
HTTP method of the webhook.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/name:
.. rst-class:: ansible-option-title
**name**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string` / :ansible-option-required:`required`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Name of the webhook
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/payload_url:
.. rst-class:: ansible-option-title
**payload_url**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
URL for the webhook to use.
Required when :emphasis:`state=present`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/secret:
.. rst-class:: ansible-option-title
**secret**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Secret key to generate X-Hook-Signature to include in the payload.
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/ssl_verification:
.. rst-class:: ansible-option-title
**ssl_verification**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Enable ssl verification.
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry:`true`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/type_create:
.. rst-class:: ansible-option-title
**type_create**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Call this webhook when a matching object is created
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry:`true`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/type_delete:
.. rst-class:: ansible-option-title
**type_delete**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Call this webhook when a matching object is deleted
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry:`true`
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-data/type_update:
.. rst-class:: ansible-option-title
**type_update**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Call this webhook when a matching object is updated
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry:`true`
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-netbox_token:
.. rst-class:: ansible-option-title
**netbox_token**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string` / :ansible-option-required:`required`
.. raw:: html
- .. raw:: html
The NetBox API token.
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-netbox_url:
.. rst-class:: ansible-option-title
**netbox_url**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string` / :ansible-option-required:`required`
.. raw:: html
- .. raw:: html
The URL of the NetBox instance.
Must be accessible by the Ansible control host.
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-query_params:
.. rst-class:: ansible-option-title
**query_params**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
- .. raw:: html
This can be used to override the specified values in ALLOWED\_QUERY\_PARAMS that are defined
in plugins/module\_utils/netbox\_utils.py and provides control to users on what may make
an object unique in their environment.
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-state:
.. rst-class:: ansible-option-title
**state**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
- .. raw:: html
The state of the object.
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-choices-entry-default:`"present"` :ansible-option-choices-default-mark:`← (default)`
- :ansible-option-choices-entry:`"absent"`
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__parameter-validate_certs:
.. rst-class:: ansible-option-title
**validate_certs**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`any`
.. raw:: html
- .. raw:: html
If :literal:`no`\ , SSL certificates will not be validated.
This should only be used on personally controlled sites using a self-signed certificates.
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`true`
.. raw:: html
.. Attributes
.. Notes
Notes
-----
.. note::
- This should be ran with connection :literal:`local` and hosts :literal:`localhost`
- Use :literal:`!unsafe` when adding jinja2 code to :literal:`additional\_headers` or :literal:`body\_template`
.. Seealso
.. Examples
Examples
--------
.. code-block:: yaml+jinja
- name: "Test NetBox webhook module"
connection: local
hosts: localhost
tasks:
- name: Create a webhook
netbox_webhook:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
content_types:
- dcim.device
name: Example Webhook
type_create: true
payload_url: https://payload.url/
body_template: !unsafe >-
{{ data }}
- name: Update the webhook to run on delete
netbox_webhook:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: Example Webhook
type_create: true
type_delete: true
payload_url: https://payload.url/
body_template: !unsafe >-
{{ data }}
- name: Delete the webhook
netbox_webhook:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: Example Webhook
type_create: true
type_delete: true
payload_url: https://payload.url/
body_template: !unsafe >-
{{ data }}
state: absent
.. Facts
.. Return values
Return Values
-------------
Common return values are documented :ref:`here `, the following are the fields unique to this module:
.. tabularcolumns:: \X{1}{3}\X{2}{3}
.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table
* - Key
- Description
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__return-msg:
.. rst-class:: ansible-option-title
**msg**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`string`
.. raw:: html
- .. raw:: html
Message indicating failure or info about what has been achieved
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` always
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_webhook_module__return-webhook:
.. rst-class:: ansible-option-title
**webhook**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`dictionary`
.. raw:: html
- .. raw:: html
Serialized object as created/existent/updated/deleted within NetBox
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` always
.. raw:: html
.. Status (Presently only deprecated)
.. Authors
Authors
~~~~~~~
- Martin Rødvand (@rodvand)
.. Extra links
Collection links
~~~~~~~~~~~~~~~~
.. ansible-links::
- title: "Issue Tracker"
url: "https://github.com/netbox-community/ansible_modules/issues"
external: true
- title: "Repository (Sources)"
url: "https://github.com/netbox-community/ansible_modules"
external: true
.. Parsing errors