Skip to content

Commit 29cfee3

Browse files
authored
Merge pull request #24 from cisco-en-programmability/pnp-stack-renumbering-role-cvp-updates
Pnp stack renumbering role cvp updates
2 parents 0a479ee + d87b408 commit 29cfee3

4 files changed

Lines changed: 193 additions & 7 deletions

File tree

cvp/plug_and_play/README.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ Each item in the lists above (e.g., inside `claim_switching_devices`) typically
125125
| `image_name` | String | No | The name of the software image to provision. |
126126
| `template_params` | Dictionary | No | Variables required by the Jinja2 template (e.g., VLAN ID, IP). |
127127
| `device_info` | List | Yes | A list of specific devices to apply this configuration to. |
128+
| `license_level` | String | No | License level applied when claiming a Catalyst switch / stack switch. Valid values: `Cisco DNA Essentials`, `Cisco DNA Advantage`. Most commonly used with `pnp_type: Default` or `pnp_type: StackSwitch`. |
129+
| `top_of_stack_serial_number` | String | No | Serial number of the switch to designate as top-of-stack (Member 1 / Active) during stack renumbering. Must match a `serial_number` under `device_info`. Applicable only when `pnp_type: StackSwitch`. |
130+
| `cabling_scheme` | Enum | No | Physical cabling topology of the Catalyst stack. Accepted values are `1A` and `1B`. Applicable only when `pnp_type: StackSwitch`. |
128131

129132
#### Device Info Object
130133

@@ -137,6 +140,9 @@ The `device_info` list contains the specific identity of the physical devices.
137140
| `hostname` | String | No | The hostname to assign or identify the device. |
138141
| `state` | Enum | No | Expected state (e.g., `Unclaimed`, `Claimed`, `Provisioned`). |
139142
| `authorize` | Boolean | No | **(v2.3.7.9+)** **Galaxy version 6.42.0+** Auto-authorize device if in `Pending Authorization` state. |
143+
| `is_sudi_required` | Boolean | No | SUDI authentication requirement flag (sent as `sudiRequired`). When `true`, `user_sudi_serial_nos` is required. |
144+
| `user_sudi_serial_nos` | List | No | List of SUDI serial numbers used for SUDI authorization. Required when `is_sudi_required` is `true`. For stack devices, include all stack member SUDI serial numbers. |
145+
| `is_stack_device` | Boolean | No | Set to `true` if the device is a stack device. Only applies when `pnp_type` is `Default` or `StackSwitch`; ignored for `AccessPoint` and `CatalystWLC`. Defaults to `false`. |
140146

141147

