Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #83

Merged
merged 16 commits into from
Nov 22, 2022
  •  
  •  
  •  
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Other versions of this collection have support for previous Cisco DNA Center ver
| 2.1.1 | 3.0.0 | 2.2.5 |
| 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.0 | 2.5.4 |
| 2.3.3.0 | 6.6.1 | 2.5.5 |

*Notes*:

Expand Down Expand Up @@ -59,7 +59,50 @@ Install the collection ([Galaxy link](https://galaxy.ansible.com/cisco/dnac))
```
ansible-galaxy collection install cisco.dnac
```
## Use
## Using this collection

There are three ways to use it:
- [Using environment variables](#using-environment-variables)
- [Using vars_files](#using-vars_files)

### Using environment variables
First, export the environment variables where you specify your DNA Center credentials as ansible variables:
```
export DNAC_HOST=<A.B.C.D>
export DNAC_PORT=443 # optional, defaults to 443
export DNAC_USERNAME=<username>
export DNAC_PASSWORD=<password>
export DNAC_VERSION=2.3.3.0 # optional, defaults to 2.3.3.0. See the Compatibility matrix
export DNAC_VERIFY=False # optional, defaults to True
export DNAC_DEBUG=False # optional, defaults to False
```

Create a `hosts` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/hosts)) file that uses `[dnac_servers]` with your Cisco DNA Center Settings:
```
[dnac_servers]
dnac_server
```

Then, create a playbook `myplaybook.yml` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/tag.yml)) referencing the variables in your credentials.yml file and specifying the full namespace path to the module, plugin and/or role:
```
- hosts: dnac_servers
gather_facts: no
tasks:
- name: Create tag with name "MyNewTag"
cisco.dnac.tag:
state: present
description: My Tag
name: MyNewTag
register: result
```

Execute the playbook:
```
ansible-playbook -i hosts myplaybook.yml
```

### Using vars_files

First, define a `credentials.yml` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/credentials.template)) file where you specify your DNA Center credentials as Ansible variables:
```
---
Expand Down
9 changes: 8 additions & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -600,4 +600,11 @@ releases:
- pnp_intent - new module.
- site_intent - new module.
- swim_intent - new module.
- template_intent - new module.
- template_intent - new module.
6.6.1:
release_date: "2022-11-17"
changes:
release_summary: Added the ability to export DNA Center credentials as environment variables and rennamed some vars.
bugfixes:
- DNA Center credentials can now be exported and used as env vars.
- sda_virtual_network_ip_pool - Now pass the site_name_hierarchy correctly in get method.
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.6.0
version: 6.6.1
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion plugins/action/sda_virtual_network_ip_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def __init__(self, params, dnac):

def get_all_params(self, name=None, id=None):
new_object_params = {}
new_object_params['siteNameHierarchy'] = self.new_object.get('site_name_hierarchy')
new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') or \
self.new_object.get('siteNameHierarchy')
new_object_params['virtual_network_name'] = self.new_object.get('virtualNetworkName') or \
self.new_object.get('virtual_network_name')
new_object_params['ip_pool_name'] = self.new_object.get('ipPoolName') or \
Expand Down
4 changes: 3 additions & 1 deletion plugins/action/site_assign_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def run(self, tmp=None, task_vars=None):
self._check_argspec()

Display().warning("This module is currently unmaintained "
"and will be removed in future releases.")
"and will be removed in future releases."
"New module is assign_device_to_site "
"for 2.3.3.0 or higher")

dnac = DNACSDK(params=self._task.args)

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_default_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyDefault
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- PolicyScope query parameter. Policy scope name.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicy
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_intent_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
type: dict
type: list
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy ApplicationPolicyIntent
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationPolicyQueuingProfile
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfileCount
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- Name query parameter. Queuing profile name.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfile
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationSet
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_sets_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSetsCount
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_sets_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- Name query parameter.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSets
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
type: list
type: list
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplication
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/applications_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationsCount
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/applications_health_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
- ApplicationName query parameter. The name of the application to get information on.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Applications Applications
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/applications_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- Name query parameter. Application's name.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplications
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/assign_device_to_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
description: SiteId path parameter. Site id to which site the device to assign.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for AssignDevicesToSite
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/associate_site_to_network_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
description: SiteId path parameter. Site Id to be associated.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Site Design Associate
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/authentication_import_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
description: PkPassword query parameter. Private Key Passsword.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Authentication Management ImportCertificate
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/authentication_import_certificate_p12.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
description: PkPassword query parameter. Private Key Passsword.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Authentication Management ImportCertificateP12
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/buildings_planned_access_points_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- Radios query parameter. Inlcude planned radio details.
type: bool
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Devices GetPlannedAccessPointsForBuilding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
description: VLAN Name.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Fabric Wireless AddSSIDToIPPoolMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- SiteNameHierarchy query parameter. Site Name Heirarchy.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Fabric Wireless GetSSIDToIPPoolMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- SiteNameHierarchy query parameter. Complete fabric siteNameHierarchy Path.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for GetVirtualNetworkSummary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
description: Site Name Hierarchy.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Fabric Wireless AddWLCToFabricDomain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: DeviceIPAddress query parameter. Device Management IP Address.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Fabric Wireless RemoveWLCFromFabricDomain
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cli_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
description: Cli Credential's username.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Discovery CreateCLICredentials
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/client_detail_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- MacAddress query parameter. MAC Address of the client.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Clients GetClientDetail
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/client_enrichment_details_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Clients GetClientEnrichmentDetails
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/client_health_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- Timestamp query parameter. Epoch time(in milliseconds) when the Client health data is required.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Clients GetOverallClientHealth
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/client_proximity_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
with a minimum 5 minutes.
type: int
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Clients ClientProximity
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/command_runner_run_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
description: Command Runner Run Command's timeout.
type: int
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Command Runner RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/compliance_check_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: TriggerFull flag.
type: bool
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Compliance RunCompliance
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/compliance_device_by_id_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- Value query parameter. Extended attribute value.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Compliance ComplianceDetailsOfDevice
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/compliance_device_details_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'.
type: str
requirements:
- dnacentersdk >= 2.5.4
- dnacentersdk >= 2.5.5
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Compliance GetComplianceDetailCount
Expand Down
Loading