Timotej Lazar
ce7903e43a
Remove separate NetBox lookups. Explicitly allow connections between cluster nodes. Tigthen temporary allowed IPv6 ranges.
16 lines
514 B
Python
16 lines
514 B
Python
#!/usr/bin/python
|
|
|
|
class FilterModule(object):
|
|
'''Various utilities for manipulating NetBox data'''
|
|
def filters(self):
|
|
return {
|
|
'device_address': self.device_address
|
|
}
|
|
|
|
def device_address(self, device):
|
|
'''Return loopback IP addresses for an L3 attached device'''
|
|
for iface in device['interfaces']:
|
|
for addr in iface['ip_addresses']:
|
|
if addr.get('role') and addr['role'].get('value') == 'loopback':
|
|
yield addr
|