aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/dhcpd.conf.squeeze.erb31
-rw-r--r--templates/host.conf.erb8
-rw-r--r--templates/subnet.conf.erb39
3 files changed, 78 insertions, 0 deletions
diff --git a/templates/dhcpd.conf.squeeze.erb b/templates/dhcpd.conf.squeeze.erb
new file mode 100644
index 0000000..865c04c
--- /dev/null
+++ b/templates/dhcpd.conf.squeeze.erb
@@ -0,0 +1,31 @@
+# File managed by puppet
+
+# The ddns-updates-style parameter controls whether or not the server will
+# attempt to do a DNS update when a lease is confirmed. We default to the
+# behavior of the version 2 packages ('none', since DHCP v2 didn't
+# have support for DDNS.)
+<% if has_variable?('dhcpd_ddns_update') -%>
+ddns-update-style <%=dhcpd_ddns_update%>;
+<% else -%>
+ddns-update-style none;
+<% end -%>
+
+# option definitions common to all supported networks...
+option domain-name "<%=dhcpd_domain_name%>";
+option domain-name-servers <%=dhcpd_dns_servers%>;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+<% if has_variable?('dhcpd_ddns_authoritative') -%>
+authoritative;
+<% else -%>
+#authoritative;
+<% end -%>
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
diff --git a/templates/host.conf.erb b/templates/host.conf.erb
new file mode 100644
index 0000000..2cdb4af
--- /dev/null
+++ b/templates/host.conf.erb
@@ -0,0 +1,8 @@
+host <%=name%> {
+ hardware ethernet <%=mac%>;
+<% if fixed_address -%>
+ fixed-address <%=fixed_address%>;
+<% else -%>
+ fixed-address <%=name%>;
+<% end -%>
+}
diff --git a/templates/subnet.conf.erb b/templates/subnet.conf.erb
new file mode 100644
index 0000000..a0a9d29
--- /dev/null
+++ b/templates/subnet.conf.erb
@@ -0,0 +1,39 @@
+# File managed by puppet
+
+<% if netmask -%>
+subnet <%=name%> netmask <%=netmask%> {
+<% else -%>
+subnet <%=name%> netmask <%=netmask_eth0%> {
+<% end -%>
+<% if routeurs -%>
+ option routers <%=routeurs%>;
+<% else -%>
+ option routers <%=network_eth0%>;
+<% end -%>
+<% if subnet_mask -%>
+ option subnet-mask <%=subnet_mask%>;
+<% else -%>
+ option subnet-mask <%=netmask%>;
+<% end -%>
+ option broadcast-address <%=bcast%>;
+ option domain-name-servers <%=dns%>;
+<% 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%>";
+<% end -%>
+<% if other_opt and not other_opt.empty? -%>
+<%= other_opt.collect! {|i| " #{i}" }.join("\n") -%>
+<% end %>
+}