Defined Type: dhcp::host

Defined in:
manifests/host.pp

Summary

Manage a DHCP host

Overview

Parameters:

  • ip (Optional[Stdlib::IP::Address]) (defaults to: undef)

    The ip address of the DHCP host.

  • mac (Dhcp::Mac)

    The MAC address.

  • ddns_hostname (String) (defaults to: $name)

    The name parameter should be the hostname that will be used in setting up the client’s A and PTR records. If no ddns-hostname is specified in scope, then the server will derive the hostname automatically, using an algorithm that varies for each of the different update methods.

  • options (Hash) (defaults to: {})

    A hash with key value pairs to go to the option lines. The word ‘option’ is not needed.

  • comment (Optional[String[1]]) (defaults to: undef)

    A comment added to the DHCP host.

  • ignored (Boolean) (defaults to: false)

    If set to true results in ‘ignore booting;` line in the DHCP host configuration.

  • default_lease_time (Optional[Integer]) (defaults to: undef)

    Default lease length.

  • max_lease_time (Optional[Integer]) (defaults to: undef)

    The maximum lease length.

  • ipxe_filename (Optional[String[1]]) (defaults to: undef)

    The ipxe filenme, e. g. ipxe.efi.

  • ipxe_bootstrap (Optional[String[1]]) (defaults to: undef)

    The bootstrap file of UEFI PXE, e. g. winpe.ipxe

  • filename (Optional[String[1]]) (defaults to: undef)

    The file to be loaded by TFTP.

  • on_commit (Array[String[1]]) (defaults to: [])

    An array with statements to go into the hook on commit.

  • on_release (Array[String[1]]) (defaults to: [])

    An array with statements to go into the hook on release.

  • on_expiry (Array[String[1]]) (defaults to: [])

    An array with statements to go into the hook on expiry.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'manifests/host.pp', line 46

define dhcp::host (
  Dhcp::Mac $mac,
  Optional[Stdlib::IP::Address] $ip     = undef,
  String $ddns_hostname                 = $name,
  Hash $options                         = {},
  Optional[String[1]] $comment          = undef,
  Boolean $ignored                      = false,
  Optional[Integer] $default_lease_time = undef,
  Optional[Integer] $max_lease_time     = undef,
  Optional[String[1]] $ipxe_filename    = undef,
  Optional[String[1]] $ipxe_bootstrap   = undef,
  Optional[String[1]] $filename         = undef,
  Array[String[1]] $on_commit           = [],
  Array[String[1]] $on_release          = [],
  Array[String[1]] $on_expiry           = [],
) {
  $host = $name

  include dhcp::params

  $dhcp_dir = $dhcp::params::dhcp_dir

  concat::fragment { "dhcp_host_${name}":
    target  => "${dhcp_dir}/dhcpd.hosts",
    content => template('dhcp/dhcpd.host.erb'),
    order   => '10',
  }
}