Skip to content

Commit

Permalink
Merge pull request #18 from madhansansel/main
Browse files Browse the repository at this point in the history
latest changes 02/06
  • Loading branch information
rukapse authored Feb 6, 2024
2 parents 1ff4c73 + 0cf3fe1 commit 4b6e452
Show file tree
Hide file tree
Showing 38 changed files with 15,173 additions and 389 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.1 | 2.6.0 |
| 2.3.5.3 | 6.10.4 | 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 @@ -778,3 +778,17 @@ releases:
- Set dnac log level if it is not set in the playbook.
- Handle provisioning of device if it is not in managed state for longer.
- Set the logging levels for device credentails intent module.
6.10.3:
release_date: "2024-01-30"
changes:
release_summary: Fixing swim_import_local action.
minor_changes:
- Building additional parameters needed in sdk.
6.10.4:
release_date: "2024-02-05"
changes:
release_summary: Enhancements in Cisco Catalyst Center logging
minor_changes:
- Introducing log levels and log file path
- Updated Documentation in template intent module
- Enhancements in device_credential, inventory, discovery and template intent modules.
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.2
version: 6.10.4
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
5 changes: 4 additions & 1 deletion playbooks/credentials.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ dnac_username: <username>
dnac_password: <password>
dnac_version: 2.3.5.3
dnac_verify: False
dnac_debug: False
dnac_debug: False
dnac_log_level: [CRITICAL, ERROR, WARNING, INFO, DEBUG]
dnac_log_file_path: <file_path>
dnac_log_append: True
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
64 changes: 64 additions & 0 deletions playbooks/inventory_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
- name: Configure device credentials on Cisco DNA Center
hosts: localhost
connection: local
gather_facts: no
vars_files:
- "input_inventory.yml"
- "credentials.yml"
tasks:
- name: Add/Update/Resync/Delete the devices in Cisco DNA Center Inventory.
cisco.dnac.inventory_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:
- username: "{{item.username}}"
enable_password: "{{item.enable_password}}"
password: "{{item.password}}"
ip_address: "{{item.ip_address}}"
cli_transport: "{{item.cli_transport}}"
# hostname_list: "{{item.hostname_list}}"
# serial_number_list: "{{item.serial_number_list}}"
# mac_address_list: "{{item.mac_address_list}}"
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}}"
device_updated: "{{item.device_updated}}"
credential_update: "{{item.credential_update}}"
clean_config: "{{item.clean_config}}"
type: "{{item.type}}"
device_added: "{{item.device_added}}"
device_resync: "{{item.device_resync}}"
reboot_device: "{{item.reboot_device}}"
update_device_role:
role: "{{item.role}}"
role_source: "{{item.role_source}}"
add_user_defined_field:
name: "{{item.name}}"
description: "{{item.description}}"
value: "{{item.value}}"
provision_wired_device:
site_name: "{{item.site_name}}"
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
4 changes: 4 additions & 0 deletions playbooks/network_settings_intent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
dnac_log_append: True
dnac_log_file_path: "{{ dnac_log_file_path }}"
state: merged
config_verify: True
config:
Expand Down Expand Up @@ -95,6 +98,7 @@
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: deleted
config_verify: True
config:
Expand Down
107 changes: 107 additions & 0 deletions playbooks/network_settings_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
- hosts: dnac_servers
vars_files:
- credentials.yml
gather_facts: no
connection: local
tasks:
- name: Create global pool, reserve subpool and network functions
cisco.dnac.network_settings_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
dnac_log_level: "{{ dnac_log_level }}"
dnac_log_append: True
dnac_log_file_path: "{{ dnac_log_file_path }}"
state: merged
config_verify: True
config:
- global_pool_details:
settings:
ip_pool:
- name: Global_Pool2
gateway: '' #use this for updating
ip_address_space: IPv6 #required when we are creating
cidr: 2001:db8::/64 #required when we are creating
type: Generic
dhcp_server_ips: [] #use this for updating
dns_server_ips: [] #use this for updating
# prev_name: Global_Pool2
reserve_pool_details:
ipv6_address_space: True
ipv4_global_pool: 100.0.0.0/8
ipv4_prefix: True
ipv4_prefix_length: 9
ipv4_subnet: 100.128.0.0
# ipv4_dns_servers: [100.128.0.1]
name: IP_Pool_3
ipv6_prefix: True
ipv6_prefix_length: 64
ipv6_global_pool: 2001:db8::/64
ipv6_subnet: '2001:db8::'
site_name: Global/Chennai/Trill
slaac_support: True
# prev_name: IP_Pool_4
type: LAN
network_management_details:
settings:
dhcp_server:
- 10.0.0.1
dns_server:
domain_name: cisco.com
primary_ip_address: 10.0.0.2
secondary_ip_address: 10.0.0.3
client_and_endpoint_aaa: #works only if we system settigns is set
ip_address: 10.197.156.42 #Mandatory for ISE, sec ip for AAA
network: 10.0.0.20
protocol: RADIUS
servers: AAA
# shared_secret: string #ISE
message_of_the_day:
banner_message: hello
retain_existing_banner: 'true'
netflow_collector:
ip_address: 10.0.0.4
port: 443
network_aaa: #works only if we system settigns is set
ip_address: 10.0.0.21 #Mandatory for ISE, sec ip for AAA
network: 10.0.0.20
protocol: TACACS
servers: AAA
# shared_secret: string #ISE
ntp_server:
- 10.0.0.5
snmp_server:
configure_dnac_ip: false
# ip_addresses:
# - 10.0.0.6
syslog_server:
configure_dnac_ip: false
# ip_addresses:
# - 10.0.0.7
timezone: GMT
site_name: Global/Chennai

- name: Delete Global Pool and Release Pool Reservation
cisco.dnac.network_settings_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
dnac_log_level: "{{ dnac_log_level }}"
state: deleted
config_verify: True
config:
- global_pool_details:
settings:
ip_pool:
- name: Global_Pool2
reserve_pool_details:
name: IP_Pool_3
site_name: Global/Chennai/Trill
47 changes: 47 additions & 0 deletions playbooks/site_workflow_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
- hosts: localhost
connection: local
gather_facts: no
vars_files:
- "credentials.yml"
tasks:
- name: Get site info and updating site details
cisco.dnac.site_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: true
dnac_log_level: DEBUG
config_verify: true
state: merged
config:
- site:
floor:
name: Test_Floor6
parent_name: 'Global/USA/San Francisco/BGL_18'
length: "103"
width: "75"
height: "50"
rf_model: 'Cubes And Walled Offices'
floor_number: 3
type: floor
- site:
area:
name: Abc
parent_name: 'Global'
address: Bengaluru, Karnataka, India
latitude: 22.2111
longitude: -42.1234434
country: "United States"
type: area

# For deleting a site
# - site:
# floor:
# name: Test_Floor2
# parent_name: 'Global/USA/San Francisco/BGL_18'
# type: floor

Loading

0 comments on commit 4b6e452

Please sign in to comment.