diff options
author | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-04-12 11:10:45 +0200 |
---|---|---|
committer | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-04-12 11:10:45 +0200 |
commit | b35e1322d0a791ab22cb2c385ec913492c75026d (patch) | |
tree | 74cc5d0be13ef9110665741de1a873f84e98e9bd /manifests | |
parent | 558df46dc9bec98c6c90719d9aed11ec7a338411 (diff) | |
download | puppet-dhcp-b35e1322d0a791ab22cb2c385ec913492c75026d.tar.gz puppet-dhcp-b35e1322d0a791ab22cb2c385ec913492c75026d.tar.bz2 |
Rename dhcp::shared-network to dhcp::shared_network, add specs
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/shared_network.pp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/manifests/shared_network.pp b/manifests/shared_network.pp index 9a02a5b..38f14fb 100644 --- a/manifests/shared_network.pp +++ b/manifests/shared_network.pp @@ -8,17 +8,22 @@ # - subnets must exists # - subnets must have $is_shared set to true (default is false) # -define dhcp::shared-network( +define dhcp::shared_network( $ensure = present, - $subnets = [] + $subnets = [], ) { - include dhcp::params + include ::dhcp::params - concat::fragment {"shared-${name}": + validate_string($ensure) + validate_re($ensure, ['present', 'absent'], + "\$ensure must be either 'present' or 'absent', got '${ensure}'") + validate_array($subnets) + + concat::fragment {"dhcp-shared-${name}": ensure => $ensure, target => "${dhcp::params::config_dir}/dhcpd.conf", - content => template('dhcp/shared-network.erb'), + content => template("${module_name}/shared-network.erb"), require => Dhcp::Subnet[$subnets], } |