]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
(dhcp::server and associated erb) updated documentation and template
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>
Fri, 5 Nov 2010 13:47:31 +0000 (14:47 +0100)
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>
Fri, 5 Nov 2010 13:47:31 +0000 (14:47 +0100)
manifests/classes/dhcp-server.pp
templates/dhcpd.conf.debian.erb

index f0efea082b7d496475fb479c2d8c37983f52aaeb..b9a36efe95b749444a56f4bd4f46b1cba0df6d91 100644 (file)
@@ -6,33 +6,27 @@ Simple OS wrapper. Include this to install a dhcp server on your host.
 Requires:
   module "common": git://github.com/camptocamp/puppet-common.git
 
-Required arguments:
-  *$dhcpd_domain_name*: domain-name option
-  *$dhcpd_dns_servers*: domain-name-servers option
-
 facultative argument:
-  *$dhcpd_ddns_update*: ddns-update-style option
-  *$dhcpd_ddns_authoritative*: set it if you want that your DHCP server is authoritative
+  *$dhcpd_ddns_update*        : ddns-update-style option (default to none)
+  *$dhcpd_authoritative* : set it if you want that your DHCP server is authoritative (default to no)
+  *$dhcpd_opts*               : any other DHCPD valid options
 
 Example:
 node "dhcp.toto.ltd" {
-  $dhcpd_domain_name = 'toto.ltd'
-  $dhcpd_dns_servers = '192.168.21.1'
+  $dhcpd_opts = ['domain-name "toto.ltd"', "domain-name-servers 192.168.21.1"]
   include dhcp::server
   
-  dhcp::subnet {"192.168.20.0":
-    ensure => present,
-    bcast => "192.168.20.255",
-    dns   => "192.168.21.1, 10.26.22.1",
-    other_opt => ['filename "pxelinux.0";', 'next-server 192.168.10.1;'],
-    inc   => true,
+  dhcp::subnet {"10.27.20.0":
+    ensure     => present,
+    broadcast  => "10.27.20.255",
+    other_opts => ['filename "pxelinux.0";', 'next-server 10.27.10.1;'],
   }
 
   dhcp::host {"titi-eth0":
     ensure => present,
     mac    => "0e:18:fa:fe:d9:00",
-    subnet => "192.168.20.0",
-    fixed_address => "192.168.10.52",
+    subnet => "10.27.20.0",
+    fixed_address => "10.27.10.52",
   }
 }
 */
index 8cd31833851be1d32f6cdc5ebf781474482e5f13..7606c0c6d034b49cf09e20e9e209791cd3f44c11 100644 (file)
@@ -10,13 +10,6 @@ ddns-update-style <%=dhcpd_ddns_update%>;
 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_authoritative') -%>
@@ -25,6 +18,10 @@ authoritative;
 #authoritative;
 <% end -%>
 
+<% if dhcpd_opts and not dhcpd_opts.empty? -%>
+<%= dhcpd_opts.collect! {|i| "#{i}" }.join(";\n") %>
+<% 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;