subnet
diff --git a/files/dhcpd.pool b/files/dhcpd.pool
deleted file mode 100644
index d6df787..0000000
--- a/files/dhcpd.pool
+++ /dev/null
@@ -1,20 +0,0 @@
-#################################
-# <%= @name %>
-#################################
-subnet <%= @network %> netmask <%= @mask %> {
-<% if @range -%>
- pool
- {
- range <%= @range %>;
- }
-<% end -%>
-
- option subnet-mask <%= @mask %>;
-<% if @gateway -%>
- option routers <%= @gateway %>;
-<% end -%>
-<% if @pxeserver -%>
- next-server <%= @pxeserver %>;
-<% end -%>
-}
-
diff --git a/files/dhcpd.subnets b/files/dhcpd.subnets
new file mode 100644
index 0000000..6160b2b
--- /dev/null
+++ b/files/dhcpd.subnets
@@ -0,0 +1,20 @@
+{%- for subnet_name, subnet in server.subnet.iteritems() %}
+
+subnet {{ subnet.network }} netmask {{ subnet.netmask }} {
+ {%- if subnet.range is defined %}
+ pool
+ {
+ range {{ subnet.range }};
+ }
+ {%- endif %}
+
+ option subnet-mask {{ subnet.netmask }};
+ {%- if subnet.gateway is defined %}
+ option routers {{ subnet.gateway }};
+ {%- endif %}
+ {%- if subnet.pxeserver is defined %}
+ next-server {{ subnet.pxeserver }};
+ {%- endif %}
+}
+
+{%- endfor %}
\ No newline at end of file