diff options
author | Cédric Jeanneret <cedric.jeanneret@camptocamp.com> | 2010-11-05 14:48:26 +0100 |
---|---|---|
committer | Cédric Jeanneret <cedric.jeanneret@camptocamp.com> | 2010-11-05 14:48:26 +0100 |
commit | 1b1650c86cc9ca0616d06721b29630747a930d0f (patch) | |
tree | 794dc7f617055a2cbe4d4a296b610417361a46d7 /manifests | |
parent | 98407bfa96e8600d82abf24ef95d91a6ff911c4d (diff) | |
download | puppet-dhcp-1b1650c86cc9ca0616d06721b29630747a930d0f.tar.gz puppet-dhcp-1b1650c86cc9ca0616d06721b29630747a930d0f.tar.bz2 |
(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.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/definitions/dhcp-subnet.pp | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/manifests/definitions/dhcp-subnet.pp b/manifests/definitions/dhcp-subnet.pp index 46c55ae..066f538 100644 --- a/manifests/definitions/dhcp-subnet.pp +++ b/manifests/definitions/dhcp-subnet.pp @@ -1,22 +1,43 @@ +/* + += Definition: dhcp::subnet +Creates a subnet + +Arguments: + *$broadcast* : subnet broadcast (mandatory) + *$netmask* : subnet netmask (if not set, takes eth0 netmask) + *$routers* : subnet routers (array) (if not set, takes eth0 IP) + *$subnet_mask* : netmask sent to dhcp guests (if not set, takes $netmask, or netmask_eth0) + *$domain_name* : subnet domain name (if not set, takes server domain) + *$other_opts* : any other DHCPD option, as an array + +Example: + +node "dhcp.domain.ltd" { + $dhcpd_domain_name = 'domain.ltd' + $dhcpd_dns_servers = '10.27.21.1, 10.26.21.1' + include dhcp + + dhcp::subnet {"10.27.20.0": + ensure => present, + broadcast => "10.27.20.255", + other_opts => ['filename "pxelinux.0";', 'next-server 10.27.10.1;'], + } +} +*/ define dhcp::subnet( $ensure=present, - $bcast, - $dns, + $broadcast, $netmask=false, - $domain_name=false, - $inc=false, - $routeurs=false, - $netbios_dns=false, + $routers=false, $subnet_mask=false, - $other_opt=false, - $deny=false) { - include dhcp::variables + $domain_name=false, + $other_opts=false) { + include dhcp::params - if $inc { - $to_inc = "${dhcp::variables::config_dir}/hosts.d/${name}.conf" - } + $to_include = "${dhcp::params::config_dir}/hosts.d/${name}.conf" - file {"${dhcp::variables::config_dir}/subnets/${name}.conf": + file {"${dhcp::params::config_dir}/subnets/${name}.conf": ensure => $ensure, owner => root, group => root, @@ -24,10 +45,15 @@ define dhcp::subnet( notify => Service["dhcpd"], } - common::concatfilepart {"${name}": - file => "${dhcp::variables::config_dir}/dhcpd.conf", + common::concatfilepart {"dhcp.${name}": + file => "${dhcp::params::config_dir}/dhcpd.conf", ensure => $ensure, - content => "include \"${dhcp::variables::config_dir}/subnets/${name}.conf\";\n", + content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n", } + common::concatfilepart {"00.dhcp.${name}.base": + file => $to_include, + ensure => $ensure, + content => "# File managed by puppet\n", + } } |