Install and configure dnsmasq with custom resources.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
Top-level resource that installs the package, enables the service, and can manage DNS, DHCP, and hosts data in one declaration.
dnsmasq 'default' do
enable_dns true
enable_dhcp true
managed_hosts_data_bag false
managed_hosts(
'10.0.0.20' => ['router.test.lab', 'router']
)
dns_config(
'server' => '8.8.8.8'
)
dhcp_config(
'dhcp-range' => 'eth1,10.0.0.5,10.0.0.15,12h',
'interface' => 'eth1',
'tftp-root' => '/var/lib/tftpboot',
'enable-tftp' => nil
)
dhcp_options ['dhcp-host=01:23:ab:cd:01:02,larry,10.0.0.10']
endManages /etc/dnsmasq.d/dns.conf.
Manages /etc/dnsmasq.d/dhcp.conf and the optional TFTP root directory.
Manages /etc/hosts entries for dnsmasq, optionally merging a data bag item.
Detailed resource documentation lives in:
documentation/dnsmasq_dnsmasq.mddocumentation/dnsmasq_dns.mddocumentation/dnsmasq_dhcp.mddocumentation/dnsmasq_managed_hosts.md
If you want to merge managed hosts from a data bag, use the dnsmasq data bag
and the managed_hosts item by default. It takes the form:
{
"id": "managed_hosts",
"maps": {
"192.168.0.100": "www.google.com",
"192.168.0.101": ["www.yahoo.com", "www.altavista.com"]
}
}- This cookbook no longer uses root-level recipes or attributes.
- Configuration defaults now live on resource properties instead of node attributes.
- Managed hosts still use the
hostsfilecookbook under the hood.
Please refer to the TESTING file to see instructions for testing this cookbook.
This project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.