Forge Home

dnsmasq

Manage dnsmasq package install, service, and config file details.

930 downloads

930 latest version

5.0 quality score

Version information

  • 1.0.0 (latest)
released Nov 2nd 2021
This version is compatible with:
  • Puppet Enterprise 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
  • Puppet >= 6.21.0 < 8.0.0
  • , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'devalone-dnsmasq', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add devalone-dnsmasq
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install devalone-dnsmasq --version 1.0.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: dns, dnsmasq

Documentation

devalone/dnsmasq — version 1.0.0 Nov 2nd 2021

dnsmasq

Manage dnsmasq package install, service, and config file details.

Table of Contents

Description

The dnsmasq module manage dnsmasq package install, service, and config file details. The main class is dnsmasq, and it has a defined type dnsmasq::conf, you can use either of them to control the dnsmasq package.

Setup

What dnsmasq affects

  • The dnsmasq module install/uninstall dnsmasq package, configure dnsmasq to run the dnsmasq.service.
  • This module depends on the stdlib module that automatically installs.

Beginning with dnsmasq

include dnsmasq is enough to get you up and running, this uses the default parameters to run dnsmasq module. To pass in parameters specifying which resolv file to use, and local only domain:

class { 'dnsmasq':
  resolv_file        => '/etc/resolv.conf.dnsmasq',
  local_only_domains => ['/sansovo.org/'],
}

Usage

All parameters for the dnsmasq module are contained within the main dnsmasq class, as well as in defined type dnsmasq::conf, so for any function of the module, set the options you want. See the common usages below for examples.

Using default parameters

include dnsmasq

Using source attribute

If you have configued dnsmasq.conf file, this can be done by the dnsmasq::source parameter, as well as the dnsmasq::conf::source attribute. Notice, when set the source attribute with non undef value, the other config attributes are ignored. If you use detailed attributes to configure the dnsmasq service, set the source value to undef, or leave it unmanaged.

The default valute of source attribute is undef.

class { 'dnsmasq':
  source => 'puppet:///...',
}

or

dnsmasq::conf { 'local_dns':
  source => 'puppet:///...',
}

Specify the resolv file to use

class { 'dnsmasq':
  resolv_file => '/etc/resolv.conf.dnsmasq',
}

or

dnsmasq::conf { 'local_dns':
  resolv_file => '/etc/resolv.conf.dnsmasq',
}

The title or name of the dnsmasq::conf definded type is part of the config file name, you can specify different name for multiple dnsmasq::conf instances, they group together to config the dnsmasq service. Do not contain white space in the title or name attribute.

Specify the local only domains

Queries in example.org domain are answered from /etc/hosts or DHCP only.

class { 'dnsmasq':
  resolv_file        => '/etc/resolv.conf.dnsmasq',
  local_only_domains => ['/example.org/'],
}

or

dnsmasq::conf { 'local_dns':
  resolv_file        => '/etc/resolv.conf.dnsmasq',
  local_only_domains => ['/example.org/'],
}

Specify dhcp range

class { 'dnsmasq':
  resolv_file     => '/etc/resolv.conf.dnsmasq',
  dhcp_range      => ['192.168.0.100,192.168.0.150,2d'],
  dhcp_enable_ra  => true,
}

or

dnsmasq::conf { 'local_dns':
  resolv_file     => '/etc/resolv.conf.dnsmasq',
  dhcp_range      => ['192.168.0.100,192.168.0.150,2d'],
  dhcp_enable_ra  => true,
}

Enable TFTP feature

class { 'dnsmasq':
  resolv_file     => '/etc/resolv.conf.dnsmasq',
  dhcp_range      => ['192.168.0.100,192.168.0.150,2d'],
  dhcp_enable_ra  => true,
  enable_tftp     => true,
}

or

dnsmasq::conf { 'local_dns':
  resolv_file     => '/etc/resolv.conf.dnsmasq',
  dhcp_range      => ['192.168.0.100,192.168.0.150,2d'],
  dhcp_enable_ra  => true,
  enable_tftp     => true,
}

purge unmanaged files in $config_dir

    class { 'dnsmasq':
      purge_config_dir => true,
    }

Reference

See REFERENCE.md

Limitations

This module has been tested on Open Source Puppet 7. It is tested on ubuntu 20.04.

For an extensive list of supported operating systems, see metadata.json

Development

github https://github.com/dearall/devalone-dnsmasq

Release Notes

2021-11-03, version 1.0.0 released.