aboutsummaryrefslogtreecommitdiff
path: root/manifests/definitions/dhcp-host.pp
blob: 1d7fbbeb9b49b968763c027669b18839cf67b39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*

= Definition: dhcp::host
Create dhcp configuration for a host

Arguments:
 *$mac*:           host MAC address (mandatory)
 *$subnet*:        subnet in which we want to add this host
 *$fixed_address*: host fixed address (if not set, takes $name)

*/
define dhcp::host($ensure=present,$mac,$subnet,$fixed_address=false) {
  include dhcp::params
  common::concatfilepart {"dhcp.host.$name":
    ensure => $ensure,
    notify => Service["dhcpd"],
    file   => "${dhcp::params::config_dir}/hosts.d/${subnet}.conf",
    require => Dhcp::Subnet[$subnet],
    content => template("dhcp/host.conf.erb"),
  }
}