aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-11 14:25:15 +0200
committerRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-11 14:25:15 +0200
commit65bea20e0d8e61de7519bb1ab0677597500aaac7 (patch)
tree89a91f68d8118bc56dbf7da3afe652de3a565dfd /manifests
parenta3158aaca4070a4de89b49d687854d72df8741fe (diff)
downloadpuppet-dhcp-65bea20e0d8e61de7519bb1ab0677597500aaac7.tar.gz
puppet-dhcp-65bea20e0d8e61de7519bb1ab0677597500aaac7.tar.bz2
Get rid of unscoped variables in dhcp::server, fix template
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp9
-rw-r--r--manifests/server.pp20
-rw-r--r--manifests/server/config.pp4
3 files changed, 25 insertions, 8 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 8a14b13..e1e05b3 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,7 +1,14 @@
class dhcp (
$server = true,
+ $server_ddns_update = undef,
+ $server_authoritative = undef,
+ $server_opts = undef,
) {
if $server {
- class { '::dhcp::server': }
+ class { '::dhcp::server':
+ ddns_update => $server_ddns_update,
+ authoritative => $server_authoritative,
+ opts => $server_opts,
+ }
}
}
diff --git a/manifests/server.pp b/manifests/server.pp
index ceffa14..d83c26f 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -5,15 +5,17 @@
# module "common": git://github.com/camptocamp/puppet-common.git
#
# facultative argument:
-# *$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
+# *$ddns_update* : ddns-update-style option (default to none)
+# *$authoritative* : set it if you want that your DHCP server is
+# authoritative (default to no)
+# *$opts* : any other DHCPD valid options
#
# Example:
# node "dhcp.toto.ltd" {
-# $dhcpd_opts = ['domain-name "toto.ltd"', "domain-name-servers 192.168.21.1"]
-# include dhcp::server
+# class { 'dhcp::server':
+# opts => ['domain-name "toto.ltd"',
+# 'domain-name-servers 192.168.21.1'],
+# }
#
# dhcp::subnet {"10.27.20.0":
# ensure => present,
@@ -29,7 +31,11 @@
# }
# }
#
-class dhcp::server {
+class dhcp::server (
+ $ddns_update = 'none',
+ $authoritative = false,
+ $opts = [],
+) {
class { '::dhcp::server::packages': } ->
class { '::dhcp::server::config': } ~>
class { '::dhcp::server::service': }
diff --git a/manifests/server/config.pp b/manifests/server/config.pp
index 4898a60..0c1a74a 100644
--- a/manifests/server/config.pp
+++ b/manifests/server/config.pp
@@ -11,6 +11,10 @@ class dhcp::server::config {
validate_string($dhcp::params::server_template)
validate_re($dhcp::params::server_template, '^\S+$')
+ validate_string($dhcp::server::ddns_update)
+ validate_bool($dhcp::server::authoritative)
+ validate_array($dhcp::server::opts)
+
concat {"${dhcp::params::config_dir}/dhcpd.conf":
owner => root,
group => root,