-
-
Save QuinnyPig/2d5cc0ed33923951f398 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
Pillar says: | |
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 | |
Templated file says: | |
{%- for vlan in pillar['vlans'] %} | |
subnet {{ pillar[vlan.network] }} netmask {{ pillar[vlan.netmask] }} { | |
option routers {{ pillar[vlan.gateway] }}; | |
option subnet-mask {{ pillar[vlan.netmask] }}; | |
range {{ pillar[vlan.prefix] }}.200 {{ pillar[vlan.prefix] }}.240; | |
default-lease-time 1200; | |
max-lease-time 2400; | |
} | |
{%- endfor %} | |
Salt says: | |
ID: /etc/dhcp/dhcpd.conf | |
Function: file.managed | |
Result: False | |
Comment: Unable to manage file: Jinja variable 'dict' object has no attribute '10.20.0.0'; line 62 | |
--- | |
[...] | |
} | |
{%- for vlan in pillar['vlans'] %} | |
subnet {{ pillar[vlan.network] }} netmask {{ pillar[vlan.netmask] }} { | |
option routers {{ pillar[vlan.gateway] }}; | |
option subnet-mask {{ pillar[vlan.netmask] }}; <====================== | |
default-lease-time 1200; | |
max-lease-time 2400; | |
} | |
{%- endfor %} | |
--- | |
Changes: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment