Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

resolvconf (15) Versions 0.2.3

Installs/Configures resolvconf

Policyfile
Berkshelf
Knife
cookbook 'resolvconf', '= 0.2.3', :supermarket
cookbook 'resolvconf', '= 0.2.3'
knife supermarket install resolvconf
knife supermarket download resolvconf
README
Dependencies
Changelog
Quality 100%

resolvconf Cookbook

This cookbook maintains /etc/resolv.conf using the resolvconf package, which is installed by default on Debian/Ubuntu.

Requirements

A system that supports resolvconf.

  • Ubuntu >= 10.04
  • Debian >= 6.0

Furthermore you need to add the following line to your metadata.rb

depends 'resolvconf'

Attributes

This section describes the supported attributes, as well as their default settings.

Use the following attributes to specify your nameserver(s) to use, the search domain(s) and additional options.
Each attribute supports strings, as well as arrays with multiple elements.

node['resolvconf']['nameserver'] = %w(208.67.222.222 208.67.220.220) # Set nameserver(s) to use
node['resolvconf']['search'] = node['domain'] # Set domains to search
node['resolvconf']['domain'] = 'custom.com' # Defaults to node['domain']
node['resolvconf']['options'] = [] # Set options
node['resolvconf']['sortlist'] = ['130.155.160.0/255.255.240.0 130.155.0.0'] # Default is empty

These attributes specify strings that are included in /etc/resolv.conf at head/body/tail.

node['resolvconf']['head'] = [
  '# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)',
  '#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN'
]
node['resolvconf']['base'] = []
node['resolvconf']['tail'] = []

By default, the recipe removes any dns-* configuration lines from /etc/network/interfaces,
as they might interferre with the configured settings.

node['resolvconf']['clear-dns-from-interfaces'] = true

Provider

resolvconf

The LWRP basically supports all options that can be set via attributes, and uses the same defaults.
It will do the following

  • It will create the necessary files in /etc/resolvconf/resolv.conf.d/
  • Remove dns-* lines from /etc/network/interfaces (unless clear_dns_form_interfaces is specified)
  • Run 'resolvconf -u'

Before using the provider, you probably want to ensure that the resolvconf package is installed.

include_recipe 'resolvconf::install'

Example:

resolvconf 'default'
resolvconf 'custom' do
  nameserver '8.8.8.8'
  search     'mydomain.com'
  domain     'mydomain.com'
  options    'rotate'
  sortlist   'mysortlist'

  head       "# Don't touch this configuration file!"
  base       "# Will be added after nameserver, search, options config items"
  tail       "# This goes to the end of the file."

  # do not touch my interface configuration plz!
  clear_dns_from_interfaces false
end

Recipes

resolvconf:install

Installs the resolvconf package.

resolvconf::default

Includes resolvconf::install, then configures the node using the specified attributes / defaults.

Contributing

Contributions are very welcome!

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Chris Aumann me@chr4.org

License: GPLv3

CHANGELOG for resolvconf

This file is used to list changes made in each version of resolvconf.

0.2.3:

  • Add support for sortlist and domain settings

0.2.2:

  • Remove a workaround for force_unlink, fix was merged in Chef 11.12.0
  • Clear /run/resolvconf/interface/ directory before updating /etc/resolv.conf, to prevent deprecated entries from ending up in the file

0.2.1:

0.2.0:

  • Remove potential symlinks before deploying new configuration

0.1.1:

  • Add tests (using kitchen, see TESTING.md)
  • Run resolvconf --enable-updates before resolvconf -u (when supported)
  • Use Chef::Util::FileEdit instead of execute() and sed

0.1.0:

  • Initial release of resolvconf

Foodcritic Metric
            

0.2.3 passed this metric