dcnm

20Modules109Plugins1Dependency

Overview

Description

Ansible collection for the Cisco Nexus® Dashboard Fabric Controller (NDFC) - formerly DCNM

Readme

Actions Status

Cisco DCNM Collection

The Ansible Cisco Nexus® Dashboard Fabric Controller (NDFC) (formerly Cisco Data Center Network Manager (DCNM)) collection includes modules to help automate common day 2 operations for VXLAN EVPN fabrics.

This collection is intended for use with the following release versions: * DCNM Release 11.4(1) or later * NDFC Release 12.0 or later.

Ansible version compatibility

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.

Supported connections

The Cisco DCNM collection supports httpapi connections.

Included content

Httpapi plugins

NameDescription
cisco.dcnm.dcnmAnsible DCNM HTTPAPI Plugin.

Modules

NameDescription
cisco.dcnm.dcnm_bootflashBootflash management for Nexus switches.
cisco.dcnm.dcnm_fabricManage creation and configuration of NDFC fabrics.
cisco.dcnm.dcnm_image_policyImage policy management for Nexus Dashboard Fabric Controller
cisco.dcnm.dcnm_image_upgradeImage management for Nexus switches
cisco.dcnm.dcnm_image_uploadDCNM Ansible Module for managing images.
cisco.dcnm.dcnm_interfaceDCNM Ansible Module for managing interfaces.
cisco.dcnm.dcnm_inventoryAdd and remove Switches from a DCNM managed VXLAN fabric.
cisco.dcnm.dcnm_linksDCNM ansible module for managing Links.
cisco.dcnm.dcnm_logLog messages according to the configuration pointed to by the environment variable NDFC_LOGGING_CONFIG.
cisco.dcnm.dcnm_maintenance_modeManage Maintenance Mode Configuration of NX-OS Switches.
cisco.dcnm.dcnm_networkAdd and remove Networks from a DCNM managed VXLAN fabric.
cisco.dcnm.dcnm_policyDCNM Ansible Module for managing policies.
cisco.dcnm.dcnm_resource_managerDCNM ansible module for managing resources.
cisco.dcnm.dcnm_restSend REST API requests to DCNM controller.
cisco.dcnm.dcnm_service_nodeCreate/Modify/Delete service node based on type and attached interfaces from a DCNM managed VXLAN fabric.
cisco.dcnm.dcnm_service_policyDCNM ansible module for managing service policies.
cisco.dcnm.dcnm_service_route_peeringDCNM Ansible Module for managing Service Route Peerings.
cisco.dcnm.dcnm_templateDCNM Ansible Module for managing templates.
cisco.dcnm.dcnm_vpc_pairDCNM Ansible Module for managing VPC switch pairs required for VPC interfaces.
cisco.dcnm.dcnm_vrfAdd and remove VRFs from a DCNM managed VXLAN fabric.

Click the Content button to see the list of content included in this collection.

Installing this collection

You can install the Cisco DCNM collection with the Ansible Galaxy CLI:

ansible-galaxy collection install cisco.dcnm

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: cisco.dcnm
    version: 3.8.0

Using this collection

Using modules from the Cisco DCNM collection in your playbooks

You can call modules by their Fully Qualified Collection Namespace (FQCN), such as cisco.dcnm.dcnm_inventory. The following example task adds a switch to an existing fabric, using the FQCN:

---

- hosts: dcnm_controllers
  gather_facts: false
  connection: ansible.netcommon.httpapi

  vars:
    password: !vault |
        $ANSIBLE_VAULT;1.1;AES256
        32393431346235343736383635656339363132666463316231653862373335356366663561316665
        3730346133626437383337366664616264656534313536640a303639313666373261633064343361
        33396463306231313937303766343165333332613636393263343734613136636232636162363639
        3233353437366362330a623962613031626633396630653530626636383333633065653965383864
        3165

  tasks:
    - name: Add switch n9kv-spine1 to fabric vxlan-fabric.
      cisco.dcnm.dcnm_inventory:
        fabric: vxlan-fabric
        state: overridden
        config:
        - seed_ip: n9kv-spine1
          auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES]
          user_name: admin
          password: "{{ password }}"
          max_hops: 0
          role: spine # default is Leaf - choose from [leaf, spine, border, border_spine, border_gateway, border_gateway_spine
                           # super_spine, border_super_spine, border_gateway_super_spine]
          preserve_config: false # boolean, default is  true
      vars:
          ansible_command_timeout: 1000
          ansible_connect_timeout: 1000
      no_log: true

Alternately, you can call modules by their short name if you list the cisco.dcnm collection in the playbook's collections, as follows:

---
- hosts: dcnm_controllers
  gather_facts: false
  connection: httpapi

  collections:
    - cisco.dcnm

  tasks:
    - name: Merge a Switch
      dcnm_inventory:
        ...parameters...

Sample hosts file using the dcnm httpapi connection plugin in either the INI or YAML format.

  • Ansible INI Format
[dcnm_controllers]
192.168.2.10

[dcnm_controllers:vars]
ansible_user=dcnm_username
ansible_ssh_pass=dcnm_password
ansible_network_os=cisco.dcnm.dcnm
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True
ansible_httpapi_login_domain=local
  • Ansible YAML Format
all:
  vars:
    ansible_user: "dcnm_username"
    ansible_password: "dcnm_password"
    ansible_python_interpreter: python
    ansible_httpapi_validate_certs: False
    ansible_httpapi_use_ssl: True
    ansible_httpapi_login_domain: local
  children:
    dcnm_controllers:
      hosts:
        192.168.2.10:
           ansible_network_os: cisco.dcnm.dcnm

See Also:

Contributing to this collection

Ongoing development efforts and contributions to this collection are solely focused on enhancements to current dcnm modules, additional dcnm modules and enhancements to the connection plugin.

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the Cisco DCNM collection repository.

Changelogs

More information

Licensing

Copyright (c) 2020-2025 Cisco and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Certification

Product
Red Hat Ansible Automation Platform 2.4
Red Hat Ansible Automation Platform 2.5
DocumentationDependencies

This collection requires the following collections for use:

NameSummary
No dependencies
This collection is not being used by other collections.
View in Automation Hub
Red Hat logoLinkedInYouTubeFacebookTwitter

Platforms

Products & services

Try, buy, sell

Help

About Red Hat Ecosystem Catalog

The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2025 Red Hat