Manage dnsmasq package install, service, and config file details.
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.
- The dnsmasq module install/uninstall dnsmasq package, configure dnsmasq to run the dnsmasq.service.
- This module depends on the stdlib module that automatically installs.
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/'],
}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.
include dnsmasqIf 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:///...',
}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.
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/'],
}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,
}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,
} class { 'dnsmasq':
purge_config_dir => true,
}See REFERENCE.md
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
github https://github.com/dearall/devalone-dnsmasq
2021-11-03, version 1.0.0 released.