Skip to content

Commit

Permalink
Merge pull request #214 from cisco-en-programmability/main
Browse files Browse the repository at this point in the history
Changes in workflow manager modules
  • Loading branch information
JosePabloOcampo1212 authored Dec 13, 2024
2 parents 6c62584 + 9f44368 commit ff511c5
Show file tree
Hide file tree
Showing 28 changed files with 2,101 additions and 1,048 deletions.
21 changes: 21 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,24 @@ releases:
- Changes in site_workflow_manager module
- Changes in template_workflow_manager
- Unit test modules added for pnp_workflow_manager module
6.26.0:
release_date: "2024-12-10"
changes:
release_summary: Changes in workflow manager modules
minor_changes:
- Added sample playbook for Device Configs Backup Module
- Changes in dnac.py file
- Bug fixes in accesspoint_workflow_manager module
- Enhancements in device_configs_backup_workflow_manager module to support unzipped backup file after download
- Changes in inventory_workflow_manager module
- Changes in ise_radius_integration_workflow_manager
- Changes in network_compliance_workflow_manager
- Changes in network_settings_workflow_manager
- Bug fixes in sda_fabric_devices_workflow_manager
- Bug fixes in sda_fabric_transits_workflow_manager
- Enhancements in sda_host_port_onboarding_workflow_manager module
- Changes in swim_workflow_manager module
- sda_fabric_devices_workflow_manager - attribute 'delete_fabric_device' was removed
- sda_host_port_onboarding_workflow_manager - attributes 'port_channels', 'fabric_site_name_hierarchy', 'port_assignments', 'wireless_ssids' were added
- sda_host_port_onboarding_workflow_manager - attributes 'port_channel_details', 'port_assignment_details' were removed
- device_configs_backup_workflow_managerr - attribute 'unzip_backup' was added
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.25.1
version: 6.26.0
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
127 changes: 127 additions & 0 deletions playbooks/device_configs_backup_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
- name: Sample playbook for Device Configs Backup Module
hosts: dnac_servers
gather_facts: false

vars_files:
- "credentials.yml"

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: true
dnac_log_level: INFO
dnac_log_append: false
config_verify: true

tasks:
- name: Take backup of all devices in the Cisco Catalyst Center
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- file_password: qsaA12!asdasd

- name: Take backup of device(s) using hostname(s)
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- hostname_list: ["DC-T-9300.cisco.local", "NY-BN-9300.cisco.local"]
file_path: backup
unzip_backup: false

- name: Take backup of device(s) using hostname(s) and provide file password
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- hostname_list: ["DC-T-9300.cisco.local"]
file_path: backup
file_password: qsaA12!asdasd
unzip_backup: true

- name: Take backup of all devices in a site(s)
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- site_list: ["Global/USA/RTP/BLD10", "Global/USA/New York/BLDNYC/FLOOR1"]
file_path: backup

- name: Take backup of device(s) using IP Address List
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- ip_address_list: ["204.1.2.5", "204.1.2.4", "204.1.2.2"]
file_path: backup

- name: Take backup of device(s) using MAC Address List
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- mac_address_list: ["d4:ad:bd:c1:67:00", " 00:b6:70:32:b8:00", "0c:75:bd:42:c3:80", "90:88:55:07:59:00"]
file_path: backup
unzip_backup: false

- name: Take backup of device(s) using Serial Number List
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- serial_number_list: ["FCW2225C020", "FJB2334D06N", "FJC2327U0S2", "FJC2721271T"]
file_path: backup

- name: Take backup of device(s) using Family List
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- family_list: ["Switches and Hubs", "Routers"]
file_path: backup
unzip_backup: true

- name: Take backup of device(s) using Device Family Type List
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- type_list: ["Cisco Catalyst 9300 Switch"]
file_path: backup
unzip_backup: false

- name: Take backup of device(s) using Device Series
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- series_list: ["Cisco Catalyst 9300 Series Switches"]
file_path: backup

- name: Take backup of devices with certain Collection Status
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- collection_status_list: ["Managed"]
file_path: backup

