Forge Home

dhcp

Manage the ISC DHCP daemon

357,446 downloads

1,584 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.2.0 (latest)
  • 9.1.0
  • 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 May 16th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 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.2.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.2.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.2.0 May 16th 2024

DHCP module for Puppet

DHCP module for theforeman. Based on original DHCP module by ZLeslie, thanks to him for the original work.

Installs and manages a DHCP server.

Dependencies

Features

  • Multiple subnet support
  • Support for multiple pools within a subnet
  • Host reservations
  • Secure dynamic DNS updates when combined with Bind
  • Failover support

Usage

Define the server and the zones it will be responsible for.

class { 'dhcp':
  dnsdomain    => [
    'dc1.example.net',
    '1.0.10.in-addr.arpa',
    ],
  nameservers  => ['10.0.1.20'],
  interfaces   => ['eth0'],
  dnsupdatekey => "/etc/bind/keys.d/$ddnskeyname",
  require      => Bind::Key[ $ddnskeyname ],
  pxeserver    => '10.0.1.50',
  pxefilename  => 'pxelinux.0',
}

dhcp::pool

To create a subnet with a single pool, use dhcp::pool.

Define the pool attributes

dhcp::pool{ 'ops.dc1.example.net':
  network => '10.0.1.0',
  mask    => '255.255.255.0',
  range   => '10.0.1.100 10.0.1.200',
  gateway => '10.0.1.1',
}

Override global attributes with pool specific

dhcp::pool{ 'ops.dc1.example.net':
  network     => '10.0.1.0',
  mask        => '255.255.255.0',
  range       => '10.0.1.100 10.0.1.200',
  gateway     => '10.0.1.1',
  nameservers => ['10.0.1.2', '10.0.2.2'],
  pxeserver   => '10.0.1.2',
}

For the support of static routes (RFC3442):

dhcp::pool{ 'ops.dc1.example.net':
  network => '10.0.1.0',
  mask    => '255.255.255.0',
  range   => '10.0.1.100 10.0.1.200',
  gateway => $gw,
  static_routes =>  [ { 'mask' => '32', 'network' => '169.254.169.254', 'gateway' => $ip },
                      { 'mask' => '0',                                  'gateway' => $gw } ],
}

dhcp::subnet

To create a subnet with multiple pools, use dhcp::subnet.

dhcp::subnet{ 'ops.dc1.example.net':
  network => '10.0.1.0',
  mask    => '255.255.255.0',
  pools   => [
    {
      range      => '10.0.1.101 10.0.1.110',
      parameters => [
        'allow members of "group1"',
        'next-server 10.1.1.1',
      ],
    },
    {
      range      => '10.0.1.111 10.0.1.120',
      parameters => [
        'allow members of "group2"',
        'next-server 10.1.1.2',
      ],
    },
  ],
  gateway => '10.0.1.1',
}

dhcp::host

Create host reservations.

dhcp::host {
  'server1': mac => "00:50:56:00:00:01", ip => "10.0.1.51";
  'server2': mac => "00:50:56:00:00:02", ip => "10.0.1.52";
  'server3': mac => "00:50:56:00:00:03", ip => "10.0.1.53";
}

Contributors

Original authors:

Copyright (c) 2010-2016 Zach Leslie, Ben Hughes, Greg Sutcliffe, Foreman developers

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.