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

RSS

dhcp-wrapper (4) Versions 1.3.0

Wrapper around dhcp cookbook

Berkshelf/Librarian
Policyfile
Knife
cookbook 'dhcp-wrapper', '~> 1.3.0'
cookbook 'dhcp-wrapper', '~> 1.3.0', :supermarket
knife cookbook site install dhcp-wrapper
knife cookbook site download dhcp-wrapper
README
Dependencies
Changelog
Quality 44%

DHCP Wrapper

Description

Install and configure ISC DHCP by wrapping cookbook dhcp.

Can also configure network interfaces by the use of cookbook network_interfaces_v2, for instance to set a static address at the server and dhcp for the clients.

Requirements

Cookbooks

Declared in metadata.rb and in Gemfile.

Platforms

  • RHEL Family 7, tested on Centos

Note: it should work fine on Debian 8 but the official docker image does not allow systemd to work easily, so it could not be tested.

Usage

Easy Setup

Add recipe[dhcp-wrapper::server] in your run-list to install and configure DHCPD. Configuration will be fetched from attributes node['dhcp']. See cookbook dhcp documentation for more information.

Add recipe[dhcp-wrapper::client] to install a dhcp client.

Add recipe[dhcp-wrapper::network_interface] to configure your network interfaces. Configuration is fetched from attributes node['dhcp-wrapper']['network-interface'] which should match those of provider network_interface.

To see an example, look at .kitchen.yml.

Test

This cookbook is fully tested through the installation of a server and a node in docker hosts. This uses kitchen, docker and some monkey-patching.

If you run kitchen list, you will see 2 suites, Each corresponds to a different server:

  • server-centos-7: DHCPD server listening on eth1
  • node-centos-7: generic node with eth1 configured in dhcp

For more information, see .kitchen.yml and test directory.

Attributes

Configuration is done by overriding default attributes. All configuration keys have a default defined in attributes/default.rb. Please read it to have a comprehensive view of what and how you can configure this cookbook behavior.

Specific configuration (client or server)

To allow clients and servers to share a same role, it is possible to define specific configuration keys applicable to one of the status (client or server).

Specific configurations can be any of the attributes defined in attributes/default.rb but in either "client-config" or "server-config" sub-tree.

A node is declared as server if its FQDN is included in attribute node['dhcp-wrapper']['servers'] defined as an array. Else, it is considered as a client.

Recipes

default

Call init and then, following the node status, call client or server recipe.

init

Determine if the current machine is a server or a client. Write the result in run_state['dhcp-wrapper']['status']. Then merge default and specific (client or server) configurations and store the result in run_state['dhcp-wrapper']['config'].

Note: init is included in all recipes.

client

Install dhclient package.

server

Proxy for dhcp::server recipe. Please look at .kitchen.yml and dhcp documentation for more information.

network_interface

Call network_interface_rhel provider based on attributes node['dhcp-wrapper']['network-interface']. See .kitchen.yml and cookbook network_interface_v2 for more information.

Create static routes based on node['dhcp-wrapper']['routes'] attribute.

Resources/Providers

None.

Changelog

Available in CHANGELOG.

Contributing

Please read carefully CONTRIBUTING.md before making a merge request.

License and Author

Copyright (c) 2015-2016 Sam4Mobile

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

network_interfaces_v2 >= 0.0.0
dhcp >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Changelog ========= 1.3.0 ----- Main: - Allow clients and servers to share the same role with specific options + Add an init recipe which initialize the configuration + Modify default to choose between client and server recipe + Call network_interface in client and server recipes + client specific configurations should be in 'client-config' and servers in 'server-config'. + the servers should be defined with 'servers' key - Rename network-interface to network_interface: breaking change for users using it directly (very unlikely) - Switch to docker_cli, use prepared docker image + Switch kitchen driver from docker to docker_cli + Use sbernard/centos-systemd-kitchen image instead of bare centos + Remove many monkey patches + No more need to have sudo access anymore: pipework is gone :) + Remove privileged mode :), use --cap-add=NET_ADMIN instead + create a docker network: kitchen-dhcp, which is to be controled by the dhcp server Misc: - Fix and improve tests + Modify test cases to test specific option behavior + Latest dhcp and strengthen ip check - Improve doc, explain specific conf and update it - Fix all rubocop offenses 1.2.0 ----- - Fix idempotency by removing the block hack in network-interface recipe - Reorganize README: + Move changelog from README to CHANGELOG + Move contribution guide to CONTRIBUTING.md + Reorder README, fix Gemfile missing - Add Apache 2 license file 1.1.0 ----- - Add support for static routes 1.0.0 ----- - Initial version with Centos 7 support

Collaborator Number Metric
            

1.3.0 failed this metric

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

Contributing File Metric
            

1.3.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
            

1.3.0 failed this metric

FC066: Ensure chef_version is set in metadata: dhcp-wrapper/metadata.rb:1
FC069: Ensure standardized license defined in metadata: dhcp-wrapper/metadata.rb:1
Run with Foodcritic Version 12.2.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

1.3.0 passed this metric

No Binaries Metric
            

1.3.0 passed this metric

Publish Metric
            

1.3.0 passed this metric

Supported Platforms Metric
            

1.3.0 passed this metric

Testing File Metric
            

1.3.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
            

1.3.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