142148
## Example Input File
@@ -186,14 +192,36 @@ pnp_details:
186192
pid: C9300-48T
187193
```
188194

189-
### 3. Claim Switch Stack
195+
### 3. Switch Stack (Add then Claim with Stack Renumbering)
190196

191-
Onboard a Cisco Catalyst 9K switch stack by specifying `pnp_type: StackSwitch`.
197+
Dedicated end-to-end example for a Cisco Catalyst 9K switch **stack**. The CVP
198+
playbook processes `network_devices` (ADD) before `claim_switching_devices`
199+
(CLAIM), so this single vars file both adds the stack to PnP and then claims it
200+
to a site as `pnp_type: StackSwitch`.
201+
202+
Stack-specific fields:
203+
204+
- `is_stack_device: true` marks the device as a stack member (sent to the API as `stack`).
205+
- `top_of_stack_serial_number` designates which member becomes stack Member 1 / Active (stack renumbering).
206+
- `cabling_scheme` (`1A` or `1B`) describes the physical stack cabling topology.
207+
- `license_level` sets the license applied at claim time.
208+
- Add `is_sudi_required: true` with `user_sudi_serial_nos` (all stack member SUDI serials) only when SUDI authorization is required.
192209

193210
```yaml
194211
---
195-
catalystcenter_version: 2.3.7.6
212+
catalystcenter_version: 2.3.7.9
196213
pnp_details:
214+
# Phase 1: ADD the stack device to PnP (Unclaimed)
215+
network_devices:
216+
- device_info:
217+
- serial_number: FJC271925Q1
218+
hostname: NY-EN-9300
219+
state: Unclaimed
220+
pid: C9300-48UXM
221+
is_sudi_required: false
222+
is_stack_device: true
223+
224+
# Phase 2: CLAIM the stack device as StackSwitch (stack renumbering)
197225
claim_switching_devices:
198226
- site_name: Global/USA/New York/NY_BLD1
199227
project_name: Onboarding Configuration
@@ -202,13 +230,50 @@ pnp_details:
202230
template_params:
203231
PNP_VLAN_ID: 2005
204232
LOOPBACK_IP: 204.1.2.2
233+
pnp_type: StackSwitch
234+
license_level: "Cisco DNA Advantage"
235+
top_of_stack_serial_number: FJC271925Q1
236+
cabling_scheme: 1B
205237
device_info:
206238
- serial_number: FJC271925Q1
207239
hostname: NY-EN-9300
208240
state: Unclaimed
209241
pid: C9300-48UXM
242+
is_stack_device: true
243+
```
244+
245+
> **Stack renumbering:** `top_of_stack_serial_number` and `cabling_scheme` apply only when `pnp_type: StackSwitch`. `license_level` accepts `Cisco DNA Essentials` or `Cisco DNA Advantage`.
246+
247+
#### Switch Stack with SUDI Authorization
248+
249+
When SUDI authorization is required, set `is_sudi_required: true` and list **every
250+
stack member serial number** in `user_sudi_serial_nos` (sent to the API as
251+
`userSudiSerialNos`).
252+
253+
```yaml
254+
---
255+
catalystcenter_version: 2.3.7.9
256+
pnp_details:
257+
claim_switching_devices:
258+
- site_name: Global/USA/New York/NY_BLD1
259+
project_name: Onboarding Configuration
210260
pnp_type: StackSwitch
261+
license_level: "Cisco DNA Advantage"
262+
top_of_stack_serial_number: FJC271925Q1
263+
cabling_scheme: 1B
264+
device_info:
265+
- serial_number: FJC271925Q1
266+
hostname: NY-EN-9300
267+
state: Unclaimed
268+
pid: C9300-48UXM
269+
is_stack_device: true
270+
is_sudi_required: true
271+
user_sudi_serial_nos:
272+
- FJC271925Q1
273+
- FJC271925Q2
274+
- FJC271925Q3
211275
```
276+
212277
### 4. Claim Router Device
213278

214279
Onboard a Cisco router with appropriate template and image.
@@ -869,4 +934,3 @@ Use either of these forms:
869934

870935
- Relative to the playbook: `../vars/catalyst_center_pnp_vars.yml`
871936
- Fully resolved from the repo root: `${PWD}/cvp/plug_and_play/vars/catalyst_center_pnp_vars.yml`
872-

cvp/plug_and_play/schema/plug_and_play_schema.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ claim_switching_device_type:
9393
state: enum('merged', 'deleted', required=False)
9494
device_info: list(include('device_info_type'), required=True)
9595
pnp_type: enum('Default', 'StackSwitch', required=False)
96+
license_level: str(required=False)
97+
top_of_stack_serial_number: str(required=False)
98+
cabling_scheme: enum('1A', '1B', required=False)
9699

97100
claim_router_device_type:
98101
site_name: str(required=False)
@@ -104,6 +107,7 @@ claim_router_device_type:
104107
state: enum('merged', 'deleted', required=False)
105108
device_info: list(include('device_info_type'), required=True)
106109
pnp_type: enum('Default', required=False)
110+
license_level: str(required=False)
107111

108112
device_info_type:
109113
serial_number: str(required=True)
@@ -112,6 +116,8 @@ device_info_type:
112116
pid: str(required=False)
113117
authorize: bool(required=False)
114118
is_sudi_required: bool(required=False)
119+
user_sudi_serial_nos: list(str(), min=0, max=10000, required=False)
120+
is_stack_device: bool(required=False)
115121

116122
network_devices_type:
117123
device_info: list(include('device_info_type'), required=True)

cvp/plug_and_play/vars/catalyst_center_pnp_vars.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ pnp_details:
4141
state: Unclaimed
4242
pid: C9300-48T
4343

44-
# DUPLICATE KEY - REMOVED: claim_switching_devices:
45-
- site_name: Global/USA/New York/NY_BLD1
44+
- site_name: Global/USA/New York/NY_BLD1
4645
project_name: Onboarding Configuration
4746
template_name: PnP-Devices-SW
4847
image_name: cat9k_iosxe.17.12.02.SPA.bin
@@ -54,7 +53,16 @@ pnp_details:
5453
hostname: NY-EN-9300
5554
state: Unclaimed
5655
pid: C9300-48UXM
56+
is_sudi_required: true
57+
user_sudi_serial_nos:
58+
- FJC271925Q1
59+
- FJC271925Q2
60+
- FJC271925Q3
61+
is_stack_device: true
5762
pnp_type: StackSwitch
63+
license_level: "Cisco DNA Advantage"
64+
top_of_stack_serial_number: FJC271925Q1
65+
cabling_scheme: 1B
5866

5967
claim_wireless_controllers:
6068
- site_name: Global/USA/SAN JOSE/SJ_BLD23
@@ -118,4 +126,4 @@ pnp_details:
118126
- serial_number: FXS2502Q2HC
119127
hostname: SF-BN-2-ASR.cisco.local
120128
state: Unclaimed
121-
pid: ASR1001-X
129+
pid: ASR1001-X

roles/pnp/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ This role manages Plug and Play (PnP) in Cisco Catalyst Center using the `pnp_wo
3232
- `pnp_config_verify`: Verify configuration after applying (default: `false`)
3333
- `pnp_config`: List of PnP configurations (required)
3434

