Skip to content

Commit

Permalink
Merge pull request #169 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bvargasre authored Jun 1, 2024
2 parents fa3ee16 + d771b44 commit b1af2ed
Show file tree
Hide file tree
Showing 685 changed files with 33,478 additions and 8,072 deletions.
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
dnacentersdk = ">=2.7.0"

[dev-packages]

[requires]
python_version = "3.12"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The dnacenter-ansible project provides an Ansible collection for managing and automating your Cisco DNA Center environment. It consists of a set of modules and roles for performing tasks related to DNA Center.

This collection has been tested and supports Cisco DNA Center 2.3.5.3.
This collection has been tested and supports Cisco DNA Center 2.3.7.6.

*Note: This collection is not compatible with versions of Ansible before v2.8.*

Expand All @@ -15,11 +15,11 @@ The following table shows the supported versions.

| Cisco DNA Center version | Ansible "cisco.dnac" version | Python "dnacentersdk" version |
|--------------------------|------------------------------|-------------------------------|
| 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.4 | 2.5.5 |
| 2.3.5.3 | ^6.13.0 | ^2.6.0 |
| 2.3.5.3 | 6.13.3 | 2.6.11 |
| 2.3.7.6 | ^6.14.0 | ^2.7.1 |

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

Expand All @@ -45,7 +45,7 @@ ansible-galaxy collection install cisco.dnac:3.3.1

## Requirements
- Ansible >= 2.15
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.6.0 or newer
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.7.0 or newer
- Python >= 3.9, as the DNA Center SDK doesn't support Python version 2.x

## Install
Expand Down Expand Up @@ -76,7 +76,7 @@ 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.5.3 # optional, defaults to 2.3.5.3. See the Compatibility matrix
export DNAC_VERSION=2.3.7.6 # optional, defaults to 2.3.7.6. See the Compatibility matrix
export DNAC_VERIFY=False # optional, defaults to True
export DNAC_DEBUG=False # optional, defaults to False
```
Expand Down Expand Up @@ -114,7 +114,7 @@ dnac_host: <A.B.C.D>
dnac_port: 443 # optional, defaults to 443
dnac_username: <username>
dnac_password: <password>
dnac_version: 2.3.5.3 # optional, defaults to 2.3.5.3. See the Compatibility matrix
dnac_version: 2.3.7.6 # optional, defaults to 2.3.7.6. See the Compatibility matrix
dnac_verify: False # optional, defaults to True
dnac_debug: False # optional, defaults to False
```
Expand Down
43 changes: 43 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -865,4 +865,47 @@ releases:
minor_changes:
- Adding support to importing a template using JSON file
- Changes in discovery workflow manager modules relating to different states of the discovery job
6.14.0:
release_date: "2024-05-31"
changes:
release_summary: New Dna Center API version 2.3.7.6, and addition of Workflow Manager modules support for device configuration backups, events and notifications, ISE and RADIUS server integrations, and network compliance.
minor_changes:
- device_configs_backup_workflow_manager - New workflow manager module for device configuration backup functions.
- events_and_notifications_workflow_manager - New workflow manager for configuring various types of destinations(Webhook, Email, Syslog, SNMP, ITSM) to deliver event notifications.
- ise_radius_integration_workflow_manager - New workflow manager for Authentication and Policy Servers(ISE/AAA).
- network_compliance_workflow_manager - New workflow manager for Network Compliance module for managing network compliance tasks on reachable device(s).
- device_credential_workflow_manager - Updated the log messages.
- inventory_workflow_manager - Updated changes related to provisioning devices.
- provision_workflow_manager - Updated changes related to handle errors.
- site_workflow_manager - Updated changes in Site updation.
- network_settings_workflow_manager - Added attributes 'ipv4_global_pool_name'.
- template_workflow_manager - Removed attributes 'create_time', 'failure_policy', 'last_update_time', 'latest_version_time', 'parent_template_id', 'project_id', 'validation_errors', 'rollback_template_params' and 'rollback_template_content'.
- Changes in inventory and swim workflow manager modules.
- application_policy_application_set_count_info - new module
- application_policy_application_set_info - new module
- application_policy_application_set - new module
- applications_count_v2_info - new module
- applications_v2_info - new module
- applications_v2 - new module
- auth_token_create - new module
- authentication_policy_servers - new module
- device_reboot_apreboot - new module
- dna_event_snmp_config_info - new module
- event_snmp_config - new module
- event_webhook_read_info - new module
- flexible_report_content_info - new module
- flexible_report_execute - new module
- flexible_report_executions_info - new module
- flexible_report_schedule_info - new module
- flexible_report_schedule - new module
- integration_settings_itsm_instances_info - new module
- integration_settings_status_info - new module
- ise_integration_status_info - new module
- lan_automation_sessions_info - new module
- lan_automation_update_device - new module
- lan_automation_update_v2 - new module
- lan_automation_update - new module
- lan_automation_v2 - new module
- network_device_user_defined_field_delete - new module
- users_external_authentication - new module
- users_external_servers_aaa_attribute - new module
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.13.3
version: 6.14.0
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
39 changes: 39 additions & 0 deletions playbooks/configs_backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: Take running config backup of devices
hosts: localhost
connection: local
gather_facts: no

vars_files:
- "{{ CLUSTERFILE }}"

vars:
dnac_login: &dnac_login
dnac_host: "{{ dnac_host }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_port: "{{ dnac_port }}"
dnac_version: "{{ dnac_version }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log_level: "DEBUG"

