kayobe/ansible/roles/nclu-switch/templates/nclu-config.j2
Michal Nasiadka cfb5c004ea nclu-switch: Fix order in template
Currently description is applied first to the interface, but if it's a
virtual one - it won't exist before running the configuration commands.

Story: 2010279
Task: 46232

Change-Id: I40212b40a4d391272f4063f42e8a7043b3d58fd7
2022-09-08 11:33:33 +02:00

14 lines
450 B
Django/Jinja

#jinja2: trim_blocks: True,lstrip_blocks: True
{% for line in nclu_switch_config %}
{{ line }}
{% endfor %}
{% for interface, config in nclu_switch_interface_config.items() %}
{% for line in config.config %}
add {{ config.type | default("interface") }} {{ interface }} {{ line }}
{% endfor %}
{% if config.description is defined %}
add {{ config.type | default("interface") }} {{ interface }} alias {{ config.description }}
{% endif %}
{% endfor %}