diff options
author | Mathieu Bornoz <mathieu.bornoz@camptocamp.com> | 2012-08-02 11:24:52 +0200 |
---|---|---|
committer | Mathieu Bornoz <mathieu.bornoz@camptocamp.com> | 2012-08-02 11:24:52 +0200 |
commit | 109f35f97718bc607db179533461f2805a60a136 (patch) | |
tree | 7ebcbbbda7911c1f60e39c40d7115ab1e8b5696e /manifests/subnet.pp | |
parent | 536a24852925104df8b9becfcac9d17ac999a5f4 (diff) | |
download | puppet-dhcp-109f35f97718bc607db179533461f2805a60a136.tar.gz puppet-dhcp-109f35f97718bc607db179533461f2805a60a136.tar.bz2 |
lint + cosmetics
Diffstat (limited to 'manifests/subnet.pp')
-rw-r--r-- | manifests/subnet.pp | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/manifests/subnet.pp b/manifests/subnet.pp index 15afd53..18ffdc5 100644 --- a/manifests/subnet.pp +++ b/manifests/subnet.pp @@ -1,40 +1,41 @@ -/* - -= 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 - *$is_shared* : whether it's part of a shared network or not. Default: false - -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;'], - } -} -*/ +# = 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 +# *$is_shared* : whether it's part of a shared network or not. Default: false +# +# 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, $broadcast, + $ensure=present, $netmask=false, $routers=false, $subnet_mask=false, $domain_name=false, $other_opts=false, - $is_shared=false) { + $is_shared=false +) { + include dhcp::params concat {"${dhcp::params::config_dir}/hosts.d/${name}.conf": @@ -44,13 +45,13 @@ define dhcp::subnet( } file {"${dhcp::params::config_dir}/subnets/${name}.conf": - ensure => $ensure, - owner => root, - group => root, - content => template("dhcp/subnet.conf.erb"), - notify => Service["dhcpd"], + ensure => $ensure, + owner => root, + group => root, + content => template('dhcp/subnet.conf.erb'), + notify => Service['dhcpd'], } - + if ! $is_shared { concat::fragment {"dhcp.${name}": ensure => $ensure, |