cookbook 'dnsmasq', '= 0.2.0'
dnsmasq
(22) Versions
0.2.0
-
Follow10
Installs and configures dnsmasq
cookbook 'dnsmasq', '= 0.2.0', :supermarket
knife supermarket install dnsmasq
knife supermarket download dnsmasq
DNSMasq
Install and configure dnsmasq. Depends on the hosts_file cookbook.
Recipes
default
Installs the dnsmasq
package. Depending on the [:dnsmasq][:enable_dns]
and [:dnsmasq][:enable_dhcp]
attributes it includes the dns
and dhcp
recipes respectively.
dhcp
Includes the default
recipe and writes the contents of the node[:dnsmasq][:dhcp]
attribute hash to /etc/dnsmasq.d/dhcp.conf
. Here is an example of the necessary attributes for DHCP with TFTP enabled:
'dnsmasq' => { 'enable_dhcp' => true, 'dhcp' => { 'dhcp-authoritative' => nil, 'dhcp-range' => 'eth0,10.0.0.10,10.0.0.100,12h', 'dhcp-option' => '3', #turns off everything except basic DHCP 'domain' => 'lab.atx', 'interface' => 'eth0', 'dhcp-boot' => 'pxelinux.0', 'enable-tftp' => nil, 'tftp-root' => '/var/lib/tftpboot', 'tftp-secure' => nil } }
dns
Includes the default
and manage_hostsfile
recipes, then writes the content of the node[:dnsmasq][:dns]
attribute hash to /etc/dnsmasq.d/dns.conf
.
manage_hostsfile
Loads the dnsmasq
data bag managed_hosts
item and merges it with any nodes in the [:dnsmasq][:managed_hosts]
attribute, then writes them out the the /etc/hosts/
via the hosts_file
cookbook.
Usage
Data Bag
If you need manage your DNS hosts you may use the dnsmasq
data bag managed_hosts
item. It takes the form:
{ "id": "managed_hosts", "192.168.0.100": "www.google.com", "192.168.0.101": ["www.yahoo.com", "www.altavista.com"] }
Attributes
-
[:dnsmasq][:enable_dns]
whether to enable the DNS service, default istrue
-
[:dnsmasq][:enable_dhcp]
whether to enabled the DHCP service, default isfalse
-
[:dnsmasq][:managed_hosts]
hash of IPs and hostname/array of hostnames for themanage_hostfile
recipe, default is empty -
[:dnsmasq][:managed_hosts_bag]
name of the data bag item, default ismanaged_hosts
-
[:dnsmasq][:dhcp]
= hash of settings and values for the/etc/dnsmasq.d/dhcp.conf
, default is empty -
[:dnsmasq][:dhcp_options]
= list of options to be added to the/etc/dnsmasq.d/dhcp.conf
(ie.['dhcp-host=80:ee:73:0a:fa:d9,crushinator,10.0.0.11']
), default is empty. -
[:dnsmasq][:dns]
hash of settings and values for the/etc/dnsmasq.d/dns.conf
, defaults areruby { 'no-poll' => nil, 'no-resolv' => nil, 'server' => '127.0.0.1' }
-
[:dnsmasq][:dns_options]
= list of options to be added to the/etc/dnsmasq.d/dns.conf
, default is empty.
Testing
Please refer to the [TESTING file](TESTING.md) to see instructions for testing this cookbook. It is currently tested on the following platforms: CentOS 5.9, CentOS 6.4, Debian 7.1, Ubuntu 10.04, 12.04 and 13.04.
Repo:
Collaborator Number Metric
0.2.0 passed this metric
Contributing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC043: Prefer new notification syntax: dnsmasq/recipes/dhcp.rb:13
FC043: Prefer new notification syntax: dnsmasq/recipes/dns.rb:9
FC043: Prefer new notification syntax: dnsmasq/recipes/manage_hostsfile.rb:13
FC064: Ensure issues_url is set in metadata: dnsmasq/metadata.rb:1
FC065: Ensure source_url is set in metadata: dnsmasq/metadata.rb:1
FC066: Ensure chef_version is set in metadata: dnsmasq/metadata.rb:1
FC069: Ensure standardized license defined in metadata: dnsmasq/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 passed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC043: Prefer new notification syntax: dnsmasq/recipes/dhcp.rb:13
FC043: Prefer new notification syntax: dnsmasq/recipes/dns.rb:9
FC043: Prefer new notification syntax: dnsmasq/recipes/manage_hostsfile.rb:13
FC064: Ensure issues_url is set in metadata: dnsmasq/metadata.rb:1
FC065: Ensure source_url is set in metadata: dnsmasq/metadata.rb:1
FC066: Ensure chef_version is set in metadata: dnsmasq/metadata.rb:1
FC069: Ensure standardized license defined in metadata: dnsmasq/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
FC043: Prefer new notification syntax: dnsmasq/recipes/dns.rb:9
FC043: Prefer new notification syntax: dnsmasq/recipes/manage_hostsfile.rb:13
FC064: Ensure issues_url is set in metadata: dnsmasq/metadata.rb:1
FC065: Ensure source_url is set in metadata: dnsmasq/metadata.rb:1
FC066: Ensure chef_version is set in metadata: dnsmasq/metadata.rb:1
FC069: Ensure standardized license defined in metadata: dnsmasq/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number