` for details.
To use it in a playbook, specify: :code:`netbox.netbox.netbox_config_context`.
.. version_added
.. rst-class:: ansible-version-added
New in netbox.netbox 3.3.0
.. contents::
:local:
:depth: 1
.. Deprecated
Synopsis
--------
.. Description
- Creates, updates or removes configuration contexts from NetBox
.. Aliases
.. Requirements
.. _ansible_collections.netbox.netbox.netbox_config_context_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_config_context_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_config_context_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 configuration context
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/cluster_groups:
.. rst-class:: ansible-option-title
**cluster_groups**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of cluster\_groups to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/cluster_types:
.. rst-class:: ansible-option-title
**cluster_types**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of cluster\_types to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/clusters:
.. rst-class:: ansible-option-title
**clusters**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of clusters to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/data:
.. rst-class:: ansible-option-title
**data**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`dictionary`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
JSON-formatted configuration context data
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_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 configuration context
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/device_types:
.. rst-class:: ansible-option-title
**device_types**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of device\_types to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/is_active:
.. rst-class:: ansible-option-title
**is_active**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`boolean`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Whether configuration context is active
.. 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_config_context_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 context
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/platforms:
.. rst-class:: ansible-option-title
**platforms**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of platforms to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/regions:
.. rst-class:: ansible-option-title
**regions**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of regions where configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/roles:
.. rst-class:: ansible-option-title
**roles**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of roles to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/site_groups:
.. rst-class:: ansible-option-title
**site_groups**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of site groups where configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/sites:
.. rst-class:: ansible-option-title
**sites**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of sites where configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/tags:
.. rst-class:: ansible-option-title
**tags**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
Any tags that the configuration context associates with
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/tenant_groups:
.. rst-class:: ansible-option-title
**tenant_groups**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of tenant\_groups to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/tenants:
.. rst-class:: ansible-option-title
**tenants**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
List of tenants to which configuration context applies
.. raw:: html
* - .. raw:: html
.. raw:: latex
\hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth}
.. _ansible_collections.netbox.netbox.netbox_config_context_module__parameter-data/weight:
.. rst-class:: ansible-option-title
**weight**
.. raw:: html
.. ansible-option-type-line::
:ansible-option-type:`integer`
.. raw:: html
.. raw:: latex
\end{minipage}
- .. raw:: html
The weight of the configuration context
.. raw:: html
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_config_context_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_config_context_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_config_context_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_config_context_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_config_context_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_config_context_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 config_context module"
connection: local
hosts: localhost
gather_facts: false
tasks:
- name: Create config context and apply it to sites euc1-az1, euc1-az2 with the default weight of 1000
netbox.netbox.netbox_config_context:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "dns_nameservers-quadnine"
description: "9.9.9.9"
data: "{ \"dns\": { \"nameservers\": [ \"9.9.9.9\" ] } }"
sites: [euc1-az1, euc1-az2]
- name: Detach config context from euc1-az1, euc1-az2 and attach to euc1-az3
netbox.netbox.netbox_config_context:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "dns_nameservers-quadnine"
data: "{ \"dns\": { \"nameservers\": [ \"9.9.9.9\" ] } }"
sites: [euc1-az3]
- name: Delete config context
netbox.netbox.netbox_config_context:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "dns_nameservers-quadnine"
data: "{ \"dns\": { \"nameservers\": [ \"9.9.9.9\" ] } }"
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_config_context_module__return-config_context:
.. rst-class:: ansible-option-title
**config_context**
.. 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
* - .. raw:: html
.. _ansible_collections.netbox.netbox.netbox_config_context_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
~~~~~~~
- Pavel Korovin (@pkorovin)
.. 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