.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. meta:: :antsibull-docs: 2.16.2 .. Anchors .. _ansible_collections.netbox.netbox.netbox_rack_module: .. Anchors: short name for ansible.builtin .. Title netbox.netbox.netbox_rack module -- Create, update or delete racks within 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_rack`. .. version_added .. rst-class:: ansible-version-added New in netbox.netbox 0.1.0 .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Creates, updates or removes racks from NetBox .. Aliases .. Requirements .. _ansible_collections.netbox.netbox.netbox_rack_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_rack_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_rack_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 rack configuration .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/asset_tag: .. rst-class:: ansible-option-title **asset_tag** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Asset tag that is associated to the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_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 that may include additional information in regards to the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_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_rack_module__parameter-data/desc_units: .. rst-class:: ansible-option-title **desc_units** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`boolean` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Rack units will be numbered top-to-bottom .. 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_rack_module__parameter-data/description: .. rst-class:: ansible-option-title **description** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` :ansible-option-versionadded:`added in netbox.netbox 3.10.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Description of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/facility_id: .. rst-class:: ansible-option-title **facility_id** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The unique rack ID assigned by the facility .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/location: .. rst-class:: ansible-option-title **location** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` :ansible-option-versionadded:`added in netbox.netbox 3.1.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The location the rack will be associated to (NetBox 2.11+) .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/max_weight: .. rst-class:: ansible-option-title **max_weight** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` :ansible-option-versionadded:`added in netbox.netbox 3.10.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Maximum load capacity of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/mounting_depth: .. rst-class:: ansible-option-title **mounting_depth** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` :ansible-option-versionadded:`added in netbox.netbox 3.10.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The mounting depth of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_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
The name of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/outer_depth: .. rst-class:: ansible-option-title **outer_depth** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The outer depth of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/outer_unit: .. rst-class:: ansible-option-title **outer_unit** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Whether the rack unit is in Millimeters or Inches and is :emphasis:`required` if outer\_width/outer\_depth is specified .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`"Millimeters"` - :ansible-option-choices-entry:`"Inches"` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/outer_width: .. rst-class:: ansible-option-title **outer_width** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The outer width of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/rack_group: .. rst-class:: ansible-option-title **rack_group** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The rack group the rack will be associated to (NetBox \< 2.11) Will be removed in version 5.0.0 .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/rack_role: .. rst-class:: ansible-option-title **rack_role** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The rack role the rack will be associated to .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/serial: .. rst-class:: ansible-option-title **serial** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Serial number of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/site: .. rst-class:: ansible-option-title **site** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
Required if :emphasis:`state=present` and the rack does not exist yet .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/status: .. rst-class:: ansible-option-title **status** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The status of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_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 rack 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_rack_module__parameter-data/tenant: .. rst-class:: ansible-option-title **tenant** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`any` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The tenant that the device will be assigned to .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_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 type of rack .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`"2-post frame"` - :ansible-option-choices-entry:`"4-post frame"` - :ansible-option-choices-entry:`"4-post cabinet"` - :ansible-option-choices-entry:`"Wall-mounted frame"` - :ansible-option-choices-entry:`"Wall-mounted cabinet"` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/u_height: .. rst-class:: ansible-option-title **u_height** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`float` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The height of the rack in rack units .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/weight: .. rst-class:: ansible-option-title **weight** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`float` :ansible-option-versionadded:`added in netbox.netbox 3.10.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The weight of the rack .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/weight_unit: .. rst-class:: ansible-option-title **weight_unit** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`string` :ansible-option-versionadded:`added in netbox.netbox 3.10.0` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The weight unit .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`"kg"` - :ansible-option-choices-entry:`"g"` - :ansible-option-choices-entry:`"lb"` - :ansible-option-choices-entry:`"oz"` .. raw:: html
* - .. raw:: html
.. raw:: latex \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} .. _ansible_collections.netbox.netbox.netbox_rack_module__parameter-data/width: .. rst-class:: ansible-option-title **width** .. raw:: html .. ansible-option-type-line:: :ansible-option-type:`integer` .. raw:: html
.. raw:: latex \end{minipage} - .. raw:: html
The rail-to-rail width .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`10` - :ansible-option-choices-entry:`19` - :ansible-option-choices-entry:`21` - :ansible-option-choices-entry:`23` .. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_rack_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_rack_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_rack_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_rack_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_rack_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_rack_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 modules" connection: local hosts: localhost gather_facts: false tasks: - name: Create rack within NetBox with only required information netbox.netbox.netbox_rack: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test rack site: Test Site state: present - name: Create rack within NetBox with only required information - Pre 2.11 netbox.netbox.netbox_rack: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test rack site: Test Site rack_group: Test Rack Group state: present - name: Create rack within NetBox with only required information - Post 2.11 netbox.netbox.netbox_rack: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test rack site: Test Site location: Test Location state: present - name: Delete rack within netbox netbox.netbox.netbox_rack: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test Rack 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_rack_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_rack_module__return-rack: .. rst-class:: ansible-option-title **rack** .. 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:` success (when :emphasis:`state=present`\ ) .. 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