Skip to content

Commit 5b36a5f

Browse files
committed
Initial commit of Nexus Dashboard Ansible collection
0 parents  commit 5b36a5f

20 files changed

+1807
-0
lines changed

CHANGELOG.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
======================================================
2+
Cisco Nexus Dashboard Ansible Collection Release Notes
3+
======================================================
4+
5+
.. contents:: Topics
6+
7+
8+
v0.1.0
9+
======
10+
11+
Release Summary
12+
---------------
13+
14+
Initial release of Nexus Dashboard collection

LICENSE

+678
Large diffs are not rendered by default.

README.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# ansible-nd
2+
3+
The `ansible-nd` project provides an Ansible collection for managing and automating your Cisco Nexus Dashboard.
4+
It consists of a set of plugins, modules and roles for performing tasks related to Cisco Nexus Dashboard.
5+
6+
This collection has been tested and supports Nexus Dahsboard (ND) 2.0+.
7+
Modules supporting new features introduced in ND API in specific ND versions might not be supported in earlier ND releases.
8+
9+
*Note: This collection is not compatible with versions of Ansible before v2.8.*
10+
11+
## Requirements
12+
- Ansible v2.9 or newer
13+
14+
## Install
15+
Ansible must be installed
16+
```
17+
sudo pip install ansible
18+
```
19+
20+
Install the collection
21+
```
22+
ansible-galaxy collection install cisco.nd
23+
```
24+
25+
## Use
26+
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.
27+
```yaml
28+
- hosts: nd
29+
gather_facts: no
30+
31+
tasks:
32+
- name: Get ND version
33+
cisco.nd.nd_version:
34+
state: query
35+
```
36+
37+
You can also use the ND HTTPAPI connection plugin with your cisco.mso Ansible collection for MSO running on ND (MSO version >= 3.2)
38+
```yaml
39+
- hosts: nd
40+
gather_facts: no
41+
42+
tasks:
43+
- name: Get MSO version from MSO >= 3.2
44+
cisco.mso.mso_version:
45+
state: query
46+
```
47+
48+
## Update
49+
Getting the latest/nightly collection build
50+
51+
### First Approach
52+
Clone the ansible-nd repository.
53+
```
54+
git clone https://github.com/CiscoDevNet/ansible-nd.git
55+
```
56+
57+
Go to the ansible-nd directory
58+
```
59+
cd ansible-nd
60+
```
61+
62+
Pull the latest master on your local repo
63+
```
64+
git pull origin master
65+
```
66+
67+
Build and Install a collection from source
68+
```
69+
ansible-galaxy collection build --force
70+
ansible-galaxy collection install cisco-nd-* --force
71+
```
72+
73+
### Second Approach
74+
Go to: https://github.com/CiscoDevNet/ansible-nd/actions
75+
76+
Select the latest CI build
77+
78+
Under Artifacts download collection and unzip it using Terminal or Console.
79+
80+
*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.*
81+
82+
Install the unarchived tar.gz file
83+
```
84+
ansible-galaxy collection install cisco-nd-*.tar.gz —-force
85+
```
86+
87+
### See Also:
88+
89+
* [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
90+
91+
## Contributing to this collection
92+
93+
Ongoing development efforts and contributions to this collection are tracked as issues in this repository.
94+
95+
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](https://github.com/CiscoDevNet/ansible-nd/issues).

changelogs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.plugin-cache.yaml

changelogs/changelog.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ancestor: null
2+
releases:
3+
0.1.0:
4+
changes:
5+
release_summary: Initial release of Nexus Dashboard collection
6+
release_date: '2021-06-02'

changelogs/config.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
changelog_filename_template: ../CHANGELOG.rst
2+
changelog_filename_version_depth: 0
3+
changes_file: changelog.yaml
4+
changes_format: combined
5+
ignore_other_fragment_extensions: true
6+
keep_fragments: false
7+
mention_ancestor: true
8+
new_plugins_after_name: removed_features
9+
notesdir: fragments
10+
prelude_section_name: release_summary
11+
prelude_section_title: Release Summary
12+
sections:
13+
- - major_changes
14+
- Major Changes
15+
- - minor_changes
16+
- Minor Changes
17+
- - breaking_changes
18+
- Breaking Changes / Porting Guide
19+
- - deprecated_features
20+
- Deprecated Features
21+
- - removed_features
22+
- Removed Features (previously deprecated)
23+
- - security_fixes
24+
- Security Fixes
25+
- - bugfixes
26+
- Bugfixes
27+
- - known_issues
28+
- Known Issues
29+
title: Cisco Nexus Dashboard Ansible Collection
30+
trivial_section_name: trivial
31+
use_fqcn: true

codecov.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage:
2+
precision: 2
3+
round: down
4+
range: "70...100"

galaxy.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
namespace: cisco
3+
name: nd
4+
# The version of the collection. Must be compatible with semantic versioning
5+
version: 0.1.0
6+
readme: README.md
7+
authors:
8+
- Lionel Hercot (@lhercot)
9+
description: An Ansible collection for managing Cisco Nexus Dashboard
10+
license_file: 'LICENSE'
11+
tags:
12+
- cisco
13+
- nd
14+
- aci
15+
- dcnm
16+
- orchestrator
17+
- multisite
18+
- insights
19+
- nexus
20+
- cloud
21+
- collection
22+
- networking
23+
- sdn
24+
dependencies:
25+
"ansible.netcommon": "*"
26+
repository: https://github.com/CiscoDevNet/ansible-nd
27+
#documentation: https://docs.ansible.com/ansible/latest/scenario_guides/guide_nd.html
28+
homepage: https://cisco.com/go/nexusdashboard
29+
issues: https://github.com/CiscoDevNet/ansible-nd/issues

meta/runtime.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
requires_ansible: '>=2.9.10'

plugins/doc_fragments/modules.py

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <[email protected]>
4+
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
5+
6+
from __future__ import (absolute_import, division, print_function)
7+
__metaclass__ = type
8+
9+
10+
class ModuleDocFragment(object):
11+
# Standard files documentation fragment
12+
DOCUMENTATION = r'''
13+
options:
14+
host:
15+
description:
16+
- IP Address or hostname of the Nexus Dashboard (ND) host.
17+
- If the value is not specified in the task, the value of environment variable C(ND_HOST) will be used instead.
18+
type: str
19+
required: yes
20+
aliases: [ hostname ]
21+
port:
22+
description:
23+
- Port number to be used for the REST connection.
24+
- The default value depends on parameter `use_ssl`.
25+
- If the value is not specified in the task, the value of environment variable C(ND_PORT) will be used instead.
26+
type: int
27+
username:
28+
description:
29+
- The username to use for authentication.
30+
- If the value is not specified in the task, the value of environment variables C(ND_USERNAME) or C(ANSIBLE_NET_USERNAME) will be used instead.
31+
type: str
32+
default: admin
33+
password:
34+
description:
35+
- The password to use for authentication.
36+
- If the value is not specified in the task, the value of environment variables C(ND_PASSWORD) or C(ANSIBLE_NET_PASSWORD) will be used instead.
37+
type: str
38+
required: yes
39+
output_level:
40+
description:
41+
- Influence the output of this ND module.
42+
- C(normal) means the standard output, incl. C(current) dict
43+
- C(info) adds informational output, incl. C(previous), C(proposed) and C(sent) dicts
44+
- C(debug) adds debugging output, incl. C(filter_string), C(method), C(response), C(status) and C(url) information
45+
- If the value is not specified in the task, the value of environment variable C(ND_OUTPUT_LEVEL) will be used instead.
46+
type: str
47+
choices: [ debug, info, normal ]
48+
default: normal
49+
timeout:
50+
description:
51+
- The socket level timeout in seconds.
52+
- If the value is not specified in the task, the value of environment variable C(ND_TIMEOUT) will be used instead.
53+
type: int
54+
default: 30
55+
use_proxy:
56+
description:
57+
- If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
58+
- If the value is not specified in the task, the value of environment variable C(ND_USE_PROXY) will be used instead.
59+
type: bool
60+
default: yes
61+
use_ssl:
62+
description:
63+
- If C(no), an HTTP connection will be used instead of the default HTTPS connection.
64+
- If the value is not specified in the task, the value of environment variable C(ND_USE_SSL) will be used instead.
65+
type: bool
66+
default: yes
67+
validate_certs:
68+
description:
69+
- If C(no), SSL certificates will not be validated.
70+
- This should only set to C(no) when used on personally controlled sites using self-signed certificates.
71+
- If the value is not specified in the task, the value of environment variable C(ND_VALIDATE_CERTS) will be used instead.
72+
type: bool
73+
default: yes
74+
login_domain:
75+
description:
76+
- The login domain name to use for authentication.
77+
- The default value is Local.
78+
- If the value is not specified in the task, the value of environment variable C(ND_LOGIN_DOMAIN) will be used instead.
79+
type: str
80+
requirements:
81+
- Nexus Dashboard v2.0 or newer
82+
notes:
83+
- Please read the :ref:`nd_guide` for more detailed information on how to manage your ND infrastructure using Ansible.
84+
- This module was written to support Nexus Dashboard v2.0 or newer. Some or all functionality may not work on earlier versions.
85+
'''

0 commit comments

Comments
 (0)