kayobe/ansible/roles/junos-switch/templates/junos-config-set.j2
Mark Goddard 8182d7f1fe Remove unnecessary comma from JunOS switch config
This was being appended to port descriptions.
2017-08-10 16:40:26 +00:00

21 lines
605 B
Django/Jinja

#jinja2: trim_blocks: True,lstrip_blocks: True
{% for line in junos_switch_config %}
{{ line }}
{% endfor %}
{% for interface, config in junos_switch_interface_config.items() %}
{% if config.description is defined %}
set interfaces {{ interface }} description "{{ config.description }}"
{% endif %}
{% for line in config.config %}
{% if line.startswith('set') %}
set interfaces {{ interface }} {{ line[4:] }}
{% elif line.startswith('delete') %}
delete interfaces {{ interface }} {{ line[7:] }}
{% else %}
{{ interface_config_lines_must_start_with_set_or_delete }}
{% endif %}
{% endfor %}
{% endfor %}