Forge Home

dhcp

Manage the ISC DHCP daemon

352,691 downloads

655 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 9.1.0 (latest)
  • 9.0.0
  • 8.2.0
  • 8.1.0
  • 8.0.0
  • 7.0.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.1.1
  • 5.1.0
  • 5.0.1
  • 5.0.0
  • 4.3.0
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.2
  • 4.0.1
  • 4.0.0
  • 3.1.0
  • 3.0.0
  • 2.3.2
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.1
  • 1.3.0
  • 1.2.0
  • 1.2.0-rc3 (pre-release)
  • 1.2.0-rc2 (pre-release)
  • 1.2.0-rc1 (pre-release)
released Nov 14th 2023
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , Archlinux, ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'theforeman-dhcp', '9.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add theforeman-dhcp
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install theforeman-dhcp --version 9.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: dhcp, foreman, dhcpd, isc

Documentation

theforeman/dhcp — version 9.1.0 Nov 14th 2023

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • dhcp::params: Default parameters

Defined types

Data types

Classes

dhcp

Manage an ISC DHCP server

Parameters

The following parameters are available in the dhcp class:

option_static_route

Data type: Boolean

When enabled it sets the options rfc3442-classless-static-routes and ms-classless-static-routes

Default value: false

dnsdomain

Data type: Array[String]

Default value: $dhcp::params::dnsdomain

nameservers

Data type: Array[String]

Default value: []

failover

Data type: Boolean

Default value: false

bootp

Data type: Optional[Boolean]

Default value: undef

ntpservers

Data type: Array[String]

Default value: []

interfaces

Data type: Optional[Array[String]]

Default value: undef

interface

Data type: String

Default value: 'NOTSET'

default_lease_time

Data type: Integer[0]

Default value: 43200

max_lease_time

Data type: Integer[0]

Default value: 86400

dnskeyname

Data type: String

Default value: 'rndc-key'

dnsupdatekey

Data type: Optional[String]

Default value: undef

dnsupdateserver

Data type: Optional[String]

Default value: undef

omapi

Data type: Boolean

Default value: true

omapi_name

Data type: Optional[String]

Default value: undef

omapi_algorithm

Data type: String

Default value: 'HMAC-MD5'

omapi_key

Data type: Optional[String]

Default value: undef

pxeserver

Data type: Optional[String]

Default value: undef

pxefilename

Data type: String

Default value: $dhcp::params::pxefilename

ipxe_filename

Data type: Optional[String]

Default value: undef

mtu

Data type: Optional[Integer[0]]

Default value: undef

bootfiles

Data type: Hash[String, String]

Default value: $dhcp::params::bootfiles

logfacility

Data type: String

Default value: 'local7'

dhcp_monitor

Data type: Boolean

Default value: true

dhcp_dir

Data type: Stdlib::Absolutepath

Default value: $dhcp::params::dhcp_dir

manage_dhcp_dir

Data type: Boolean

Default value: $dhcp::params::manage_dhcp_dir

conf_dir_mode

Data type: Optional[Stdlib::Filemode]

Default value: $dhcp::params::conf_dir_mode

packagename

Data type: String

Default value: $dhcp::params::packagename

servicename

Data type: String

Default value: $dhcp::params::servicename

options

Data type: Variant[Array[String], Optional[String]]

Default value: undef

authoritative

Data type: Boolean

Default value: false

dhcp_root_user

Data type: String

Default value: 'root'

dhcp_root_group

Data type: String

Default value: $dhcp::params::root_group

ddns_updates

Data type: Boolean

Default value: false

ddns_domainname

Data type: Optional[String]

Default value: undef

ddns_rev_domainname

Data type: Optional[String]

Default value: undef

ddns_update_style

Data type: Enum['none', 'interim', 'standard']

Default value: 'interim'

client_updates

Data type: Optional[Boolean]

Default value: undef

subnets

