Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISN Fabric Support for dcnm_fabric module. #322

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ This collection is intended for use with the following release versions:
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.9.10**.
This collection has been tested against following Ansible versions: **>=2.15.0**.

For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
fully qualified collection name (for example, `cisco.ios.ios`).
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
Expand All @@ -39,6 +41,7 @@ Name | Description
[cisco.dcnm.dcnm_interface](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_interface_module.rst)|DCNM Ansible Module for managing interfaces.
[cisco.dcnm.dcnm_inventory](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_inventory_module.rst)|Add and remove Switches from a DCNM managed VXLAN fabric.
[cisco.dcnm.dcnm_links](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_links_module.rst)|DCNM ansible module for managing Links.
[cisco.dcnm.dcnm_maintenance_mode](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_maintenance_mode_module.rst)|Manage Maintenance Mode Configuration of NX-OS Switches.
[cisco.dcnm.dcnm_network](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_network_module.rst)|Add and remove Networks from a DCNM managed VXLAN fabric.
[cisco.dcnm.dcnm_policy](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_policy_module.rst)|DCNM Ansible Module for managing policies.
[cisco.dcnm.dcnm_resource_manager](https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_resource_manager_module.rst)|DCNM ansible module for managing resources.
Expand Down
941 changes: 940 additions & 1 deletion docs/cisco.dcnm.dcnm_fabric_module.rst

Large diffs are not rendered by default.

294 changes: 294 additions & 0 deletions docs/cisco.dcnm.dcnm_maintenance_mode_module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
.. _cisco.dcnm.dcnm_maintenance_mode_module:


********************************
cisco.dcnm.dcnm_maintenance_mode
********************************

**Manage Maintenance Mode Configuration of NX-OS Switches.**


Version added: 3.5.0

.. contents::
:local:
:depth: 1


Synopsis
--------
- Enable Maintenance or Normal Mode.




Parameters
----------

.. raw:: html

<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="3">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="3">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>config</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">dictionary</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>A dictionary containing the maintenance mode configuration.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>deploy</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Whether to deploy the switch configurations.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>mode</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>no</li>
<li>yes</li>
</ul>
<b>Default:</b><br/><div style="color: blue">"normal"</div>
</td>
<td>
<div>Enable maintenance or normal mode on all switches.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>switches</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=dictionary</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>A list of target switches.</div>
<div>Per-switch options override the global options.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>deploy</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Whether to deploy the switch configuration.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>ip_address</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>The IP address of the switch.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>mode</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>maintenance</li>
<li><div style="color: blue"><b>normal</b>&nbsp;&larr;</div></li>
</ul>
</td>
<td>
<div>Enable maintenance or normal mode for the switch.</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>wait_for_mode_change</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>If deploy is enabled, whether to wait for NDFC to push the change to the switch. Ignored if deploy is not enabled.</div>
</td>
</tr>

<tr>
<td class="elbow-placeholder"></td>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>wait_for_mode_change</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>If deploy is enabled, whether to wait for NDFC to push the change to the switch. Ignored if deploy is not enabled.</div>
</td>
</tr>

<tr>
<td colspan="3">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
<li>query</li>
</ul>
</td>
<td>
<div>The state of the feature or object after module completion</div>
</td>
</tr>
</table>
<br/>




Examples
--------

.. code-block:: yaml

# Enable maintenance mode on all switches.
# Do not deploy the configuration on any switch.

- name: Configure switch mode
cisco.dcnm.dcnm_maintenance_mode:
state: merged
config:
deploy: true
wait_for_mode_change: true
mode: maintenance
switches:
- ip_address: 192.168.1.2
- ip_address: 192.160.1.3
- ip_address: 192.160.1.4
register: result
- debug:
var: result

# Enable maintenance mode on two switches.
# Enable normal mode on one switch.
# Deploy the configuration on one switch.

- name: Configure switch mode
cisco.dcnm.dcnm_maintenance_mode:
state: merged
config:
deploy: false
mode: maintenance
switches:
- ip_address: 192.168.1.2
mode: normal
- ip_address: 192.160.1.3
deploy: true
wait_for_mode_change: true
- ip_address: 192.160.1.4
register: result
- debug:
var: result




Status
------


Authors
~~~~~~~

- Allen Robel (@quantumonion)
7 changes: 6 additions & 1 deletion playbooks/roles/dcnm_fabric/dcnm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@
# Uncomment ONE of the following testcases
# testcase: dcnm_fabric_deleted_basic
# testcase: dcnm_fabric_deleted_basic_ipfm
# testcase: dcnm_fabric_deleted_basic_isn
# testcase: dcnm_fabric_deleted_basic_lan_classic
# testcase: dcnm_fabric_deleted_basic_msd
# testcase: dcnm_fabric_deleted_basic_vxlan
# testcase: dcnm_fabric_merged_basic
# testcase: dcnm_fabric_merged_basic_ipfm
# testcase: dcnm_fabric_merged_basic_isn
# testcase: dcnm_fabric_merged_save_deploy
# testcase: dcnm_fabric_merged_save_deploy_ipfm
# testcase: dcnm_fabric_replaced_basic
# testcase: dcnm_fabric_replaced_basic_ipfm
# testcase: dcnm_fabric_replaced_basic_isn
# testcase: dcnm_fabric_replaced_basic_vxlan
# testcase: dcnm_fabric_replaced_basic_vxlan_site_id
# testcase: dcnm_fabric_replaced_basic_ipfm
# testcase: dcnm_fabric_replaced_save_deploy
# testcase: dcnm_fabric_replaced_save_deploy_ipfm
# testcase: dcnm_fabric_query_basic.yaml
Expand All @@ -44,6 +47,8 @@
fabric_type_3: LAN_CLASSIC
fabric_name_4: IPFM_Fabric
fabric_type_4: IPFM
fabric_name_5: ISN_Fabric
fabric_type_5: ISN
leaf_1: 172.22.150.103
leaf_2: 172.22.150.104
nxos_username: admin
Expand Down
Loading
Loading