From 1b1650c86cc9ca0616d06721b29630747a930d0f Mon Sep 17 00:00:00 2001 From: Cédric Jeanneret Date: Fri, 5 Nov 2010 14:48:26 +0100 Subject: (dhcp::subnet and associated tmpl) updated documentation and removed many options I decided to remove many options of the definition, and to replace them with a single array. --- templates/subnet.conf.erb | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'templates') diff --git a/templates/subnet.conf.erb b/templates/subnet.conf.erb index a0a9d29..c7c690d 100644 --- a/templates/subnet.conf.erb +++ b/templates/subnet.conf.erb @@ -5,35 +5,26 @@ subnet <%=name%> netmask <%=netmask%> { <% else -%> subnet <%=name%> netmask <%=netmask_eth0%> { <% end -%> -<% if routeurs -%> - option routers <%=routeurs%>; +<% if routers and not routers.empty? -%> + option routers routers.collect! {|i| "#{i}" }.join(","); <% else -%> option routers <%=network_eth0%>; <% end -%> <% if subnet_mask -%> option subnet-mask <%=subnet_mask%>; -<% else -%> +<% else if netmask -%> option subnet-mask <%=netmask%>; +<% else -%> + option subnet-mask <%=netmask_eth0%>; <% end -%> - option broadcast-address <%=bcast%>; - option domain-name-servers <%=dns%>; + option broadcast-address <%=broadcast%>; <% if domain_name -%> option domain-name "<%=domain_name%>"; <% else -%> option domain-name "<%=domain%>"; <% end -%> -<% if netbios_dns -%> - option netbios-name-servers <%=netbios_dns%>; -<% else -%> - option netbios-name-servers <%=network_eth0%>; -<% end -%> -<% if deny -%> - deny <%=deny%>; -<% end -%> -<% if inc -%> include "<%=to_inc%>"; +<% if other_opts and not other_opts.empty? -%> +<%= other_opts.collect! {|i| " #{i}" }.join(";\n") %> <% end -%> -<% if other_opt and not other_opt.empty? -%> -<%= other_opt.collect! {|i| " #{i}" }.join("\n") -%> -<% end %> } -- cgit v1.2.3