2020-11-07 12:30:41 -06:00
|
|
|
{% set mgmt_if = {} %}
|
2018-03-20 13:25:31 -05:00
|
|
|
{% if MGMT_INTERFACE %}
|
2020-11-07 12:30:41 -06:00
|
|
|
{% for (mgmt_name, mgmt_prefix) in MGMT_INTERFACE|pfx_filter %}
|
|
|
|
{% if mgmt_prefix|ipv4 %}
|
|
|
|
{% if mgmt_if.update({'port_name' : mgmt_name}) %} {% endif %}
|
|
|
|
{% if mgmt_if.update({'ipv4' : mgmt_prefix|ip}) %} {% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% if mgmt_if %}
|
2019-01-15 13:27:46 -06:00
|
|
|
{# If MGMT port alias is available, use it for port ID subtype, otherwise use port name #}
|
2020-11-07 12:30:41 -06:00
|
|
|
{% if MGMT_PORT and MGMT_PORT[mgmt_if.port_name] and MGMT_PORT[mgmt_if.port_name].alias %}
|
|
|
|
configure ports eth0 lldp portidsubtype local {{ MGMT_PORT[mgmt_if.port_name].alias }}
|
2019-01-15 13:27:46 -06:00
|
|
|
{% else %}
|
2020-11-07 12:30:41 -06:00
|
|
|
configure ports eth0 lldp portidsubtype local {{ mgmt_if.port_name }}
|
2019-01-15 13:27:46 -06:00
|
|
|
{% endif %}
|
2020-11-07 12:30:41 -06:00
|
|
|
configure system ip management pattern {{ mgmt_if.ipv4 }}
|
2018-03-20 13:25:31 -05:00
|
|
|
{% endif %}
|
2019-02-12 03:40:51 -06:00
|
|
|
configure system hostname {{ DEVICE_METADATA['localhost']['hostname'] }}
|
2020-10-26 12:38:09 -05:00
|
|
|
{# pause lldpd operations until all interfaces are well configured, resume command will run in lldpmgrd #}
|
|
|
|
pause
|