Created
October 29, 2014 18:19
-
-
Save QuinnyPig/7128c2c9920a8406f8ae to your computer and use it in GitHub Desktop.
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
With Pillar data that looks like: | |
vlans: | |
id: | |
100: | |
network: | |
- 10.20.0.0 | |
netmask: | |
- 255.255.255.0 | |
prefix: | |
- 10.20.0 | |
gateway: | |
- 10.20.0.1 | |
id: | |
101: | |
network: | |
- 10.21.0.0 | |
netmask: | |
- 255.255.255.0 | |
prefix: | |
- 10.21.0 | |
gateway: | |
- 10.21.0.1 | |
What does this become: | |
{%- for vlan in grains.vlans %} | |
subnet {{ vlan.network }} netmask {{ vlan.netmask }} { | |
option routers {{ vlan.gateway }}; | |
option subnet-mask {{ vlan.netmask }}; | |
range {{ vlan.prefix }}.200 {{ vlan.prefix }}.240; | |
default-lease-time 1200; | |
max-lease-time 2400; | |
} | |
{%- endfor %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment