Skip to content

Commit

Permalink
Merge pull request #152 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bvargasre authored Feb 21, 2024
2 parents 95f51c5 + 72d11c3 commit e783b79
Show file tree
Hide file tree
Showing 41 changed files with 19,299 additions and 883 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.10.4 | 2.6.0 |
| 2.3.5.3 | 6.11.0 | 2.6.0 |

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

Expand Down
14 changes: 14 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,17 @@ releases:
- Introducing log levels and log file path
- Updated Documentation in template intent module
- Enhancements in device_credential, inventory, discovery and template intent modules.
6.11.0:
release_date: "2024-02-17"
changes:
release_summary: Adding new workflow manager modules in Cisco Catalyst Center
minor_changes:
- The 'site_workflow_manager' module orchestrates the creation of sites within the Cisco Catalyst Center, encompassing areas such as buildings and floors. It ensures necessary pre-checks are performed and allows for subsequent updates to these sites. Additionally, the module facilitates the deletion of specific sites using the site and parent names. A feature to delete all child sites by specifying only the parent site name is also available.
- The 'swim_workflow_manager' module handles the importation of SWIM images into the Cisco Catalyst Center, utilizing either a remote URL or a local image file path. It provides functionality for tagging and untagging SWIM images based on device family, role, and site. The module ensures the successful importation of images for distribution and activation on devices within the Cisco Catalyst Center. It also allows for the retrieval of a list of devices tied to a specific site, device family, and device role, facilitating various SWIM operations such as importing, tagging, distribution, and activation.
- The 'network_settings_workflow_manager' module manages global IP pool allocation, reserved sub pool assignment, and network function administration, including DHCP, Syslog, SNMP, NTP, Network AAA, client and endpoint AAA, and DNS servers, ensuring seamless operation at site and global levels in the Cisco Catalyst Center.
- The 'device_credential_workflow_manager' module oversees the management of global device credentials, including CLI, SNMPv2C read, SNMPv2C write, SNMPv3, HTTP(s) read, and HTTP(s) write. It facilitates the assignment of these credentials to specific sites, ensuring secure and efficient access to network devices across the infrastructure in the Cisco Catalyst Center.
- The 'inventory_workflow_manager' module is responsible for the actions that can be performed over devices which includes adding, deleting, resyncing, updating device details, device credentials, common info etc. for all types of devices - network device, compute device, meraki device, firepower management system device and third party devices. Exporting devices details and device credentials details into the CSV file, doing wired/wireless device provisioning, reboot AP devices, resyncing of device etc. Also we can update device just by giving the parameter that need to be changes on single or bulk devices and rest required parameters will be fetched from Cisco Catalyst Center and prepopulate it before triggering the update API.
- The 'pnp_workflow_manager' module helps in adding a device or adding devices in bulk to PnP database of the Cisco Catalyst Center. Post addition, device can be claimed to a site along with template provision and image upgrade. Along with that devices can be deleted from the PnP database.
- The 'discovery_workflow_manager' module streamlines the discovery of devices using various methods including single IP, IP range, multi-range, CDP, CIDR, and LLDP. It also offers the ability to clear out discoveries by deleting them from the discovery database, with an option to delete all discoveries simultaneously.
- The 'provision_workflow_manager' module provisions and re-provisions devices added in the inventory to site, by taking management IP address as input. It allows provisioning of both wired and wireless devices. It also allows un-provisioning of devices.
- The 'template_workflow_manager' module is responsible for overseeing templates, export projects/templates, and import projects/templates. It handles configuration templates by enabling the creation, updating, and deletion of templates and projects. Additionally, the module supports export functionality to retrieve project and template details from Cisco Catalyst Center, and Import functionality to create templates and projects within the Cisco Catalyst Center.
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
'.md': 'markdown',
}

# Avoid substitution of smartquotes
smartquotes = False

# The master toctree document.
master_doc = 'index'

Expand Down
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.10.4
version: 6.11.0
readme: README.md
authors:
- Rafael Campos <rcampos@altus.cr>
Expand Down
10 changes: 5 additions & 5 deletions playbooks/PnP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
pid: c9300-24P
is_sudi_required: True

- name: Claim an added Switch with template and image upgrade to a site only
- name: Claim a pre-added switch, apply a template, and perform an image upgrade for a specific site
cisco.dnac.pnp_intent:
<<: *dnac_login
dnac_log: True
Expand All @@ -75,14 +75,14 @@
state: Unclaimed
pid: C9300-48UXM

- name: Claim an added Wireless Controller with template and image upgrade to a site only
- name: Claim an existing Wireless Controller, apply a template, and upgrade its image for a specified site
cisco.dnac.pnp_intent:
<<: *dnac_login
dnac_log: True
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
pnp_type: catalyst_wlc
pnp_type: CatalystWLC
template_name: "Ansible_PNP_WLC"
image_name: C9800-40-universalk9_wlc.17.12.01.SPA.bin
template_params:
Expand All @@ -98,7 +98,7 @@
subnet_mask: 255.255.255.0
vlan_id: 1101

