sonic-buildimage/dockers/docker-lldp-sv2/lldpd.conf.j2
Guohan Lu 41bb13b834 configure the hostname for lldpd
Signed-off-by: Guohan Lu <gulv@microsoft.com>
2019-02-14 17:31:01 +00:00

13 lines
623 B
Django/Jinja

{% if MGMT_INTERFACE %}
{# If MGMT port alias is available, use it for port ID subtype, otherwise use port name #}
{% set mgmt_port_name = MGMT_INTERFACE.keys()[0][0] %}
{% set ipv4 = MGMT_INTERFACE.keys()[0][1].split('/')[0] %}
{% if MGMT_PORT and MGMT_PORT[mgmt_port_name] and MGMT_PORT[mgmt_port_name].alias %}
configure ports eth0 lldp portidsubtype local {{ MGMT_PORT[mgmt_port_name].alias }}
{% else %}
configure ports eth0 lldp portidsubtype local {{ mgmt_port_name }}
{% endif %}
configure system ip management pattern {{ ipv4 }}
{% endif %}
configure system hostname {{ DEVICE_METADATA['localhost']['hostname'] }}