Created
February 16, 2015 19:14
-
-
Save Mierdin/7843c3d48b8a3b185f5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interfaces { | |
{%- for intf in interfaces %} | |
{{ intf }} { | |
{% set items = interfaces[intf] %} | |
{% set NEEDS_TAGGING = False %} | |
{% for i in items %} | |
{% if i.vlan != 0 %} | |
{% set NEEDS_TAGGING = True %} | |
{% endif %} | |
{% endfor %} | |
description "created by ansible"; | |
{% if NEEDS_TAGGING == True %}vlan-tagging;{% endif %} | |
{% for i in items %} | |
unit {{ i.vlan }} { | |
description "vlan-{{ i.vlan }}"; | |
{% if i.vlan != 0 %}vlan-id {{ i.vlan }};{% endif %} | |
family { | |
inet { | |
address {{ i.ip_addr }}; | |
} | |
} | |
} | |
{% endfor %} | |
} | |
{%- endfor %} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment