| 1 |
.. _cisco.nxos.nxos_nxapi_module: |
| 2 |
|
| 3 |
|
| 4 |
********************* |
| 5 |
cisco.nxos.nxos_nxapi |
| 6 |
********************* |
| 7 |
|
| 8 |
**Manage NXAPI configuration on an NXOS device.** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- Configures the NXAPI feature on devices running Cisco NXOS. The NXAPI feature is absent from the configuration by default. Since this module manages the NXAPI feature it only supports the use of the ``Cli`` transport. |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
Parameters |
| 26 |
---------- |
| 27 |
|
| 28 |
.. raw:: html |
| 29 |
|
| 30 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 31 |
<tr> |
| 32 |
<th colspan="1">Parameter</th> |
| 33 |
<th>Choices/<font color="blue">Defaults</font></th> |
| 34 |
<th width="100%">Comments</th> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<td colspan="1"> |
| 38 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 39 |
<b>http</b> |
| 40 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 41 |
<div style="font-size: small"> |
| 42 |
<span style="color: purple">boolean</span> |
| 43 |
</div> |
| 44 |
</td> |
| 45 |
<td> |
| 46 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 47 |
<li>no</li> |
| 48 |
<li><div style="color: blue"><b>yes</b> ←</div></li> |
| 49 |
</ul> |
| 50 |
</td> |
| 51 |
<td> |
| 52 |
<div>Controls the operating state of the HTTP protocol as one of the underlying transports for NXAPI. By default, NXAPI will enable the HTTP transport when the feature is first configured. To disable the use of the HTTP transport, set the value of this argument to False.</div> |
| 53 |
<div style="font-size: small; color: darkgreen"><br/>aliases: enable_http</div> |
| 54 |
</td> |
| 55 |
</tr> |
| 56 |
<tr> |
| 57 |
<td colspan="1"> |
| 58 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 59 |
<b>http_port</b> |
| 60 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 61 |
<div style="font-size: small"> |
| 62 |
<span style="color: purple">integer</span> |
| 63 |
</div> |
| 64 |
</td> |
| 65 |
<td> |
| 66 |
<b>Default:</b><br/><div style="color: blue">80</div> |
| 67 |
</td> |
| 68 |
<td> |
| 69 |
<div>Configure the port with which the HTTP server will listen on for requests. By default, NXAPI will bind the HTTP service to the standard HTTP port 80. This argument accepts valid port values in the range of 1 to 65535.</div> |
| 70 |
</td> |
| 71 |
</tr> |
| 72 |
<tr> |
| 73 |
<td colspan="1"> |
| 74 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 75 |
<b>https</b> |
| 76 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 77 |
<div style="font-size: small"> |
| 78 |
<span style="color: purple">boolean</span> |
| 79 |
</div> |
| 80 |
</td> |
| 81 |
<td> |
| 82 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 83 |
<li><div style="color: blue"><b>no</b> ←</div></li> |
| 84 |
<li>yes</li> |
| 85 |
</ul> |
| 86 |
</td> |
| 87 |
<td> |
| 88 |
<div>Controls the operating state of the HTTPS protocol as one of the underlying transports for NXAPI. By default, NXAPI will disable the HTTPS transport when the feature is first configured. To enable the use of the HTTPS transport, set the value of this argument to True.</div> |
| 89 |
<div style="font-size: small; color: darkgreen"><br/>aliases: enable_https</div> |
| 90 |
</td> |
| 91 |
</tr> |
| 92 |
<tr> |
| 93 |
<td colspan="1"> |
| 94 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 95 |
<b>https_port</b> |
| 96 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 97 |
<div style="font-size: small"> |
| 98 |
<span style="color: purple">integer</span> |
| 99 |
</div> |
| 100 |
</td> |
| 101 |
<td> |
| 102 |
<b>Default:</b><br/><div style="color: blue">443</div> |
| 103 |
</td> |
| 104 |
<td> |
| 105 |
<div>Configure the port with which the HTTPS server will listen on for requests. By default, NXAPI will bind the HTTPS service to the standard HTTPS port 443. This argument accepts valid port values in the range of 1 to 65535.</div> |
| 106 |
</td> |
| 107 |
</tr> |
| 108 |
<tr> |
| 109 |
<td colspan="1"> |
| 110 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 111 |
<b>sandbox</b> |
| 112 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 113 |
<div style="font-size: small"> |
| 114 |
<span style="color: purple">boolean</span> |
| 115 |
</div> |
| 116 |
</td> |
| 117 |
<td> |
| 118 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 119 |
<li>no</li> |
| 120 |
<li>yes</li> |
| 121 |
</ul> |
| 122 |
</td> |
| 123 |
<td> |
| 124 |
<div>The NXAPI feature provides a web base UI for developers for entering commands. This feature is initially disabled when the NXAPI feature is configured for the first time. When the <code>sandbox</code> argument is set to True, the developer sandbox URL will accept requests and when the value is set to False, the sandbox URL is unavailable. This is supported on NX-OS 7K series.</div> |
| 125 |
<div style="font-size: small; color: darkgreen"><br/>aliases: enable_sandbox</div> |
| 126 |
</td> |
| 127 |
</tr> |
| 128 |
<tr> |
| 129 |
<td colspan="1"> |
| 130 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 131 |
<b>ssl_strong_ciphers</b> |
| 132 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 133 |
<div style="font-size: small"> |
| 134 |
<span style="color: purple">boolean</span> |
| 135 |
</div> |
| 136 |
</td> |
| 137 |
<td> |
| 138 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 139 |
<li><div style="color: blue"><b>no</b> ←</div></li> |
| 140 |
<li>yes</li> |
| 141 |
</ul> |
| 142 |
</td> |
| 143 |
<td> |
| 144 |
<div>Controls the use of whether strong or weak ciphers are configured. By default, this feature is disabled and weak ciphers are configured. To enable the use of strong ciphers, set the value of this argument to True.</div> |
| 145 |
</td> |
| 146 |
</tr> |
| 147 |
<tr> |
| 148 |
<td colspan="1"> |
| 149 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 150 |
<b>state</b> |
| 151 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 152 |
<div style="font-size: small"> |
| 153 |
<span style="color: purple">string</span> |
| 154 |
</div> |
| 155 |
</td> |
| 156 |
<td> |
| 157 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 158 |
<li><div style="color: blue"><b>present</b> ←</div></li> |
| 159 |
<li>absent</li> |
| 160 |
</ul> |
| 161 |
</td> |
| 162 |
<td> |
| 163 |
<div>The <code>state</code> argument controls whether or not the NXAPI feature is configured on the remote device. When the value is <code>present</code> the NXAPI feature configuration is present in the device running-config. When the values is <code>absent</code> the feature configuration is removed from the running-config.</div> |
| 164 |
</td> |
| 165 |
</tr> |
| 166 |
<tr> |
| 167 |
<td colspan="1"> |
| 168 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 169 |
<b>tlsv1_0</b> |
| 170 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 171 |
<div style="font-size: small"> |
| 172 |
<span style="color: purple">boolean</span> |
| 173 |
</div> |
| 174 |
</td> |
| 175 |
<td> |
| 176 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 177 |
<li>no</li> |
| 178 |
<li><div style="color: blue"><b>yes</b> ←</div></li> |
| 179 |
</ul> |
| 180 |
</td> |
| 181 |
<td> |
| 182 |
<div>Controls the use of the Transport Layer Security version 1.0 is configured. By default, this feature is enabled. To disable the use of TLSV1.0, set the value of this argument to True.</div> |
| 183 |
</td> |
| 184 |
</tr> |
| 185 |
<tr> |
| 186 |
<td colspan="1"> |
| 187 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 188 |
<b>tlsv1_1</b> |
| 189 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 190 |
<div style="font-size: small"> |
| 191 |
<span style="color: purple">boolean</span> |
| 192 |
</div> |
| 193 |
</td> |
| 194 |
<td> |
| 195 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 196 |
<li><div style="color: blue"><b>no</b> ←</div></li> |
| 197 |
<li>yes</li> |
| 198 |
</ul> |
| 199 |
</td> |
| 200 |
<td> |
| 201 |
<div>Controls the use of the Transport Layer Security version 1.1 is configured. By default, this feature is disabled. To enable the use of TLSV1.1, set the value of this argument to True.</div> |
| 202 |
</td> |
| 203 |
</tr> |
| 204 |
<tr> |
| 205 |
<td colspan="1"> |
| 206 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 207 |
<b>tlsv1_2</b> |
| 208 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 209 |
<div style="font-size: small"> |
| 210 |
<span style="color: purple">boolean</span> |
| 211 |
</div> |
| 212 |
</td> |
| 213 |
<td> |
| 214 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 215 |
<li><div style="color: blue"><b>no</b> ←</div></li> |
| 216 |
<li>yes</li> |
| 217 |
</ul> |
| 218 |
</td> |
| 219 |
<td> |
| 220 |
<div>Controls the use of the Transport Layer Security version 1.2 is configured. By default, this feature is disabled. To enable the use of TLSV1.2, set the value of this argument to True.</div> |
| 221 |
</td> |
| 222 |
</tr> |
| 223 |
</table> |
| 224 |
<br/> |
| 225 |
|
| 226 |
|
| 227 |
Notes |
| 228 |
----- |
| 229 |
|
| 230 |
.. note:: |
| 231 |
- Limited Support for Cisco MDS |
| 232 |
- For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>` |
| 233 |
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` |
| 234 |
- For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_. |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
Examples |
| 239 |
-------- |
| 240 |
|
| 241 |
.. code-block:: yaml |
| 242 |
|
| 243 |
- name: Enable NXAPI access with default configuration |
| 244 |
cisco.nxos.nxos_nxapi: |
| 245 |
state: present |
| 246 |
|
| 247 |
- name: Enable NXAPI with no HTTP, HTTPS at port 9443 and sandbox disabled |
| 248 |
cisco.nxos.nxos_nxapi: |
| 249 |
enable_http: false |
| 250 |
https_port: 9443 |
| 251 |
https: true |
| 252 |
enable_sandbox: false |
| 253 |
|
| 254 |
- name: remove NXAPI configuration |
| 255 |
cisco.nxos.nxos_nxapi: |
| 256 |
state: absent |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
Return Values |
| 261 |
------------- |
| 262 |
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: |
| 263 |
|
| 264 |
.. raw:: html |
| 265 |
|
| 266 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 267 |
<tr> |
| 268 |
<th colspan="1">Key</th> |
| 269 |
<th>Returned</th> |
| 270 |
<th width="100%">Description</th> |
| 271 |
</tr> |
| 272 |
<tr> |
| 273 |
<td colspan="1"> |
| 274 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 275 |
<b>updates</b> |
| 276 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 277 |
<div style="font-size: small"> |
| 278 |
<span style="color: purple">list</span> |
| 279 |
</div> |
| 280 |
</td> |
| 281 |
<td>always</td> |
| 282 |
<td> |
| 283 |
<div>Returns the list of commands that need to be pushed into the remote device to satisfy the arguments</div> |
| 284 |
<br/> |
| 285 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 286 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['no feature nxapi']</div> |
| 287 |
</td> |
| 288 |
</tr> |
| 289 |
</table> |
| 290 |
<br/><br/> |
| 291 |
|
| 292 |
|
| 293 |
Status |
| 294 |
------ |
| 295 |
|
| 296 |
|
| 297 |
Authors |
| 298 |
~~~~~~~ |
| 299 |
|
| 300 |
- Peter Sprygada (@privateip) |