cookbook 'kea-dhcp', '~> 1.2.0', :supermarket
kea-dhcp (3) Versions 1.2.0 Follow0
Install and Configure ISC Kea DHCP server
cookbook 'kea-dhcp', '~> 1.2.0'
knife supermarket install kea-dhcp
knife supermarket download kea-dhcp
Install and configure ISC Kea, a Modern Open Source DHCPv4 & DHCPv6 Server.
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.
- configure an exporter script to expose DHCP client metrics following Prometheus format. Only IP lifetime validity of dynamically assigned network interface currently reported.
Declared in [metadata.rb](metadata.rb) and in [Gemfile](Gemfile).
- RHEL Family 7, tested on Centos
It should be easy to add a new platform.
recipe[kea-dhcp::server] in your run-list to install and configure
Kea. Configuration will be fetched from attributes
node['kea-dhcp']['kea-conf']. It directly follows '/etc/kea/kea.conf' format.
See official documentation for more help.
recipe[kea-dhcp::client] to install a dhcp client.
recipe[kea-dhcp::network_interface] to configure your network
interfaces. Configuration is fetched from attributes
node['kea-dhcp']['network-interface'] which should match those of
To see examples, look at [.kitchen.yml](.kitchen.yml).
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: Kea server listening on eth1
- node-centos-7: generic node with eth1 configured in dhcp
For more information, see [.kitchen.yml](.kitchen.yml) and [test](test) directory.
Configuration is done by overriding default attributes. All configuration keys have a default defined in [attributes/default.rb](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](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['kea-dhcp']['servers'] defined as an array. Else, it is considered
as a client.
Call init and then, following the node status, call client or server recipe.
Determine if the current machine is a server or a client by looking if current
fqdn is included in
node['kea-dhcp']['servers'] (empty by default). Write the
run_state['kea-dhcp']['status']. Then merge default and specific
(client or server) configurations and store the result in
Note: init is included in all recipes.
Install dhclient package.
Meta recipe which includes server_install, server_config and server_service.
Install Kea by from EPEL repository.
/etc/kea/kea.conf from attributes
Start and enable Kea services (like dhcp4, dhcp6, dhcp-ddns) if enabled in
Call network_interface_rhel provider based on
See [.kitchen.yml](.kitchen.yml) and cookbook
network_interface_v2 for more information.
Create static routes based on
Install metrics exporter dhcp-client_exporter.sh as a systemd timer unit.
Available in [CHANGELOG](CHANGELOG).
Please read carefully [CONTRIBUTING.md](CONTRIBUTING.md) before making a merge request.
License and Author
- Author:: Samuel Bernard (firstname.lastname@example.org)
Copyright (c) 2015-2016 Sam4Mobile, 2017-2020 Make.org 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.
|yum-epel >= 0.0.0|
|network_interfaces_v2 >= 0.0.0|
There are no cookbooks that are contingent upon this one.
- fix: set name attribute to memfile
- feat: update default config to match kea-1.6.0
- feat: move logging entry under daemon scope
- feat: separate config file for each service
- feat: do not set exporter on dhcp server
- feat: use yum-epel cookbook for epel
- test: use google dns to fix internal dns in dind
- test: make kitchen.yml config file visible
- test: switch to chefplatform image
- test: include .gitlab-ci.yml from test-cookbook
- test: replace deprecated require_chef_omnibus
- fix: add rspec-core to Gemfile
- fix: accept chef license
Misc: - chore: set generic maintainer & helpdesk email - chore: add supermarket category in .category - doc: use doc in git message instead of docs - chore: set 2020 in copyright notice - style(rubocop): fix multiple offenses
- feat: add prometheus exporter to check ip validity
- use .gitlab-ci.yml template 
- add a linkdelay to improve test resilience
- docs: use karma for git format in contributing
- style(rubocop): fix heredoc delimiters
- Initial version with Centos 7 support importing code from dhcp-wrapper
- Add the installation and configuration of Kea, a modern DHCP server from ISC