Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
nexbox
NetBox Backend Scripts
Commits
b595b26d
Commit
b595b26d
authored
Jan 13, 2020
by
Adrian
Browse files
aruba: add bridge connection if necessary
parent
670d3a9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
aruba.py
View file @
b595b26d
...
...
@@ -61,6 +61,9 @@ class AddArubaAp(Script):
ap
.
save
()
self
.
log_success
(
"Created new Aruba AP: {}"
.
format
(
ap
.
name
))
if
(
self
.
ap_type_requires_uplink_passthrough_bridge
(
data
[
'ap_type'
])):
self
.
bridge_uplink_via_passthrough
(
ap
)
ap_main_iface
=
Interface
.
objects
.
get
(
device
=
ap
,
name
=
'E0'
)
ap_main_iface
.
mac_address
=
data
[
'ap_mac'
]
ap_main_iface
.
iface_mode
=
IFACE_MODE_ACCESS
...
...
@@ -78,3 +81,20 @@ class AddArubaAp(Script):
ap
.
primary_ip4
=
ap_ip
ap
.
save
()
self
.
log_success
(
"Assigned primary IP to AP"
)
def
ap_type_requires_uplink_passthrough_bridge
(
self
,
ap_type
):
if
(
ap_type
.
model
==
"AP-205H"
):
return
True
return
False
def
bridge_uplink_via_passthrough
(
self
,
ap
):
ap_uplink
=
Interface
.
objects
.
get
(
device
=
ap
,
name
=
'E0'
)
ap_passthrough_rear
=
RearPort
.
objects
.
get
(
device
=
ap
,
name
=
'PT'
)
conn
=
Cable
(
termination_a
=
ap_uplink
,
termination_b
=
ap_passthrough_rear
,
label
=
"Uplink passthrough bridge"
)
conn
.
save
()
self
.
log_info
(
"Automatically added Uplink-Passthrough bridge connection"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment