Skip to content
DHCP module for Puppet
Ruby Puppet HTML
Find file
Failed to load latest commit information.
files Forked from zleslie's dhcp module, reworked for theforeman
manifests Add support for configuring failover
spec modulesync: update to rspec-puppet 2.3.0, remove workarounds
templates Add support for configuring failover
tests Add support for configuring failover
.fixtures.yml Use puppetlabs-concat instead of theforeman-concat_native
.gitignore modulesync: add param docs lint check, add verify_* helpers
.puppet-lint.rc
.sync.yml modulesync: use puppet-lint.rc to configure puppet-lint outside of rake
.travis.yml modulesync: remove Puppet 2.7 tests, add Ruby 2.2 tests
CHANGELOG.md Prepare 2.2.0 changelog
CONTRIBUTING.md modulesync: new lint checks, add CONTRIBUTING doc
Gemfile modulesync: update to rspec-puppet 2.3.0, remove workarounds
LICENSE Add Modulefile and pre-reqs for Puppet Forge
README.md Add rfc3442 support - option for static routes
Rakefile
metadata.json [blacksmith] Bump version to 2.2.1

README.md

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
  • Host reservations
  • Secure dynamic DNS updates when combined with Bind

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

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 => '10.0.1.1',
  static_routes =>  [ { 'mask' => '32', 'network' => '169.254.169.254', 'gateway' => $ip } ],
}

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

Zach Leslie zach.leslie@gmail.com Ben Hughes git@mumble.org.uk Greg Sutcliffe greg.sutcliffe@gmail.com

Something went wrong with that request. Please try again.