Skip to content

Commit

Permalink
Merge pull request #108 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop v6.7.3
  • Loading branch information
fmunozmiranda authored Jun 27, 2023
2 parents a2abb01 + 4c4b61e commit 427706b
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following table shows the supported versions.
| 2.2.2.3 | 3.3.1 | 2.3.3 |
| 2.2.3.3 | 6.4.0 | 2.4.11 |
| 2.3.3.0 | 6.6.4 | 2.5.5 |
| 2.3.5.3 | 6.7.2 | 2.6.0 |
| 2.3.5.3 | 6.7.3 | 2.6.0 |

If your Ansible collection is older please consider updating it first.

Expand Down
10 changes: 9 additions & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -689,4 +689,12 @@ releases:
changes:
release_summary: Adding documentation for 2.3.5.3 API
minor_changes:
- Updating documentation, collection supports 2.3.5.3 DNA Center API Version.
- Updating documentation, collection supports 2.3.5.3 DNA Center API Version.
6.7.3:
release_date: "2023-06-27"
changes:
release_summary: Updating documentation and fixing global credentials.
minor_changes:
- Documentation changes in example of site_intent
- The global credentials create implementation fixed.
- Discovery playbook has no hardcoded credentials id and seed IP.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: cisco
name: dnac
version: 6.7.2
version: 6.7.3
readme: README.md
authors:
- Rafael Campos <rcampos@altus.cr>
Expand Down
14 changes: 7 additions & 7 deletions playbooks/discovery.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
- hosts: dnac_servers
vars:
globalCredentialIdList:
- "90acbab8-03d5-4726-9c19-e1e51a40b3cd"
- "f979d842-f6fd-456a-8137-2cb5113cd2e8"
vars_files:
- credentials.yml
gather_facts: false
Expand All @@ -17,7 +21,7 @@

- name: Set fact of filtered discoveries
ansible.builtin.set_fact:
discoveries_filtered: "{{ discovery_range_result.dnac_response.response | selectattr('name', 'equalto', 'start_discovery_test2')}}"
discoveries_filtered: "{{ discovery_range_result.dnac_response.response | selectattr('name', 'equalto', 'DMZ Lab 2')}}"
when:
- discovery_range_result is defined
- discovery_range_result.dnac_response is defined
Expand Down Expand Up @@ -54,9 +58,7 @@
state: present
cdpLevel: 16
discoveryType: CDP
globalCredentialIdList:
- 90acbab8-03d5-4726-9c19-e1e51a40b3cd
- f979d842-f6fd-456a-8137-2cb5113cd2e8
globalCredentialIdList: "{{globalCredentialIdList}}"
ipAddressList: 10.10.22.22
name: start_discovery_test2
protocolOrder: ssh
Expand Down Expand Up @@ -93,9 +95,7 @@
state: present
cdpLevel: 16
discoveryType: CDP
globalCredentialIdList:
- 90acbab8-03d5-4726-9c19-e1e51a40b3cd,
- f979d842-f6fd-456a-8137-2cb5113cd2e8,
globalCredentialIdList: "{{globalCredentialIdList}}"
ipAddressList: 10.10.22.22
name: start_discovery_test2
protocolOrder: ssh
Expand Down
6 changes: 3 additions & 3 deletions playbooks/global_credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
validate_response_schema: false
enablePassword: C2sco456!
username: Test2
password: C2sco456!
description: Test2
password: C2sco456!2
description: Test2 Ansible

- name: Create SNMPV3 Credential
cisco.dnac.snmpv3_credential:
Expand All @@ -33,4 +33,4 @@
validate_response_schema: false
username: user2
snmpMode: NOAUTHNOPRIV
description: user2 cred
description: user2 222
2 changes: 1 addition & 1 deletion plugins/action/cli_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/http_read_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/http_write_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/netconf_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/snmpv2_read_community_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/snmpv2_write_community_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down
5 changes: 4 additions & 1 deletion plugins/action/snmpv3_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def exists(self):
id_exists = False
name_exists = False
o_id = self.new_object.get("id")
name = self.new_object.get("description") or self.new_object.get("username")
name = self.new_object.get("username") or self.new_object.get("description")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand Down Expand Up @@ -167,6 +167,9 @@ def requires_update(self, current_obj):
("snmpMode", "snmpMode"),
("username", "username"),
]

print("requested_obj: ", requested_obj)
print("current_obj: ", current_obj)
# Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params
# If any does not have eq params, it requires update
return any(not dnac_compare_equality(current_obj.get(dnac_param),
Expand Down
16 changes: 8 additions & 8 deletions plugins/modules/site_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@
dnac_debug: "{{dnac_debug}}"
dnac_log: "{{dnac_log}}"
config:
site:
building:
address: string
latitude: 0
longitude: 0
name: string
parentName: string
type: string
- site:
building:
address: string
latitude: 0
longitude: 0
name: string
parentName: string
type: string
"""

RETURN = r"""
Expand Down

0 comments on commit 427706b

Please sign in to comment.