Data type: Hash[String, Hash]

Default value: {}

pools

Data type: Hash[String, Hash]

Default value: {}

hosts

Data type: Hash[String, Hash]

Default value: {}

includes

Data type: Variant[Array[String], Optional[String]]

Default value: undef

config_comment

Data type: String

Default value: 'dhcpd.conf'

dhcp::disable

Remove and Disable the DHCP server

dhcp::failover

Define a failover peer

Parameters

The following parameters are available in the dhcp::failover class:

peer_address

Data type: String

The address of the failover peer.

role

Data type: Enum['primary', 'secondary']

Primary or Secondary role in DHCP failover relationship.

Default value: 'primary'

address

Data type: String

IP Address of the DHCP failover server.

Default value: $facts['networking']['ip']

port

Data type: Variant[Integer[0, 65535], String]

Port to listen for failover messages.

Default value: 519

max_response_delay

Data type: Variant[Integer[0], String]

max-response-delay in seconds before failover peer is considered failed.

Default value: 30

max_unacked_updated

max-unacked-updates before the server will wait to send additional packets to peer.

mclt

Data type: Variant[Integer[0], String]

MCLT, the maximum time a lease may be extended beyond expiration set by DHCP peer.

Default value: 300

load_split

Data type: Variant[Integer[0], String]

Load split between the DHCP servers as fraction out of 256.

Default value: 128

load_balance

Data type: Variant[Integer[0], String]

Load balance max seconds, cutoff after which load balancing is disabled.

Default value: 3

omapi_key

Data type: Optional[String]

OMAPI key to cryptographically sign traffic if OMAPI protocol is enabled.

Default value: undef

max_unacked_updates

Data type: Variant[Integer[0], String]

Default value: 10

Defined types

dhcp::dhcp_class

Define a DHCP class

Parameters

The following parameters are available in the dhcp::dhcp_class defined type:

parameters

Data type: Variant[Array[String], String]

The parameters for the class definition. When specified as a string, it will be used verbatim with a semi colon at the end. When specified as an array, every string is used and appended with a semi colon.

dhcp::host

Define a DHCP host reservation

Parameters

The following parameters are available in the dhcp::host defined type:

ip

Data type: String

The IP address in the reservation

mac

Data type: Dhcp::Macaddress

The host's MAC address

comment

Data type: Optional[String]

An optional comment for the host

Default value: undef

raw_append

Data type: Optional[String]

Host configuration to append as-is

Default value: undef

raw_prepend

Data type: Optional[String]

Host configuration to prepend as-is

Default value: undef

dhcp::pool

Define a DHCP pool

Parameters

The following parameters are available in the dhcp::pool defined type:

network

Data type: String

mask

Data type: String

gateway

Data type: Optional[String]

Default value: undef

pool_parameters

Data type: Variant[Array[String], Optional[String]]

Default value: undef

range

Data type: Variant[Array[Dhcp::Range], Optional[Dhcp::Range], Enum[''], Boolean]

Default value: undef

failover

Data type: Optional[String]

Default value: undef

options

Data type: Variant[Array[String], Optional[String]]

Default value: undef

parameters

Data type: Variant[Array[String], Optional[String]]

Default value: undef

mtu

Data type: Optional[Integer[0]]

Default value: undef

nameservers

Data type: Variant[Array[String], Optional[String]]

Default value: undef

pxeserver

Data type: Optional[String]

Default value: undef

pxefilename

Data type: Optional[String]

Default value: undef

domain_name

Data type: Optional[String]

Default value: undef

static_routes

Data type: Optional[Array[Dhcp::StaticRoute]]

Default value: undef

search_domains

Data type: Variant[Array[String], Optional[String]]

Default value: undef

raw_append

Data type: Optional[String]

Default value: undef

raw_prepend

Data type: Optional[String]

Default value: undef

dhcp::subnet

Define a DHCP subnet

Parameters

The following parameters are available in the dhcp::subnet defined type:

network

Data type: Stdlib::IP::Address::Nosubnet

The network range (without the mask) from where IP's will be served

mask

Data type: Stdlib::IP::Address::Nosubnet

The subnet mask for our network

pools

Data type: Array[Dhcp::DhcpPool]

Specify a pool of addresses that will be treated differently than another pool of addresses, even on the same network segment or subnet.

gateway

Data type: Optional[String]

This option specifies a list of comma-separated IP addresses for routers on the client's subnet. Routers should be listed in order of preference.

Default value: undef

options

Data type: Variant[Array[String], Optional[String]]

Custom DHCP option statements DHCP option statements always start with the option keyword, followed by an option name, followed by option data. The option names and data formats are described below. It is not necessary to exhaustively specify all DHCP options - only those options which are needed by clients

Default value: undef

parameters

Data type: Variant[Array[String], Optional[String]]

Custom DHCP parameters Each element is added as a separate line

Default value: undef

mtu

Data type: Optional[Integer[0]]

This option specifies the MTU to use on this interface. The minimum legal value for the MTU is 68.

Default value: undef

nameservers

Data type: Variant[Array[String], Optional[String]]

Specifies a list of Domain Name System (STD 13, RFC 1035) name servers available to the client. Servers should be listed in order of preference.

Default value: undef

pxeserver

Data type: Optional[String]

This is used to specify the host address of the server from which the initial boot file (specified in the filename statement) is to be loaded. Server-name should be a numeric IP address or a domain name. If no next-server statement applies to a given client, the address 0.0.0.0 is used.

Default value: undef

pxefilename

Data type: Optional[String]

This can be used to specify the name of the initial boot file which is to be loaded by a client. The filename should be a filename recognizable to whatever file transfer protocol the client can be expected to use to load the file.

Default value: undef

domain_name

Data type: Optional[String]

This option specifies the domain name that client should use when resolving hostnames via the Domain Name System.

Default value: undef

static_routes

Data type: Optional[Array[Dhcp::StaticRoute]]

This option specifies a list of static routes that the client should install in its routing cache. If multiple routes to the same destination are specified, they are listed in descending order of priority.

Default value: undef

search_domains

Data type: Variant[Array[String], Optional[String]]

Specifies a ´search list´ of Domain Names to be used by the client to locate not-fully-qualified domain names. The difference between this option and historic use of the domain-name option for the same ends is that this option is encoded in RFC1035 compressed labels on the wire. For example:

Default value: undef

raw_append

Data type: Optional[String]

Partial that is appended to the dhcpd.conf (before the final })

Default value: undef

raw_prepend

Data type: Optional[String]

Partial that is prepended to the dhcpd.conf (after the first {)

Default value: undef

Data types

Dhcp::DhcpPool

Define a DHCP pool inside a DHCP configuration block

Alias of

Struct[{
    'range'                => Optional[Variant[Array[Dhcp::Range], Dhcp::Range, Enum[''], Boolean]],
    Optional['failover']   => Optional[String],
    Optional['parameters'] => Optional[Variant[Array[String], String]],
  }]

Parameters

The following parameters are available in the Dhcp::DhcpPool data type:

range

The range or ranges to assign IP's from

failover

Which peer to failover to

parameters

Custom parameters, added verbatim to the pool block

Dhcp::Macaddress

The Dhcp::Macaddress data type.

Alias of Pattern[/^[0-9A-Fa-f]{1,2}(:[0-9A-Fa-f]{1,2}){5}$/]

Dhcp::Range

The Dhcp::Range data type.

Alias of Pattern[/^(dynamic-bootp )?((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?( ((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?)?$/]

Dhcp::StaticRoute

The Dhcp::StaticRoute data type.

Alias of

Struct[{
    'mask'              => String,
    'gateway'           => String,
    Optional['network'] => String,
  }]