Cope better with no rack information
parent
ee0620612b
commit
2617f6bdfe
|
|
@ -250,7 +250,15 @@ interfaces {
|
||||||
|
|
||||||
{% macro snmpsection(device, snmp) %}
|
{% macro snmpsection(device, snmp) %}
|
||||||
snmp {
|
snmp {
|
||||||
|
{% if device.rack and device.rack.site %}
|
||||||
location "{{ device.rack.site.name }} Rack {{ device.rack.name }}";
|
location "{{ device.rack.site.name }} Rack {{ device.rack.name }}";
|
||||||
|
{% elif device.rack and device.site %}
|
||||||
|
location "{{ device.site.name }} Rack {{ device.rack.name }}";
|
||||||
|
{% elif device.site %}
|
||||||
|
location "{{ device.site.name }}"
|
||||||
|
{% elif device.rack %}
|
||||||
|
location "{{ device.rack.name }}"
|
||||||
|
{% endif %}
|
||||||
contact "{{ snmp['contact'] }}";
|
contact "{{ snmp['contact'] }}";
|
||||||
community {{ snmp['community'] }} {
|
community {{ snmp['community'] }} {
|
||||||
authorization read-only;
|
authorization read-only;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue