Defined Type: dhcp::pool

Defined in:
manifests/pool.pp

Summary

Define a dhcp-pool for IPv4 networks

Overview

Parameters:

  • network (Stdlib::IP::Address::V4)

    Base-IP-Address of the pool

  • mask (Stdlib::IP::Address::V4)

    Networkmask of that pool

  • host_mask (Stdlib::IP::Address::V4) (defaults to: $mask)

    Networkmask that is supplied to the client Defaults to ‘mask`. Use it to supply a smaller mask to clients if needed

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

    Optional IP-address for the gateway

  • range (Optional[Variant[Array[String[1],1],String[1]]]) (defaults to: undef)

    Optional IP-range to supply addresses from Specify as String with start- and end-IP-address separated by space

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

    Optional name of the DHCP-server to failover

  • options (Optional[Variant[Array[String[1]],String[1]]]) (defaults to: undef)

    Optional String or Array of ‘option` to set in the pool

  • parameters (Optional[Variant[Array[String[1]],String[1]]]) (defaults to: undef)

    Optional String or Array of manual parameters to set

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

    Optional String to group this pool into a shared-network segment by the name ‘sharednetwork`. You need to define that segment by using `dhcp::sharednetwork`

  • nameservers (Optional[Array[String]]) (defaults to: undef)

    Optional set of IPv4-nameservers to supply to the client

  • nameservers_ipv6 (Optional[Array[String]]) (defaults to: undef)

    Optional set of IPv6-nameservers to supply to the client

  • pxeserver (Optional[String]) (defaults to: undef)

    Optional name of a PXE-server to boot from

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

    Optional size of the MTU to supply to the client

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

    Optional domainname for the client

  • ignore_unknown (Any) (defaults to: undef)

    Set to true to disable leases for clients not explicitly defined by ‘dhcp::host`

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

    Set of statements to execute when providing a lease

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

    Set of statements to execute when a lease is released

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

    Set of statements to execute when a lease expires



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'manifests/pool.pp', line 65

define dhcp::pool (
  Stdlib::IP::Address::V4 $network,
  Stdlib::IP::Address::V4 $mask,
  Stdlib::IP::Address::V4 $host_mask        = $mask,
  Optional[String[1]] $gateway              = undef,
  Optional[Variant[Array[String[1],1],String[1]]] $range = undef,
  Optional[String[1]] $failover             = undef,
  Optional[Variant[Array[String[1]],String[1]]] $options          = undef,
  Optional[Variant[Array[String[1]],String[1]]] $parameters       = undef,
  Optional[String[1]] $sharednetwork        = undef,
  Optional[Array[String]] $nameservers      = undef,
  Optional[Array[String]] $nameservers_ipv6 = undef,
  Optional[String] $pxeserver               = undef,
  Optional[Integer] $mtu                    = undef,
  Optional[String[1]] $domain_name          = undef,
  $ignore_unknown                           = undef,
  Array[String[1]] $on_commit               = [],
  Array[String[1]] $on_release              = [],
  Array[String[1]] $on_expiry               = [],

) {
  include dhcp::params

  $dhcp_dir = $dhcp::params::dhcp_dir

  concat::fragment { "dhcp_pool_${name}":
    target  => "${dhcp_dir}/dhcpd.pools",
    content => template('dhcp/dhcpd.pool.erb'),
    order   => "10 ${sharednetwork}-10",
  }

  if $sharednetwork {
    Dhcp::Sharednetwork[$sharednetwork] -> Concat::Fragment["dhcp_pool_${name}"]
  }
}