kayobe/ansible/roles/junos-switch/templates/junos-config.json.j2
Mark Goddard da82044a84 Updates to juniper switch configuration
Role renamed to junos-switch. Python dependencies are installed. Support for
multiple configuration types, including 'set', 'text', and 'json'.
2017-08-09 11:35:49 +00:00

13 lines
505 B
Django/Jinja

{% set config = junos_switch_interface_config %}
{% if junos_switch_interface_config %}
{% set _ = config.setdefault('interfaces', []) %}
{% endif %}
{% for interface, config in junos_switch_interface_config.items() %}
{% set _ = config['interfaces'].append({'name': interface}) %}
{% if config.description is defined %}
{% set config['interfaces'][-1]['description'] = config.description %}
{% endif %}
{% set _ = config['interfaces'][-1].update(config.config) %}
{% endif %}
{{ config | to_nice_json }}