The ansible-nd
project provides an Ansible collection for managing and automating your Cisco Nexus Dashboard.
It consists of a set of plugins, modules and roles for performing tasks related to Cisco Nexus Dashboard.
See the cisco.nd collection index for a full list of modules and plugins.
- Ansible v2.15 or newer
- Python v3.10 or newer
Follow the Installing Ansible guide for detailed instructions.
Before using this collection, you need to install it with the Ansible Galaxy command-line tool:
ansible-galaxy collection install cisco.nd
You can also include this collection in a requirements.yml
file and install it with:
ansible-galaxy collection install -r requirements.yml
Using the following requirements.yml
format:
collections:
- name: cisco.nd
Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. To upgrade the collection to the latest available version, run the following command:
ansible-galaxy collection install cisco.nd --upgrade
You can also install a specific version of the collection. For example, to install version 1.0.0, use the following syntax:
ansible-galaxy collection install cisco.nd:==1.0.0
See using Ansible collections for more details.
Follow these instructions to get the latest collection.
Clone the ansible-nd repository.
git clone https://github.com/CiscoDevNet/ansible-nd.git
Go to the ansible-nd directory
cd ansible-nd
Pull the latest master on your nd
git pull origin master
Build and Install a collection from source
ansible-galaxy collection build --force
ansible-galaxy collection install cisco-nd-* --force
Go to ansible-nd Actions and select the latest CI build.
Under Artifacts download collection suffixed with the latest version of Ansible (eg. collection-stable-2.17
) and unzip it using Terminal or Console.
Note: The collection file is a zip file containing a tar.gz file. We recommend using CLI because some GUI-based unarchiver might unarchive both nested archives in one go.
Install the unarchived tar.gz file
ansible-galaxy collection install cisco-nd-1.0.0.tar.gz —-force
Once the collection is installed, you can use it in a playbook by specifying the full namespace path to the module, plugin and/or role.
- hosts: nd
gather_facts: no
tasks:
- name: Get ND version
cisco.nd.nd_version:
state: query
With the following inventory file:
[nd]
nd1 ansible_host=10.0.0.1 ansible_user=admin ansible_ssh_pass="MySuperPassword"
[nd:vars]
ansible_connection=ansible.netcommon.httpapi
ansible_network_os=cisco.nd.nd
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True
ansible_httpapi_use_proxy=True
You can also use the ND HTTPAPI connection plugin with your cisco.mso Ansible collection for MSO running on ND (MSO version >= 3.2) using the inventory file above.
- hosts: nd
gather_facts: no
tasks:
- name: Get MSO version from MSO >= 3.2
cisco.mso.mso_version:
state: query
Testing is currently done manually during the development of each module. Automated integration testing for this collection will be added in the future.
Ongoing development efforts and contributions to this collection are tracked as issues in this repository.
We welcome community contributions to this collection. If you find problems, need an enhancement or need a new module, please open an issue or create a PR against the Cisco Nexus Dashboard collection repository.
This collection supports any ND version within the Last Day of Support (LDOS) date.
Certain modules and options in the collection are only available from specific versions of ND. The versions that a module or option supports are documented in the individual module documentation.
To find EOL announcements for ND versions, refer to the End-of-Life and End-of-Sale Notices page.
See the Changelog for full release notes.
For further information, refer to the following:
This collection is licensed under the GNU General Public License v3.0