Skip to content

Commit

Permalink
Merge pull request #53 from abimishr/PNP_Code_Abinash
Browse files Browse the repository at this point in the history
Adding bulk addition and bulk deletion, along with variable names cha…
  • Loading branch information
madhansansel authored Nov 27, 2023
2 parents 9bdd513 + 9f11298 commit e038f97
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 242 deletions.
81 changes: 48 additions & 33 deletions playbooks/PnP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,28 @@

tasks:

- name: Add a new device only
- name: Import devices in bulk
cisco.dnac.pnp_intent:
<<: *dnac_login
dnac_log: True
state: merged
config:
- deviceInfo:
add_device_method: Single
serialNumber: FJC2330E0IK
hostname: Test-9300-6
state: Unclaimed
pid: c9300-24P
isSudiRequired: True
- device_info:
- serial_number: FKC2310E0HB
hostname: 1-5
state: Unclaimed
pid: c9300-24P
is_sudi_required: False

- serial_number: FTC2320E0HB
hostname: 1-6
state: Unclaimed
pid: c9300-24P

- serial_number: ETC2320E0HB
hostname: 1-7
state: Unclaimed
pid: c9300-24P

- name: Add a new device and claim it
cisco.dnac.pnp_intent:
Expand All @@ -40,13 +49,12 @@
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
deviceInfo:
add_device_method: Single
serialNumber: FJC2330E0IK
hostname: Test-9300-6
state: Unclaimed
pid: c9300-24P
isSudiRequired: True
device_info:
- serial_number: FJC2330E0BB
hostname: Test-9300-10
state: Unclaimed
pid: c9300-24P
is_sudi_required: True

- name: Claim an added Switch with template and image upgrade to a site only
cisco.dnac.pnp_intent:
Expand All @@ -58,11 +66,14 @@
template_name: "Ansible_PNP_Switch"
image_name: cat9k_iosxe_npe.17.03.07.SPA.bin
project_name: Onboarding Configuration
deviceInfo:
serialNumber: FJC271924EQ
hostname: Switch
state: Unclaimed
pid: C9300-48UXM
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 added Wireless Controller with template and image upgrade to a site only
cisco.dnac.pnp_intent:
Expand All @@ -71,25 +82,29 @@
state: merged
config:
- site_name: Global/USA/San Francisco/BGL_18
pnp_type: CatalystWLC
pnp_type: catalyst_wlc
template_name: "Ansible_PNP_WLC"
image_name: C9800-40-universalk9_wlc.17.12.01.SPA.bin
deviceInfo:
serialNumber: FOX2639PAY7
hostname: WLC
state: Unclaimed
pid: C9800-CL-K9
template_params:
hostname: IAC-EWLC-Claimed
device_info:
- serial_number: FOX2639PAY7
hostname: WLC
state: Unclaimed
pid: C9800-CL-K9
gateway: 204.192.101.1
ipInterfaceName: TenGigabitEthernet0/0/0
staticIP: 204.192.101.10
subnetMask: 255.255.255.0
vlanId: 1101
ip_interface_name: TenGigabitEthernet0/0/0
static_ip: 204.192.101.10
subnet_mask: 255.255.255.0
vlan_id: 1101

- name: Delete an added device from the Pnp dashboard
- name: Delete multiple devices from the Pnp dashboard #If device is not present it won't fail
cisco.dnac.pnp_intent:
<<: *dnac_login
dnac_log: True
state: deleted
config:
- deviceInfo:
serialNumber: FJC2330E0IK
- device_info:
- serial_number: FKC2310E0HK
- serial_number: FTC2320E0HA
- serial_number: FKC2310E0HB
Loading

0 comments on commit e038f97

Please sign in to comment.