Forge Home

dhcp

DHCP linux server.

6,739 downloads

6,389 latest version

4.3 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

  • 0.1.2 (latest)
  • 0.1.1
  • 0.1.0
released Aug 23rd 2017
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 2.7.20 < 5.0.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'intelligsystems-dhcp', '0.1.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install intelligsystems-dhcp --version 0.1.2

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, linux

Documentation

intelligsystems/dhcp — version 0.1.2 Aug 23rd 2017

dhcp

Table of Contents

  1. Description
  2. Setup - The basics of getting started with dhcp
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

DHCP puppet module to preapare dhcp linux server with failover option. This module has been prepared on Debian 8.8 (Jessie) and Puppet 4.10 environment.

Setup

puppet module install intelligsystems-dhcp

What dhcp affects

  • List of files and directories:
.
├── examples
│   ├── failover.pp
│   ├── hosts.pp
│   ├── init.pp
│   └── subnet.pp
├── files
├── Gemfile
├── LICENSE
├── manifests
│   ├── config.pp
│   ├── init.pp
│   ├── install.pp
│   ├── params.pp
│   ├── service.pp
│   └── tests.pp
├── metadata.json
├── Rakefile
├── README.md
├── spec
│   ├── classes
│   │   └── init_spec.rb
│   └── spec_helper.rb
└── templates
    └── dhcpd_conf.erb
  • It requires puppetlabs-stdlib, version_requirement: >= 1.0.0.
  • Attention!!! This module broadcasts IP addresses. It can provide a lot of changes in your network. Please make sure that you know what DHCP server does.

Setup Requirements

  • Puppet.
  • Linux system with root privileges.

Beginning with dhcp

The very basic steps needed for a user to get the module up and running.

include ::dhcp

Usage

Simple example how to use this module:

class { 'dhcp':
  domain_name         => 'example.org',
  domain_name_servers => [ 'ns1.example.org', 'ns2.example.org' ],
  subnet              => {
    '10.10.10.0 netmask 255.255.255.0' => {
      'range'                    => '10.10.10.5 10.10.10.10',
      'option routers'           => '10.10.10.1',
      'option broadcast-address' => '10.10.10.255'
    }
  },
}

Example how to use this module with failover option:

node 'node1.example.org' {
  class { 'dhcp':
    domain_name_servers => [ '192.168.50.249', '192.168.50.250' ],
    failover            => [
      {
        'peer'         => 'primary',
        'peer address' => '192.168.50.243'
      }
    ],
    subnet              => {
      '192.168.50.0 netmask 255.255.255.0' => {
        'range'                    => '192.168.50.100 192.168.50.199',
        'option routers'           => '192.168.50.1',
        'option broadcast-address' => '192.168.50.255'
      }
    },
  }
}
node 'node2.example.org' {
  class { 'dhcp':
    domain_name_servers => [ '192.168.50.249', '192.168.50.250' ],
    failover            => [
      {
        'peer'         => 'secondary',
        'peer address' => '192.168.50.245'
      }
    ],
    subnet              => {
      '192.168.50.0 netmask 255.255.255.0' => {
        'range'                    => '192.168.50.100 192.168.50.199',
        'option routers'           => '192.168.50.1',
        'option broadcast-address' => '192.168.50.255'
      }
    },
  }
}

Reference

Classes:

  • dhcp::init
  • dhcp::params
  • dhcp::install
  • dhcp::config
  • dhcp::service

Facts:

  • osfamily
  • ipaddress
  • domain

Limitations

This module has been tested on Ubuntu 17.04, Debian 8 and CentOS 7 distribution already. It will be testing soon on another systems.

Development

Soon...

Release Notes.

dhcp 0.1.0 version:

  • base module dhcp 0.1.1 version:
  • puppet-lint fix
  • modified README dhcp 0.1.2 version:
  • modified README
  • replaced all scope variables $:: with the $facts[]
  • added reverse compatibility for puppet 2.7.20
  • replaced File[dhcp::dhcp_conf] to File[dhcp::dhcpd_conf] in manifest/service.pp
  • modified templates/dhcpd_conf.erb to avoid add failover option to subnet without failover 'primary' or 'secondary' option (see changelog)

Relaeases See changelog