- name: Take backup of device(s) in a site and also that meet other parameters
cisco.dnac.device_configs_backup_workflow_manager:
<<: *dnac_login
state: merged
config:
- site_list: ["Global"]
family_list: ["Switches and Hubs"]
series_list: ["Cisco Catalyst 9300 Series Switches"]
ip_address_list: ["204.1.2.5"]
file_path: backup
unzip_backup: false
88 changes: 44 additions & 44 deletions playbooks/inventory_workflow_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,47 @@
config_verify: true
state: merged
config:
- username: "{{item.username}}"
password: "{{item.password}}"
enable_password: "{{item.enable_password}}"
ip_address_list: "{{item.ip_address_list}}"
cli_transport: "{{item.cli_transport}}"
snmp_auth_passphrase: "{{item.snmp_auth_passphrase}}"
snmp_auth_protocol: "{{item.snmp_auth_protocol}}"
snmp_mode: "{{item.snmp_mode}}"
snmp_priv_passphrase: "{{item.snmp_priv_passphrase}}"
snmp_priv_protocol: "{{item.snmp_priv_protocol}}"
snmp_ro_community: "{{item.snmp_ro_community}}"
snmp_rw_community: "{{item.snmp_rw_community}}"
snmp_username: "{{item.snmp_username}}"
credential_update: "{{item.credential_update}}"
clean_config: "{{item.clean_config}}"
type: "{{item.type}}"
device_resync: "{{item.device_resync}}"
reboot_device: "{{item.reboot_device}}"
role: "{{item.role}}"
add_user_defined_field:
- name: Test123
description: "Added first udf for testing"
value: "value123"
- name: Test321
description: "Added second udf for testing"
value: "value321"
provision_wired_device:
- device_ip: "1.1.1.1"
site_name: "Global/USA/San Francisco/BGL_18/floor_pnp"
resync_retry_count: 200
resync_interval: 2
- device_ip: "2.2.2.2"
site_name: "Global/USA/San Francisco/BGL_18/floor_test"
resync_retry_count: 200
resync_retry_interval: 2
update_interface_details:
description: "{{item.update_interface_details.description}}"
interface_name: "{{item.interface_name}}"
export_device_list:
password: "{{item.export_device_list.password}}"
with_items: "{{ device_details }}"
tags:
- inventory_device
- username: "{{item.username}}"
password: "{{item.password}}"
enable_password: "{{item.enable_password}}"
ip_address_list: "{{item.ip_address_list}}"
cli_transport: "{{item.cli_transport}}"
snmp_auth_passphrase: "{{item.snmp_auth_passphrase}}"
snmp_auth_protocol: "{{item.snmp_auth_protocol}}"
snmp_mode: "{{item.snmp_mode}}"
snmp_priv_passphrase: "{{item.snmp_priv_passphrase}}"
snmp_priv_protocol: "{{item.snmp_priv_protocol}}"
snmp_ro_community: "{{item.snmp_ro_community}}"
snmp_rw_community: "{{item.snmp_rw_community}}"
snmp_username: "{{item.snmp_username}}"
credential_update: "{{item.credential_update}}"
clean_config: "{{item.clean_config}}"
type: "{{item.type}}"
device_resync: "{{item.device_resync}}"
reboot_device: "{{item.reboot_device}}"
role: "{{item.role}}"
add_user_defined_field:
- name: Test123
description: "Added first udf for testing"
value: "value123"
- name: Test321
description: "Added second udf for testing"
value: "value321"
provision_wired_device:
- device_ip: "1.1.1.1"
site_name: "Global/USA/San Francisco/BGL_18/floor_pnp"
resync_retry_count: 200
resync_interval: 2
- device_ip: "2.2.2.2"
site_name: "Global/USA/San Francisco/BGL_18/floor_test"
resync_retry_count: 200
resync_retry_interval: 2
update_interface_details:
description: "{{item.update_interface_details.description}}"
interface_name: "{{item.interface_name}}"
export_device_list:
password: "{{item.export_device_list.password}}"

