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

bind-grid (3) Versions 0.1.0

Installs/Configures BIND

Policyfile
Berkshelf
Knife
cookbook 'bind-grid', '= 0.1.0', :supermarket
cookbook 'bind-grid', '= 0.1.0'
knife supermarket install bind-grid
knife supermarket download bind-grid
README
Dependencies
Changelog
Quality 67%

bind-grid Cookbook

This cookbook sets up BIND server.

Contents

Requirements

Platforms

  • Debian, Ubuntu

Cookbooks

  • None.

Attributes

Key Type Description, example Default
['bind-grid']['role'] String 'master' or 'slave' 'master'
['bind-grid']['acl'] Hash acl statements. See attribute/default.rb
['bind-grid']['acl']['internal'] Array Predefined internal acl. ['127.0.0.1']
['bind-grid']['extra_statements'] String Your arbitrary statements string. ''
['bind-grid']['options']['directory'] String '/var/cache/bind'
['bind-grid']['options']['listen-on'] String IP v4 listen configurarions ''
['bind-grid']['options']['listen-on']['port'] String '53'
['bind-grid']['options']['listen-on']['ipaddresses'] Array [] (= ['127.0.0.1', node['ipaddress']])
['bind-grid']['options']['listen-on-v6'] String IP v6 listen configurarions ''
['bind-grid']['options']['listen-on-v6']['port'] String '53'
['bind-grid']['options']['listen-on-v6']['ipaddresses'] Array 'any' or 'none' [] (= 'none')
['bind-grid']['options']['auth-nxdomain'] String 'no'
['bind-grid']['options']['allow-query'] Array ['internal']
['bind-grid']['options']['recursion'] String 'yes'
['bind-grid']['options']['allow-recursion'] Array ['internal']
['bind-grid']['options']['allow-transfer'] Array []
['bind-grid']['options']['forwarders'] Array []
['bind-grid']['options']['extra_statements'] String Your arbitrary options statements string. ''
['bind-grid']['zone']['files'] Array e.g. ['db.192.168.1', 'db.example.com'] []
['bind-grid']['zone'] ... Hash Optional: Zone file's common settings.
['bind-grid']['zone']['SOA']['MNAME'] String e.g. dns.example.com ''
['bind-grid']['zone']['SOA']['RNAME'] String e.g. root.example.com ''
['bind-grid']['zone']['NS'] Array e.g. ['dns.example.com'] []
['bind-grid']['zone']['masters'] String e.g. ['192.168.1.53'] ''
['bind-grid']['zone']['allow-transfer'] String e.g. ['192.168.1.54'] ''

Usage

Recipes

bind-grid::default

This recipe is the same as bind-grid::bind.

bind-grid::bind

This recipe sets up BIND server.

Add your customized zone files by wrapper cookbook

  • Create a wrapper cookbook (e.g. bind-wrapper).

  • metadata.rb: add the bind-grid dependency.

# ...
depends          'bind-grid'
  • Add your zone file templates to the directory templates/default/var/cache/bind

  • attributes/default.rb: add the zone file list to the ['bind-grid']['zone']['files'] attribute.

default['bind-grid']['zone'] = {
  'files' => [
    'db.192.168.1',
    'db.example.com',
  ],
  # options
  'SOA' => {
    'MNAME' => 'dns.example.com',
    'RNAME' => 'root.example.com',
  },
  'NS' => [
    'dns.example.com',
  ],
  'masters' => [
    '192.168.1.53',
  ],
  'allow-transfer' => [
    '192.168.1.54',
  ],
}
  • recipes/bind.rb: override the bind recipe.
base_cookbook = 'bind-grid'
this_cookbook = 'bind-wrapper'

node.from_file(run_context.resolve_attribute(base_cookbook, 'default'))
include_recipe "#{base_cookbook}::bind"

if node['bind-grid']['role'] == 'master'
  zone_dir = node['bind-grid']['options']['directory']

  # override zone files.
  node['bind-grid']['zone']['files'].each {|db_file|
    res = resources(template: "#{zone_dir}/#{db_file}")
    res.cookbook this_cookbook
  }
end

Role Examples

  • roles/bind.rb
name 'bind'
description 'BIND server'

run_list(
  'recipe[bind-wrapper::bind]',
)

override_attributes(
  'bind-grid' => {
    'role' => 'master',  # or 'slave'
    'acl' => {
      'internal' => [
        '127.0.0.1',
        '192.168.1.0/24',
      ],
    },
    'options' => {
      'forwarders' => [
        '8.8.8.8',
        '8.8.4.4',
      ],
    },
    'zone' => {
      'SOA' => {
        'MNAME' => 'dns.example.com',
        'RNAME' => 'root.example.com',
      },
      'NS' => [
        'dns.example.com',
      ],
      'masters' => [
        '192.168.1.53',
      ],
      'allow-transfer' => [
        '192.168.1.54',
      ],
    },
  },
)

License and Authors

  • Author:: whitestar at osdn.jp
Copyright 2017, whitestar

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

There are no cookbooks that are contingent upon this one.

bind-grid CHANGELOG

0.1.0

  • Initial release of bind-grid

Collaborator Number Metric
            

0.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Foodcritic Metric
            

0.1.0 passed this metric

License Metric
            

0.1.0 passed this metric