35+
#### Key `pnp_config` Fields
36+
Each item in `pnp_config` is passed directly to the `pnp_workflow_manager` module. Commonly used fields:
37+
38+
- `site_name`: Site hierarchy to claim the device to.
39+
- `project_name` / `template_name` / `template_params`: Onboarding template details.
40+
- `image_name` / `golden_image`: Software image to provision.
41+
- `pnp_type`: `Default`, `CatalystWLC`, `AccessPoint`, or `StackSwitch`.
42+
- `license_level`: License level applied when claiming a switch / stack switch. Valid values: `Cisco DNA Essentials`, `Cisco DNA Advantage`.
43+
- `top_of_stack_serial_number`: Serial number designated as top-of-stack (Member 1 / Active) for stack renumbering. Applicable only when `pnp_type: StackSwitch`.
44+
- `cabling_scheme`: Physical cabling topology of the stack. Accepted values: `1A`, `1B`. Applicable only when `pnp_type: StackSwitch`.
45+
- `device_info[].is_sudi_required`: Enable SUDI authentication. Requires `user_sudi_serial_nos`.
46+
- `device_info[].user_sudi_serial_nos`: List of SUDI serial numbers (include all stack member serials for stacks).
47+
- `device_info[].is_stack_device`: Set `true` for stack devices (`Default`/`StackSwitch` only). Defaults to `false`.
48+
- `device_info[].authorize`: Auto-authorize devices in `Pending Authorization` state (Catalyst Center 2.3.7.9+).
49+
3550
## Dependencies
3651

