.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. meta:: :antsibull-docs: 2.16.2 .. Anchors .. _ansible_collections.netbox.netbox.netbox_data_source_module: .. Anchors: short name for ansible.builtin .. Title netbox.netbox.netbox_data_source module -- Creates or removes data sources from NetBox ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This module is part of the `netbox.netbox collection `_ (version 3.23.0). It is not included in ``ansible-core``. To check whether it is installed, run :code:`ansible-galaxy collection list`. To install it, use: :code:`ansible-galaxy collection install netbox.netbox`. You need further requirements to be able to use this module, see :ref:`Requirements ` for details. To use it in a playbook, specify: :code:`netbox.netbox.netbox_data_source`. .. version_added .. rst-class:: ansible-version-added New in netbox.netbox 3.22.0 .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Creates or removes data sources from NetBox .. Aliases .. Requirements .. _ansible_collections.netbox.netbox.netbox_data_source_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_data_source_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_data_source_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 data source configuration .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-data/comments: .. rst-class:: ansible-option-title **comments** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Comments about the data source .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-data/description: .. rst-class:: ansible-option-title **description** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Description of the data source .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_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
Whether or not this data source can be synced .. 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_data_source_module__parameter-data/ignore_rules: .. rst-class:: ansible-option-title **ignore_rules** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Patterns (one per line) matching files to ignore when syncing .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_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 data source .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-data/source_url: .. rst-class:: ansible-option-title **source_url** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
URL of the data source to be created .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-data/sync_interval: .. rst-class:: ansible-option-title **sync_interval** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The interval in seconds between syncs .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`1` - :ansible-option-choices-entry:`60` - :ansible-option-choices-entry:`720` - :ansible-option-choices-entry:`1440` - :ansible-option-choices-entry:`10080` - :ansible-option-choices-entry:`43200` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-data/type: .. rst-class:: ansible-option-title **type** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The origin of the data source .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`"local"` - :ansible-option-choices-entry:`"git"` - :ansible-option-choices-entry:`"amazon-s3"` .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_data_source_module__parameter-headers: .. rst-class:: ansible-option-title **headers** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Dictionary of headers to be passed to the NetBox API. .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_data_source_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_data_source_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_data_source_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_data_source_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_data_source_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 .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja - name: "Test NetBox modules" connection: local hosts: localhost gather_facts: false tasks: - name: "Create a new data source with only required information" netbox.netbox.netbox_data_source: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: "Data Source 1" type: "local" source_url: "/tmp/data-source.txt" enabled: true state: present - name: "Update that data source with other fields" netbox.netbox.netbox_data_source: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: "Data Source 1" type: "amazon-s3" source_url: "path/to/bucket" enabled: false description: "My first data source" ignore_rules: ".*\nfoo.txt\n*.yml" sync_interval: 1440 comments: "Some commentary on this data source" state: present - name: "Delete the data source" netbox.netbox.netbox_data_source: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: "Data Source 1" 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_data_source_module__return-data_source: .. rst-class:: ansible-option-title **data_source** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Serialized object as created or already existent within NetBox .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` on creation .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_data_source_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
.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - Daniel Chiquito (@dchiquito) .. 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