cookbook 'resolver', '= 1.2.0'
resolver
(33) Versions
1.2.0
-
Follow60
Configures /etc/resolv.conf via attributes
cookbook 'resolver', '= 1.2.0', :supermarket
knife supermarket install resolver
knife supermarket download resolver
resolver Cookbook
Configures /etc/resolv.conf, unless the nameservers attribute is empty. Search will be excluded if empty.
Attributes
See attributes/default.rb
for default values.
-
node['resolver']['search']
- the search domain to use -
node['resolver']['nameservers']
- Required, an array of nameserver IP address strings; the default is an empty array, and the default recipe will not change resolv.conf if this is not set. See Usage. -
node['resolver']['options']
- a hash of resolv.conf options. See Usage for examples.
Recipes
Use one of the recipes to set up /etc/resolv.conf for your system(s).
default
Configure /etc/resolv.conf based on attributes.
from_server_role
Configure /etc/resolv.conf's nameservers based on a search for a specific role (by Chef environment).
Usage
Using the default recipe, set the resolver attributes in a role, for example from my base.rb:
"resolver" => { "nameservers" => ["10.13.37.120", "10.13.37.40"], "search" => "int.example.org", "options" => { "timeout" => 2, "rotate" => nil } }
The resulting /etc/resolv.conf
will look like:
search int.example.org nameserver 10.13.37.120 nameserver 10.13.37.40 options timeout:2 rotate
Using the from_server_role
recipe, assign the node['resolver']['server_role']
attribute's role to a system that is the DNS resolver in the same Chef environment.
License & Authors
- Author:: Joshua Timberman (joshua@opscode.com)
Copyright 2009-2012, Opscode, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
v1.2.0 (2014-10-16)
- [#11] Improve safety and sanity of cookbook
- [#12] README update
- [#14] Exclude search in template if attribute is empty
v1.1.4
Improvement
- COOK-3375 - Add Solaris support
v1.1.2
Bug
- [COOK-2977]: resolver cookbook has foodcritic failures
v1.1.0
- [COOK-1242] - collect nameservers using a server role, adds
from_server_role
recipe
v1.0.2
- 'node' went missing in the template.
v1.0.0
- [COOK-1089] - accept resolver options via attributes
- [COOK-1109] - return from resolver recipe if no nameserver attribute is set so resolv.conf doesn't get broken during the run
- [COOK-1150] - drop the empty element from the nameserver attribute array
Foodcritic Metric
1.2.0 failed this metric
FC003: Check whether you are running with chef server before using server-specific features: /tmp/cook/8de6f4b607d72d6dfdfb1049/resolver/recipes/from_server_role.rb:21
1.2.0 failed this metric