Skip to content

Commit 13b9628

Browse files
author
mhamroz
committed
Added Fabric EWLC functionality
1 parent 5bfa288 commit 13b9628

3 files changed

Lines changed: 90 additions & 1 deletion

File tree

cc_fabric.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ resource "catalystcenter_fabric_device" "wireless_controller" {
307307
}
308308

309309
resource "catalystcenter_fabric_device" "edge_device" {
310-
for_each = { for device in try(local.catalyst_center.inventory.devices, []) : device.name => device if strcontains(device.state, "PROVISION") && !contains(try(device.fabric_roles, []), "BORDER_NODE") && try(device.fabric_roles, null) != null && contains(try(device.fabric_roles, []), "EDGE_NODE") && contains(local.sites, try(device.fabric_site, "NONE")) }
310+
for_each = { for device in try(local.catalyst_center.inventory.devices, []) : device.name => device if strcontains(device.state, "PROVISION") && !contains(try(device.fabric_roles, []), "BORDER_NODE") && try(device.fabric_roles, null) != null && contains(try(device.fabric_roles, []), "EDGE_NODE") && !contains(try(device.fabric_roles, []), "EWLC") && contains(local.sites, try(device.fabric_site, "NONE")) }
311311

312312
network_device_id = coalesce(
313313
try(lookup(local.device_name_to_id, each.value.name, null), null),
@@ -320,6 +320,22 @@ resource "catalystcenter_fabric_device" "edge_device" {
320320
depends_on = [catalystcenter_device_role.role, catalystcenter_provision_devices.provision_devices, catalystcenter_provision_device.provision_device, catalystcenter_fabric_device.border_device]
321321
}
322322

323+
resource "catalystcenter_fabric_ewlc" "ewlc_device" {
324+
for_each = { for device in try(local.catalyst_center.inventory.devices, []) : device.name => device if strcontains(device.state, "PROVISION") && contains(try(device.fabric_roles, []), "EWLC") && contains(local.sites, try(device.fabric_site, "NONE")) }
325+
326+
network_device_id = coalesce(
327+
try(lookup(local.device_name_to_id, each.value.name, null), null),
328+
try(lookup(local.device_name_to_id, each.value.fqdn_name, null), null),
329+
try(lookup(local.device_ip_to_id, each.value.device_ip, null), null)
330+
)
331+
fabric_id = try(catalystcenter_fabric_zone.fabric_zone[each.value.fabric_zone].id, catalystcenter_fabric_site.fabric_site[each.value.fabric_site].id, null)
332+
enable_wireless = try(each.value.enable_wireless, local.defaults.catalyst_center.inventory.devices.enable_wireless, true)
333+
enable_rolling_ap_upgrade = try(each.value.enable_rolling_ap_upgrade, local.defaults.catalyst_center.inventory.devices.enable_rolling_ap_upgrade, false)
334+
ap_reboot_percentage = try(each.value.ap_reboot_percentage, local.defaults.catalyst_center.inventory.devices.ap_reboot_percentage, 25)
335+
336+
depends_on = [catalystcenter_device_role.role, catalystcenter_provision_devices.provision_devices, catalystcenter_provision_device.provision_device, catalystcenter_fabric_device.border_device]
337+
}
338+
323339
resource "catalystcenter_fabric_vlan_to_ssid" "vlan_to_ssid" {
324340
for_each = local.wireless_controllers ? { for site in try(local.catalyst_center.fabric.fabric_sites, []) : site.name => site if length(keys(catalystcenter_fabric_device.wireless_controller)) > 0 && length(try(site.wireless_ssids, [])) != 0 } : {}
325341

defaults/defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ defaults:
2727
inventory:
2828
devices:
2929
role_source: MANUAL
30+
enable_wireless: true
31+
enable_rolling_ap_upgrade: false
32+
ap_reboot_percentage: 25
3033
sites:
3134
areas:
3235
parent_name: Global

logs/pre_tool_use.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[
2+
{
3+
"session_id": "cbbe76d3-fe44-461a-b434-d3645c702581",
4+
"transcript_path": "/Users/mhamroz/.claude/projects/-Users-mhamroz-Desktop-CatCasCode/cbbe76d3-fe44-461a-b434-d3645c702581.jsonl",
5+
"cwd": "/Users/mhamroz/Desktop/CatCasCode/terraform-catalystcenter-nac-catalystcenter-mhamroz/terraform-catalystcenter-nac-catalystcenter",
6+
"permission_mode": "default",
7+
"hook_event_name": "PreToolUse",
8+
"tool_name": "Bash",
9+
"tool_input": {
10+
"command": "terraform init",
11+
"description": "Initialize Terraform configuration"
12+
}
13+
},
14+
{
15+
"session_id": "cbbe76d3-fe44-461a-b434-d3645c702581",
16+
"transcript_path": "/Users/mhamroz/.claude/projects/-Users-mhamroz-Desktop-CatCasCode/cbbe76d3-fe44-461a-b434-d3645c702581.jsonl",
17+
"cwd": "/Users/mhamroz/Desktop/CatCasCode/terraform-catalystcenter-nac-catalystcenter-mhamroz/terraform-catalystcenter-nac-catalystcenter",
18+
"permission_mode": "default",
19+
"hook_event_name": "PreToolUse",
20+
"tool_name": "Bash",
21+
"tool_input": {
22+
"command": "pwd",
23+
"description": "Show current working directory"
24+
}
25+
},
26+
{
27+
"session_id": "cbbe76d3-fe44-461a-b434-d3645c702581",
28+
"transcript_path": "/Users/mhamroz/.claude/projects/-Users-mhamroz-Desktop-CatCasCode/cbbe76d3-fe44-461a-b434-d3645c702581.jsonl",
29+
"cwd": "/Users/mhamroz/Desktop/CatCasCode/terraform-catalystcenter-nac-catalystcenter-mhamroz/terraform-catalystcenter-nac-catalystcenter",
30+
"permission_mode": "default",
31+
"hook_event_name": "PreToolUse",
32+
"tool_name": "Bash",
33+
"tool_input": {
34+
"command": "cd ..",
35+
"description": "Change to parent directory"
36+
}
37+
},
38+
{
39+
"session_id": "cbbe76d3-fe44-461a-b434-d3645c702581",
40+
"transcript_path": "/Users/mhamroz/.claude/projects/-Users-mhamroz-Desktop-CatCasCode/cbbe76d3-fe44-461a-b434-d3645c702581.jsonl",
41+
"cwd": "/Users/mhamroz/Desktop/CatCasCode/terraform-catalystcenter-nac-catalystcenter-mhamroz/terraform-catalystcenter-nac-catalystcenter",
42+
"permission_mode": "default",
43+
"hook_event_name": "PreToolUse",
44+
"tool_name": "TodoWrite",
45+
"tool_input": {
46+
"todos": [
47+
{
48+
"content": "Examine the data model in nac-catalystcenter-pod3/data",
49+
"status": "completed",
50+
"activeForm": "Examining the data model structure"
51+
},
52+
{
53+
"content": "Review existing cc_fabric.tf module structure",
54+
"status": "completed",
55+
"activeForm": "Reviewing existing fabric module"
56+
},
57+
{
58+
"content": "Analyze inventory device parsing patterns",
59+
"status": "completed",
60+
"activeForm": "Analyzing device parsing patterns"
61+
},
62+
{
63+
"content": "Implement catalystcenter_fabric_ewlc resource with EWLC fabric role filtering",
64+
"status": "completed",
65+
"activeForm": "Implementing EWLC fabric resource"
66+
}
67+
]
68+
}
69+
}
70+
]

0 commit comments

Comments
 (0)