Cookbooks
dhcp
documentation
Dhcp Host

dhcp_host

Back to resource list

Create a DHCPD host configuration. (https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcpdconf#reference-declarations (opens in a new tab) - The host statement)

Introduced: v7.0.0

Actions

  • :create
  • :delete

Properties

NameTypeDefaultDescriptionAllowed Values
commentStringnilComment to add to the configuration file
ip_versionSymbol:ipv4Select DHCP or DHCPv6 server to configure:ipv4, :ipv6
conf_dirString/etc/dhcp/dhcpd(6).d/hosts.dDirectory to create configuration file in
cookbookString/etc/dhcp/dhcpd(6).d/hosts.dCookbook to source configuration file template from
templateString/etc/dhcp/dhcpd(6).d/hosts.dTemplate to use to generate the configuration file
ownerStringPlatform dependantOwner of the generated configuration file
groupStringPlatform dependantGroup of the generated configuration file
modeString'0640'Filemode of the generated configuration file
identifierStringnilDHCPD host identifier (MAC or DHCID)
addressStringnilDHCPD address to issue
parametersArray, HashnilDHCPD parameters for the host
optionsArray, HashnilDHCPD options for the host

Examples

dhcp_host 'IPv4-Host' do
  identifier 'hardware ethernet 00:53:00:00:00:01'
  address '192.168.0.10'
  options(
    'host-name' => 'test-ipv4-host'
  )
end
dhcp_host 'IPv6-Host' do
  ip_version :ipv6
  identifier 'host-identifier option dhcp6.client-id 00:53:00:00:00:01:a4:65:b7:c8'
  address '2001:db8:1:1:0:0:1:10'
  options(
      'host-name' => 'test-ipv6-host'
    )
end