with_items: "{{ device_details }}"
tags:
- inventory_device
112 changes: 66 additions & 46 deletions playbooks/sda_fabric_devices_workflow_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,40 @@
state: merged
config_verify: true
config:
- fabric_devices:
fabric_name: Global/USA/SAN-JOSE
device_config:
- device_ip: 10.0.0.1
device_roles: [CONTROL_PLANE_NODE, EDGE_NODE]
borders_settings:
layer3_settings:
local_autonomous_system_number: 213
is_default_exit: true
import_external_routes: true
border_priority: 1
prepend_autonomous_system_count: 1
- fabric_devices:
fabric_name: Global/USA/SAN-JOSE
device_config:
- device_ip: 10.0.0.1
device_roles: [CONTROL_PLANE_NODE, EDGE_NODE]
borders_settings:
layer3_settings:
local_autonomous_system_number: 213
is_default_exit: true
import_external_routes: true
border_priority: 1
prepend_autonomous_system_count: 1

layer3_handoff_ip_transit:
- transit_network_name: IP_TRANSIT_1
interface_name: FortyGigabitEthernet1/1/1
external_connectivity_ip_pool_name: reserved_pool_1
virtual_network_name: L3VN1
vlan_id: 333
tcp_mss_adjustment: 510
layer3_handoff_ip_transit:
- transit_network_name: IP_TRANSIT_1
interface_name: FortyGigabitEthernet1/1/1
external_connectivity_ip_pool_name: reserved_pool_1
virtual_network_name: L3VN1
vlan_id: 333
tcp_mss_adjustment: 510

layer3_handoff_sda_transit:
transit_network_name: SDA_PUB_SUB_TRANSIT
affinity_id_prime: 2
affinity_id_decider: 2
connected_to_internet: true
is_multicast_over_transit_enabled: true
layer3_handoff_sda_transit:
transit_network_name: SDA_PUB_SUB_TRANSIT
affinity_id_prime: 2
affinity_id_decider: 2
connected_to_internet: true
is_multicast_over_transit_enabled: true

layer2_handoff:
- interface_name: FortyGigabitEthernet1/1/1
internal_vlan_id: 443
external_vlan_id: 444
layer2_handoff:
- interface_name: FortyGigabitEthernet1/1/1
internal_vlan_id: 443
external_vlan_id: 444

- name: Delete the SDA fabric device and remove L2 and L3 handoff configurations
- name: Delete the SDA fabric device's L2 and L3 handoff configurations
cisco.dnac.sda_fabric_devices_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
Expand All @@ -66,23 +66,43 @@
dnac_log_level: DEBUG
dnac_log_append: true
dnac_log_file_path: "{{ dnac_log_file_path }}"
state: merged
state: deleted
config_verify: true
config:
- fabric_devices:
fabric_name: Global/USA/SAN-JOSE
device_config:
- device_ip: 10.0.0.1
delete_fabric_device: true
borders_settings:
layer3_handoff_ip_transit:
- transit_network_name: IP_TRANSIT_1
interface_name: FortyGigabitEthernet1/1/1
virtual_network_name: L3VN1
- fabric_devices:
fabric_name: Global/USA/SAN-JOSE
device_config:
- device_ip: 10.0.0.1
borders_settings:
layer3_handoff_ip_transit:
- transit_network_name: IP_TRANSIT_1
interface_name: FortyGigabitEthernet1/1/1
virtual_network_name: L3VN1

layer3_handoff_sda_transit:
- transit_network_name: SDA_PUB_SUB_TRANSIT

layer3_handoff_sda_transit:
- transit_network_name: SDA_PUB_SUB_TRANSIT
layer2_handoff:
- interface_name: FortyGigabitEthernet1/1/1
internal_vlan_id: 443

layer2_handoff:
- interface_name: FortyGigabitEthernet1/1/1
internal_vlan_id: 443
- name: Delete the SDA fabric device
cisco.dnac.sda_fabric_devices_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_version: "{{ dnac_version }}"
dnac_log: true
dnac_log_level: DEBUG
dnac_log_append: true
dnac_log_file_path: "{{ dnac_log_file_path }}"
state: deleted
config_verify: true
config:
- fabric_devices:
fabric_name: Global/USA/SAN-JOSE
device_config:
- device_ip: 10.0.0.1
Loading

0 comments on commit ff511c5

Please sign in to comment.