aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>2013-02-26 11:34:24 +0000
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>2013-02-26 11:34:24 +0000
commit68e456b83faf170e0596f84d2af14f154e3160ba (patch)
treefa074bf81c527770622aa7fd509a2e3de337c248 /manifests
parent5486843f40439050f4aa6a94fab8d2bf45037942 (diff)
downloadpuppet-dhcp-68e456b83faf170e0596f84d2af14f154e3160ba.tar.gz
puppet-dhcp-68e456b83faf170e0596f84d2af14f154e3160ba.tar.bz2
new dhcp::hosts - uses puppet hashes
Diffstat (limited to 'manifests')
-rw-r--r--manifests/hosts.pp47
1 files changed, 47 insertions, 0 deletions
diff --git a/manifests/hosts.pp b/manifests/hosts.pp
new file mode 100644
index 0000000..f0c7c37
--- /dev/null
+++ b/manifests/hosts.pp
@@ -0,0 +1,47 @@
+# = Definition: dhcp::hosts
+#
+# Creates a dhcp configuration for given hosts
+#
+# Arguments
+# $template: dhcp host template - default: 'dhcp/host.conf.erb'
+# $subnet: targeted subnet
+# $data_hash: hash containing data - default form:
+# {
+# <host1> => {
+# options => false,
+# fixed_address => false,
+# eth0 => 'mac-address',
+# eth1 => 'mac-address',
+# …,
+# wlan0 => 'mac-address',
+# wlan1 => 'mac-address',
+# …,
+# },
+# <host2> => {
+# options => false,
+# fixed_address => false,
+# eth0 => 'mac-address',
+# eth1 => 'mac-address',
+# …,
+# wlan0 => 'mac-address',
+# wlan1 => 'mac-address',
+# …,
+# options => false,
+# },
+# …,
+# }
+#
+define dhcp::hosts (
+ $data_hash,
+ $subnet,
+ $template = 'dhcp/host.conf.erb',
+) {
+
+ include dhcp::params
+
+ concat::fragment {"dhcp.host.${name}":
+ target => "${dhcp::params::config_dir}/hosts.d/${subnet}.conf",
+ content => template($template),
+ notify => Service['dhcpd'],
+ }
+}