tasks:
- name: Take backup of a wired 9500 switch
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config_verify: True
config:
- hostname: NY-BN-9500.cisco.local
file_path: /home/admin/madhan_ansible/collections/ansible_collections/cisco/dnac/playbooks/new_tmp

- name: Take backup of all the switches
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config_verify: True
config:
- family: Switches and Hubs
2 changes: 1 addition & 1 deletion playbooks/credentials.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dnac_host: <A.B.C.D>
dnac_port: 443
dnac_username: <username>
dnac_password: <password>
dnac_version: 2.3.5.3
dnac_version: 2.3.7.6
dnac_verify: False
dnac_debug: False
dnac_log_level: [CRITICAL, ERROR, WARNING, INFO, DEBUG]
Expand Down
21 changes: 18 additions & 3 deletions playbooks/device_credential_workflow_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gather_facts: no
connection: local
tasks:
- name: Create Credentials and assign it to a site.
- name: Create global device credentials.
cisco.dnac.device_credential_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
Expand All @@ -14,6 +14,7 @@
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
Expand Down Expand Up @@ -54,7 +55,20 @@
port: 443
# old_description:
# old_username:
assign_credentials_to_site:

- name: Assign global device credentials to a site.
cisco.dnac.device_credential_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
state: merged
config_verify: True
config:
- assign_credentials_to_site:
cli_credential:
description: CLI
username: cli
Expand All @@ -74,7 +88,7 @@
- Global/Chennai/Trill
- Global/Chennai/Tidel

- name: Delete Credentials
- name: Delete credentials
cisco.dnac.device_credential_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
Expand All @@ -84,6 +98,7 @@
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
state: deleted
config_verify: True
config:
- global_credential_details:
cli_credential:
Expand Down
Empty file added playbooks/dnac.log
Empty file.
65 changes: 65 additions & 0 deletions playbooks/events_and_notifications_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
- name: Configure channels and create events in Cisco Catalyst Center
hosts: localhost
connection: local
gather_facts: no
vars_files:
- "input_events_and_notification.yml"
- "credentials.yml"
tasks:
- name: Add/update channels with destination and create/update events in Cisco Catalyst Center.
cisco.dnac.events_and_notifications_workflow_manager:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log_level: DEBUG
dnac_log: true
config_verify: true
state: merged
config:
- syslog_destination:
name: "{{item.syslog_destination.name}}"
description: "{{item.syslog_destination.description}}"
server_address: "{{item.syslog_destination.server_address}}"
protocol: "{{item.syslog_destination.protocol}}"
port: "{{item.syslog_destination.port}}"
webhook_destination:
name: "{{item.webhook_destination.name}}"
description: "{{item.webhook_destination.description}}"
url: "{{item.webhook_destination.url}}"
method: "{{item.webhook_destination.method}}"
trust_cert: "{{item.webhook_destination.trust_cert}}"
email_destination:
from_email: "{{item.email_destination.from_email}}"
to_email: "{{item.email_destination.to_email}}"
subject: "{{item.email_destination.subject}}"
primary_smtp_config:
server_address: "{{item.email_destination.primary_smtp_config.server_address}}"
port: "{{item.email_destination.primary_smtp_config.port}}"
snmp_destination:
name: "{{item.snmp_destination.name}}"
description: "{{item.snmp_destination.description}}"
server_address: "{{item.snmp_destination.server_address}}"
port: "{{item.snmp_destination.port}}"
snmp_version: "{{item.snmp_destination.snmp_version}}"
username: "{{item.snmp_destination.username}}"
mode: "{{item.snmp_destination.mode}}"
auth_type: "{{item.snmp_destination.auth_type}}"
auth_password: "{{item.snmp_destination.auth_password}}"
privacy_type: "{{item.snmp_destination.privacy_type}}"
privacy_password: "{{item.snmp_destination.privacy_password}}"
itsm_setting:
instance_name: "{{item.itsm_setting.instance_name}}"
description: "{{item.itsm_setting.description}}"
connection_settings:
url: "{{item.itsm_setting.connection_settings.url}}"
username: "{{item.itsm_setting.connection_settings.username}}"
password: "{{item.itsm_setting.connection_settings.password}}"

with_items: "{{ events_notification }}"
tags:
- events_testing
40 changes: 40 additions & 0 deletions playbooks/input_events_and_notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
events_notification:
- syslog_destination:
name: Syslog Demo test
description: "Adding syslog destination for testing"
server_address: "10.30.0.90"
protocol: "TCP"
port: 652
webhook_destination:
name: "webhook demo 19"
description: "webhhok description for testing"
url: "https://10.195.227.14/dna"
method: "POST"
trust_cert: False
email_destination:
from_email: "[email protected]"
to_email: "[email protected]"
subject: "Ansible testing"
primary_smtp_config:
server_address: "outbound.cisco.com"
port: '25'
snmp_destination:
name: Snmp test
description: "Adding snmp destination for testing for update"
server_address: "10.30.0.91"
port: '265'
snmp_version: "V3"
username: cisco123
mode: AUTH_PRIVACY
auth_type: SHA
auth_password: authpass123
privacy_type: AES128
privacy_password: privacy123
itsm_setting:
instance_name: "Playbook itsm demo"
description: "ITSM description for testing"
connection_settings:
url: "https://catalystcente1.com"
username: "catalyst"
password: "catalyst@123"
Loading

0 comments on commit b1af2ed

Please sign in to comment.