aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/netbox/scripts/create-switch/create-switch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/netbox/scripts/create-switch/create-switch.py b/tools/netbox/scripts/create-switch/create-switch.py
index 6c442e1..4945013 100644
--- a/tools/netbox/scripts/create-switch/create-switch.py
+++ b/tools/netbox/scripts/create-switch/create-switch.py
@@ -9,6 +9,8 @@ from ipam.models import IPAddress, Prefix, VLAN, VLANGroup
# Used for getting existing types/objects from Netbox.
DISTRIBUTION_SWITCH_DEVICE_ROLE = 'distribution-switch' # match the name or the slug
+ROUTER_DEVICE_ROLE = 'router'
+CORE_DEVICE_ROLE = 'core'
ACCESS_SWITCH_DEVICE_ROLE = DeviceRole.objects.get(name='Access Switch')
DEFAULT_SITE = Site.objects.first() # TODO: pick default site ?
@@ -40,7 +42,7 @@ class CreateSwitch(Script):
description = "Destination/uplink",
model=Device,
query_params={
- 'role': DISTRIBUTION_SWITCH_DEVICE_ROLE,
+ 'role': [DISTRIBUTION_SWITCH_DEVICE_ROLE, ROUTER_DEVICE_ROLE, CORE_DEVICE_ROLE],
},
)
destination_interfaces = MultiObjectVar(