3752
None
@@ -110,6 +125,99 @@ These examples are adapted from the workflow documentation and example assets in
110125
pid: ASR1001-X
111126
```
112127

128+
### Example 3: Switch Stack - Add then Claim with Stack Renumbering
129+
130+
Dedicated end-to-end stack example. The first play **adds** the stack device to
131+
PnP (Unclaimed); the second play **claims** it as `pnp_type: StackSwitch`,
132+
applying the license and stack-renumbering fields.
133+
134+
Stack-specific fields: `is_stack_device` (sent as `stack`),
135+
`top_of_stack_serial_number` (designates stack Member 1 / Active),
136+
`cabling_scheme` (`1A`/`1B`), and `license_level`. Use `is_sudi_required` with
137+
`user_sudi_serial_nos` only when SUDI authorization is required.
138+
139+
```yaml
140+
# Play 1: ADD the stack device to PnP (Unclaimed)
141+
- hosts: localhost
142+
roles:
143+
- role: pnp
144+
vars:
145+
catalystcenter_host: "{{ vault_catalystcenter_host }}"
146+
catalystcenter_username: "{{ vault_catalystcenter_username }}"
147+
catalystcenter_password: "{{ vault_catalystcenter_password }}"
148+
pnp_state: "merged"
149+
pnp_config:
150+
- device_info:
151+
- serial_number: FJC271925Q1
152+
hostname: NY-EN-9300
153+
state: Unclaimed
154+
pid: C9300-48UXM
155+
is_sudi_required: false
156+
is_stack_device: true
157+
158+
# Play 2: CLAIM the stack device as StackSwitch (stack renumbering)
159+
- hosts: localhost
160+
roles:
161+
- role: pnp
162+
vars:
163+
catalystcenter_host: "{{ vault_catalystcenter_host }}"
164+
catalystcenter_username: "{{ vault_catalystcenter_username }}"
165+
catalystcenter_password: "{{ vault_catalystcenter_password }}"
166+
pnp_state: "merged"
167+
pnp_config:
168+
- site_name: Global/USA/New York/NY_BLD1
169+
project_name: Onboarding Configuration
170+
template_name: PnP-Devices-SW
171+
image_name: cat9k_iosxe.17.12.02.SPA.bin
172+
pnp_type: StackSwitch
173+
license_level: "Cisco DNA Advantage"
174+
top_of_stack_serial_number: FJC271925Q1
175+
cabling_scheme: 1B
176+
device_info:
177+
- serial_number: FJC271925Q1
178+
hostname: NY-EN-9300
179+
state: Unclaimed
180+
pid: C9300-48UXM
181+
is_stack_device: true
182+
```
183+
184+
> `license_level` accepts the Catalyst Center values `Cisco DNA Essentials` and `Cisco DNA Advantage`.
185+
186+
#### Switch Stack with SUDI Authorization
187+
188+
When SUDI authorization is required, set `is_sudi_required: true` and list **every
189+
stack member serial number** in `user_sudi_serial_nos` (sent to the API as
190+
`userSudiSerialNos`).
191+
192+
```yaml
193+
- hosts: localhost
194+
roles:
195+
- role: pnp
196+
vars:
197+
catalystcenter_host: "{{ vault_catalystcenter_host }}"
198+
catalystcenter_username: "{{ vault_catalystcenter_username }}"
199+
catalystcenter_password: "{{ vault_catalystcenter_password }}"
200+
pnp_state: "merged"
201+
pnp_config:
202+
- site_name: Global/USA/New York/NY_BLD1
203+
project_name: Onboarding Configuration
204+
pnp_type: StackSwitch
205+
license_level: "Cisco DNA Advantage"
206+
top_of_stack_serial_number: FJC271925Q1
207+
cabling_scheme: 1B
208+
device_info:
209+
- serial_number: FJC271925Q1
210+
hostname: NY-EN-9300
211+
state: Unclaimed
212+
pid: C9300-48UXM
213+
is_stack_device: true
214+
is_sudi_required: true
215+
user_sudi_serial_nos:
216+
- FJC271925Q1
217+
- FJC271925Q2
218+
- FJC271925Q3
219+
```
220+
113221
<!-- END WORKFLOW README ENHANCEMENTS -->
114222

115223
## License

0 commit comments

Comments
 (0)