Last active
July 21, 2016 21:22
-
-
Save dgarros/d4b91123d1c053368fe0dad4929d40ea to your computer and use it in GitHub Desktop.
Create sub interface config for Junos using jinja2
This file contains 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
## Playbook file for Ansible | |
- name: Generate sub int Template | |
hosts: all | |
connection: local | |
gather_facts: no | |
tasks: | |
- name: Build sub interface | |
template: src=sub.j2 dest=./sub.conf |
This file contains 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
{% for i in range(0, 100 ) %} | |
{% set network = '172.16.0.0/16' | ipsubnet(24, i) %} | |
set interfaces xe-0/0/0 unit {{ i }} family inet address {{ network| ipaddr(1) | ipaddr('address') }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment