Skip to content

Commit

Permalink
Merge pull request #71 from CiscoDevNet/1.1.1
Browse files Browse the repository at this point in the history
1.1.1
  • Loading branch information
mmudigon authored May 11, 2021
2 parents 902f7e1 + 3c0931c commit 735248f
Show file tree
Hide file tree
Showing 29 changed files with 1,064 additions and 580 deletions.
68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!--- Please keep this note for the community --->

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

<!--- Thank you for keeping this note for the community --->

### Ansible Version and collection version

<!--- Please run `ansible --version` to show the ansible version. --->

### DCNM version

* V x.x.x

### Affected module(s)

<!--- Please list the affected resources and data sources. --->

* dcnm_XXXXX

### Ansible Playbook

<!--- Information about code formatting: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code --->

```yaml
# Copy-paste your anisble playbook here
```

### Debug Output

<!---
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
To obtain the debug output, use `ansible-playbook -vvv`
--->

### Expected Behavior

<!--- What should have happened? --->

### Actual Behavior

<!--- What actually happened? --->

### Steps to Reproduce

<!--- Please list the steps required to reproduce the issue. --->

### References

<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

<!--- Please keep this note for the community --->

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

<!--- Thank you for keeping this note for the community --->

### Description

<!--- Please leave a helpful description of the feature request here. --->

### New or Affected modules(s):

<!--- Please list the new or affected modules --->

* dcnm_XXXXX

### DCNM version

* V x.x.x

### Potential ansible task config

<!--- Information about code formatting: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code --->

```yaml
# Copy-paste your ansible playbook
```

### References

<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? For example:
--->

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ main ]
branches: [ develop, main ]
pull_request:
branches: [ main ]
branches: [ develop, main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.1] - 2021-05

### Fixed

* https://github.com/CiscoDevNet/ansible-dcnm/issues/66
* https://github.com/CiscoDevNet/ansible-dcnm/issues/65
* https://github.com/CiscoDevNet/ansible-dcnm/issues/63
* https://github.com/CiscoDevNet/ansible-dcnm/issues/62
* https://github.com/CiscoDevNet/ansible-dcnm/issues/60
* https://github.com/CiscoDevNet/ansible-dcnm/issues/57

## [1.1.0] - 2021-04

Expand Down Expand Up @@ -68,5 +78,6 @@ The Ansible Cisco Data Center Network Manager (DCNM) collection includes modules
* cisco.dcnm.dcnm_network - Add and remove Networks from a DCNM managed VXLAN fabric.
* cisco.dcnm.dcnm_interface - DCNM Ansible Module for managing interfaces.
[1.1.1]: https://github.com/CiscoDevNet/ansible-dcnm/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/CiscoDevNet/ansible-dcnm/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/CiscoDevNet/ansible-dcnm/compare/0.9.0...1.0.0
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ You can also include it in a `requirements.yml` file and install it with `ansibl
---
collections:
- name: cisco.dcnm
version: 1.1.0
version: 1.1.1
```
## Using this collection
Expand Down
14 changes: 7 additions & 7 deletions docs/cisco.dcnm.dcnm_policy_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ Examples
- name: Create different policies
cisco.dcnm.dcnm_policy:
fabric: "{{ ansible_it_fabric }}"
state: merged
deploy: true
config:
- name: template_101 # This must be a valid template name
create_additional_policy: false # Do not create a policy if it already exists
Expand All @@ -400,8 +402,6 @@ Examples
- name: template_105 # This must be a valid template name
create_additional_policy: false # Do not create a policy if it already exists
- ip: "{{ ansible_switch2 }}"
deploy: true
state: merged

CREATE POLICY (including arguments)

Expand Down Expand Up @@ -429,6 +429,8 @@ Examples
- name: Modify different policies
cisco.dcnm.dcnm_policy:
fabric: "{{ ansible_it_fabric }}"
state: merged
deploy: true
config:
- name: POLICY-101101 # This must be a valid POLICY ID
create_additional_policy: false # Do not create a policy if it already exists
Expand All @@ -452,8 +454,6 @@ Examples
- name: POLICY-105105 # This must be a valid POLICY ID
create_additional_policy: false # Do not create a policy if it already exists
- ip: "{{ ansible_switch2 }}"
deploy: true
state: merged

