.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. meta:: :antsibull-docs: 2.16.2 .. Anchors .. _ansible_collections.netbox.netbox.netbox_device_interface_module: .. Anchors: short name for ansible.builtin .. Title netbox.netbox.netbox_device_interface module -- Creates or removes interfaces on devices from NetBox ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This module is part of the `netbox.netbox collection `_ (version 3.22.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_device_interface`. .. version_added .. rst-class:: ansible-version-added New in netbox.netbox 0.1.0 .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Creates or removes interfaces from NetBox .. Aliases .. Requirements .. _ansible_collections.netbox.netbox.netbox_device_interface_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_device_interface_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_device_interface_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 interface configuration .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/bridge: .. rst-class:: ansible-option-title **bridge** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.6.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Bridge the interface will connected to .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/custom_fields: .. rst-class:: ansible-option-title **custom_fields** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`dictionary` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
must exist in NetBox .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_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
The description of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/device: .. rst-class:: ansible-option-title **device** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Name of the device the interface will be associated with (case-sensitive) .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/duplex: .. rst-class:: ansible-option-title **duplex** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` :ansible-option-versionadded:`added in netbox.netbox 3.7.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The duplex of the interface .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`"half"` - :ansible-option-choices-entry:`"full"` - :ansible-option-choices-entry:`"auto"` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_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
Sets whether interface shows enabled or disabled .. 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_device_interface_module__parameter-data/form_factor: .. rst-class:: ansible-option-title **form_factor** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Form factor of the interface: ex. 1000Base-T (1GE), Virtual, 10GBASE-T (10GE) This has to be specified exactly as what is found within UI .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/label: .. rst-class:: ansible-option-title **label** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Physical label of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/lag: .. rst-class:: ansible-option-title **lag** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Parent LAG interface will be a member of .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/mac_address: .. rst-class:: ansible-option-title **mac_address** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The MAC address of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/mark_connected: .. rst-class:: ansible-option-title **mark_connected** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`boolean` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Mark an interface as connected without a cable attached (netbox \>= 2.11 required) .. 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_device_interface_module__parameter-data/mgmt_only: .. rst-class:: ansible-option-title **mgmt_only** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`boolean` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
This interface is used only for out-of-band management .. 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_device_interface_module__parameter-data/mode: .. rst-class:: ansible-option-title **mode** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The mode of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/mtu: .. rst-class:: ansible-option-title **mtu** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The MTU of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_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 interface to be created .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/parent_interface: .. rst-class:: ansible-option-title **parent_interface** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.2.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The device's parent interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/poe_mode: .. rst-class:: ansible-option-title **poe_mode** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.8.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
This interface has PoE ability (NetBox release 3.3 and later) .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/poe_type: .. rst-class:: ansible-option-title **poe_type** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.8.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
This interface's power type (NetBox release 3.3 and later) .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/primary_mac_address: .. rst-class:: ansible-option-title **primary_mac_address** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The primary MAC address of the interface (NetBox 4.2 and later) .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/speed: .. rst-class:: ansible-option-title **speed** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` :ansible-option-versionadded:`added in netbox.netbox 3.7.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The speed of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/tagged_vlans: .. rst-class:: ansible-option-title **tagged_vlans** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
A list of tagged VLANS to be assigned to interface. Mode must be set to either :literal:`Tagged` or :literal:`Tagged All` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/tags: .. rst-class:: ansible-option-title **tags** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`list` / :ansible-option-elements:`elements=any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Any tags that the interface may need to be associated with .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/tx_power: .. rst-class:: ansible-option-title **tx_power** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` :ansible-option-versionadded:`added in netbox.netbox 3.14.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The interface's configured output power, in dBm .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_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
Form factor of the interface: ex. 1000Base-T (1GE), Virtual, 10GBASE-T (10GE) This has to be specified exactly as what is found within UI .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/untagged_vlan: .. rst-class:: ansible-option-title **untagged_vlan** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The untagged VLAN to be assigned to interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/vrf: .. rst-class:: ansible-option-title **vrf** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.7.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The VRF of the interface .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_device_interface_module__parameter-data/wwn: .. rst-class:: ansible-option-title **wwn** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` :ansible-option-versionadded:`added in netbox.netbox 3.14.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The WWN of the interface .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_device_interface_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_device_interface_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_device_interface_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_device_interface_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_device_interface_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_device_interface_module__parameter-update_vc_child: .. rst-class:: ansible-option-title **update_vc_child** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Use when master device is specified for :literal:`device` and the specified interface exists on a child device and needs updated .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry-default:`false` :ansible-option-choices-default-mark:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_device_interface_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:: - Tags should be defined as a YAML list - This should be ran with connection :literal:`local` and hosts :literal:`localhost` .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja - name: "Test NetBox interface module" connection: local hosts: localhost gather_facts: false tasks: - name: Create interface within NetBox with only required information netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet1 state: present - name: Delete interface within netbox netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet1 state: absent - name: Create LAG with several specified options netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: port-channel1 type: Link Aggregation Group (LAG) mtu: 1600 mgmt_only: false mode: Access state: present - name: Create interface and assign it to parent LAG netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet1 enabled: false type: 1000Base-t (1GE) lag: name: port-channel1 mtu: 1600 mgmt_only: false mode: Access state: present - name: Create interface as a trunk port netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet25 enabled: false type: 1000Base-t (1GE) untagged_vlan: name: Wireless site: Test Site tagged_vlans: - name: Data site: Test Site - name: VoIP site: Test Site mtu: 1600 mgmt_only: true mode: Tagged state: present - name: Update interface on child device on virtual chassis netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet2/0/1 enabled: false update_vc_child: true - name: Mark interface as connected without a cable (netbox >= 2.11 required) netbox.netbox.netbox_device_interface: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: device: test100 name: GigabitEthernet1 mark_connected: true state: present .. 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_device_interface_module__return-interface: .. rst-class:: ansible-option-title **interface** .. 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_device_interface_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 ~~~~~~~ - Mikhail Yohman (@FragmentedPacket) .. 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