-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from cisco-en-programmability/develop
Develop
- Loading branch information
Showing
41 changed files
with
19,299 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.