DELETE POLICY

Expand Down Expand Up @@ -496,33 +496,33 @@ Examples
- name: Query all policies from the specified switches
cisco.dcnm.dcnm_policy:
fabric: "{{ ansible_it_fabric }}"
state: query
config:
- switch:
- ip: "{{ ansible_switch1 }}"
- ip: "{{ ansible_switch2 }}"
state: query

- name: Query policies matching template names
cisco.dcnm.dcnm_policy:
fabric: "{{ ansible_it_fabric }}"
state: query
config:
- name: template_101
- name: template_102
- name: template_103
- switch:
- ip: "{{ ansible_switch1 }}"
state: query

- name: Query policies using policy-ids
cisco.dcnm.dcnm_policy:
fabric: "{{ ansible_it_fabric }}"
state: query
config:
- name: POLICY-101101
- name: POLICY-102102
- name: POLICY-103103
- switch:
- ip: "{{ ansible_switch1 }}"
state: query



Expand Down
10 changes: 5 additions & 5 deletions docs/cisco.dcnm.dcnm_template_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@ Examples
Deleted:
Templates defined in the playbook will be deleted from the target.

Deletes the list of templates specified in the playbook.
Deletes the list of templates specified in the playbook.

Query:
Returns the current DCNM state for the templates listed in the playbook.


# To create or modify templates
# To create or modify templates

- name: Create or modify templates
cisco.dcnm.dcnm_template:
cisco.dcnm.dcnm_template:
state: merged # only choose form [merged, deleted, query]
config:
- name: template_101
Expand Down Expand Up @@ -210,7 +210,7 @@ Examples
dst-grp 102
snsr-grp 102 sample-interval 10102

# To delete templates
# To delete templates

- name: Delete templates
cisco.dcnm.dcnm_template:
Expand All @@ -224,7 +224,7 @@ Examples

- name: template_104

# To query templates
# To query templates

- name: Query templates
cisco.dcnm.dcnm_template:
Expand Down
3 changes: 2 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
namespace: cisco
name: dcnm
version: 1.1.0
version: 1.1.1
readme: README.md
authors:
- Shrishail Kariyappanavar <nkshrishail>
- Mallik Mudigonda <mmudigon>
- Karthik Babu Harichandra Babu <kharicha>
- Mike Wiebe <mikewiebe>
- Praveen Ramoorthy <praveenramoorthy>
description: Ansible collection for the Cisco Data Center Nework Manager (DCNM)
license_file: LICENSE
tags: [cisco, dcnm, nxos, networking, vxlan]
Expand Down
4 changes: 3 additions & 1 deletion plugins/httpapi/dcnm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def login(self, username, password):
response, response_data = self.connection.send(path, data, method=method, headers=self.headers, force_basic_auth=True)
response_value = self._get_response_value(response_data)
self.connection._auth = {'Dcnm-Token': self._response_to_json(response_value)['Dcnm-Token']}

except Exception as e:
msg = 'Error on attempt to connect and authenticate with DCNM controller: {}'.format(e)
raise ConnectionError(self._return_info(None, method, path, msg))
Expand All @@ -78,12 +79,13 @@ def logout(self):
path = '/rest/logout'

try:
response, response_data = self.connection.send(path, {}, method=method, headers=self.headers, force_basic_auth=True)
response, response_data = self.connection.send(path, self.connection._auth['Dcnm-Token'], method=method, headers=self.headers, force_basic_auth=True)
except Exception as e:
msg = 'Error on attempt to logout from DCNM controller: {}'.format(e)
raise ConnectionError(self._return_info(None, method, path, msg))

self._verify_response(response, method, path, response_data)

# Clean up tokens
self.connection._auth = None

Expand Down
Loading

0 comments on commit 735248f

Please sign in to comment.