- name: Delete multiple devices from the Pnp dashboard #If device is not present it won't fail
- name: Remove multiple devices from the PnP dashboard safely (ignores non-existent devices)
cisco.dnac.pnp_intent:
<<: *dnac_login
dnac_log: True
Expand All @@ -108,4 +108,4 @@
- device_info:
- serial_number: QD2425L8M7 #Will get deleted
- serial_number: FTC2320E0HA #Doesn't exist in the inventory
- serial_number: FKC2310E0HB #Doesn't exist in the inventory
- serial_number: FKC2310E0HB #Doesn't exist in the inventory
111 changes: 111 additions & 0 deletions playbooks/PnP_Workflow_Manager_Playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
- name: Manage operations - Add, claim, and delete devices of Onboarding Configuration (PnP)
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: Import devices in bulk
cisco.dnac.pnp_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config_verify: True
config:
- device_info:
- serial_number: QD2425L8M7
state: Unclaimed
pid: c9300-24P
is_sudi_required: False

- serial_number: QTC2320E0H9
state: Unclaimed
pid: c9300-24P
hostname: Test-123

- serial_number: ETC2320E0HB
state: Unclaimed
pid: c9300-24P

- name: Add a new device and claim it
cisco.dnac.pnp_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
device_info:
- serial_number: FJC2330E0BB
hostname: Test-9300-10
state: Unclaimed
pid: c9300-24P
is_sudi_required: True

- name: Claim a pre-added switch, apply a template, and perform an image upgrade for a specific site
cisco.dnac.pnp_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
template_name: "Ansible_PNP_Switch"
image_name: cat9k_iosxe_npe.17.03.07.SPA.bin
project_name: Onboarding Configuration
template_details:
hostname: SJC-Switch-1
interface: TwoGigabitEthernet1/0/2
device_info:
- serial_number: FJC271924EQ
hostname: Switch
state: Unclaimed
pid: C9300-48UXM

- name: Claim an existing Wireless Controller, apply a template, and upgrade its image for a specified site
cisco.dnac.pnp_workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
pnp_type: CatalystWLC
template_name: "Ansible_PNP_WLC"
image_name: C9800-40-universalk9_wlc.17.12.01.SPA.bin
template_params:
hostname: IAC-EWLC-Claimed
device_info:
- serial_number: FOX2639PAY7
hostname: New_WLC
state: Unclaimed
pid: C9800-CL-K9
gateway: 204.192.101.1
ip_interface_name: TenGigabitEthernet0/0/0
static_ip: 204.192.101.10
subnet_mask: 255.255.255.0
vlan_id: 1101

- name: Remove multiple devices from the PnP dashboard safely (ignores non-existent devices)
cisco.dnac.pnp_workflow_manager:
<<: *dnac_login
dnac_log: True
state: deleted
config_verify: True
config:
- device_info:
- serial_number: QD2425L8M7 #Will get deleted
- serial_number: FTC2320E0HA #Doesn't exist in the inventory
- serial_number: FKC2310E0HB #Doesn't exist in the inventory
103 changes: 103 additions & 0 deletions playbooks/device_credential_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
- hosts: dnac_servers
vars_files:
- credentials.yml
gather_facts: no
connection: local
tasks:
- name: Create Credentials and assign it 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:
- global_credential_details:
cli_credential:
- description: CLI1
username: cli1
password: '12345'
enable_password: '12345'
# old_description:
# old_username:
snmp_v2c_read:
- description: SNMPv2c Read1 # use this for deletion
read_community: '123456'
# old_description: # use this for updating the description
snmp_v2c_write:
- description: SNMPv2c Write1 # use this for deletion
write_community: '123456'
# old_description: # use this for updating the description
snmp_v3:
- auth_password: '12345678' # Atleast 8 characters
auth_type: SHA # [SHA, MD5] (SHA is recommended)
snmp_mode: AUTHPRIV # [AUTHPRIV, AUTHNOPRIV, NOAUTHNOPRIV]
privacy_password: '12345678' # Atleast 8 characters
privacy_type: AES128 # [AE128, AE192, AE256]
username: snmpV31
description: snmpV31
# old_description:
https_read:
- description: HTTP Read1
username: HTTP_Read1
password: '12345'
port: 443
# old_description:
# old_username:
https_write:
- description: HTTP Write1
username: HTTP_Write1
password: '12345'
port: 443
# old_description:
# old_username:
assign_credentials_to_site:
cli_credential:
description: CLI
username: cli
snmp_v2c_read:
description: SNMPv2c Read
snmp_v2c_write:
description: SNMPv2c Write
snmp_v3:
description: snmpV3
https_read:
description: HTTP Read
username: HTTP_Read
https_write:
description: HTTP Write
username: HTTP_Write
site_name:
- Global/Chennai/Trill
- Global/Chennai/Tidel

- name: Delete Credentials
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: deleted
config:
- global_credential_details:
cli_credential:
- description: CLI1
username: cli1
snmp_v2c_read:
- description: SNMPv2c Read1 # use this for deletion
snmp_v2c_write:
- description: SNMPv2c Write1 # use this for deletion
snmp_v3:
- description: snmpV31
https_read:
- description: HTTP Read1
username: HTTP_Read1
https_write:
- description: HTTP Write1
username: HTTP_Write1
38 changes: 38 additions & 0 deletions playbooks/device_provision_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
- name: Provision and Re-provision wired and wireless 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 }}"

tasks:
- name: Provision a wired device to a site
cisco.dnac.workflow_manager:
<<: *dnac_login
dnac_log: True
state: merged
config_verify: True
config:
- site_name_hierarchy: Global/USA/San Francisco/BGL_18
management_ip_address: 204.1.1.1


- name: Unprovision a wired device from a site
cisco.dnac.workflow_manager:
<<: *dnac_login
dnac_log: True
state: deleted
config:
- management_ip_address: 204.1.1.1
Loading

0 comments on commit e783b79

Please sign in to comment.