From b2f56872e2e8ad9a0b2fa4e7d08eb888638d286f Mon Sep 17 00:00:00 2001 From: Cédric Jeanneret Date: Wed, 22 Jun 2011 10:52:53 +0200 Subject: dhcp::subnet - added new argument, and updated related template --- manifests/definitions/dhcp-subnet.pp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/definitions/dhcp-subnet.pp b/manifests/definitions/dhcp-subnet.pp index 066f538..c0f865b 100644 --- a/manifests/definitions/dhcp-subnet.pp +++ b/manifests/definitions/dhcp-subnet.pp @@ -10,6 +10,7 @@ Arguments: *$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 + *$is_shared* : whether it's part of a shared network or not. Default: false Example: @@ -32,7 +33,8 @@ define dhcp::subnet( $routers=false, $subnet_mask=false, $domain_name=false, - $other_opts=false) { + $other_opts=false, + $is_shared=false) { include dhcp::params $to_include = "${dhcp::params::config_dir}/hosts.d/${name}.conf" @@ -45,10 +47,25 @@ define dhcp::subnet( notify => Service["dhcpd"], } - common::concatfilepart {"dhcp.${name}": + if ! $is_shared { + common::concatfilepart {"dhcp.${name}": + file => "${dhcp::params::config_dir}/dhcpd.conf", + ensure => $ensure, + content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n", + } + } else { + common::concatfilepart {"dhcp.${name}": + file => "${dhcp::params::config_dir}/dhcpd.conf", + ensure => absent, + content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n", + } + + } + + common::concatfilepart {"subnet.${name}.hosts": file => "${dhcp::params::config_dir}/dhcpd.conf", ensure => $ensure, - content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n", + content => "include \"${dhcp::params::config_dir}/hosts.d/${name}.conf\";\n", } common::concatfilepart {"00.dhcp.${name}.base": -- cgit v1.2.3