cookbook 'dhcp', '= 8.0.0'
Installs and configures DHCP
cookbook 'dhcp', '= 8.0.0', :supermarket
knife supermarket install dhcp
knife supermarket download dhcp
Installs and configures ISC DHCP server in both DHCP and DHCPv6 mode.
- Supports setting up Master/Slave ISC DHCP failover (IPv4 only).
- Includes Support for DDNS
- Includes resources for managing:
- Package installation
- Service configuration and management
- Global configuration
- Shared subnets
Version 7.0.0 constitutes a major change and rewrite, please see [UPGRADING.md](./UPGRADING.md).
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
- Debian / Ubuntu
- RHEL/CentOS and derivatives
- Fedora and derivatives
- Chef 14+
It is recommended to create a project or organization specific wrapper cookbook and add the desired custom resources to the run list of a node.
Example of a basic server listening on and issuing leases for the subnet
dhcp_install 'isc-dhcp-server' dhcp_service 'dhcpd' do ip_version :ipv4 action [:create, :enable, :start] end dhcp_config '/etc/dhcp/dhcpd.conf' do allow %w(booting bootp unknown-clients) parameters( 'default-lease-time' => 7200, 'max-lease-time' => 86400, 'update-static-leases' => true, 'one-lease-per-client' => true, 'authoritative' => '', 'ping-check' => true ) options( 'domain-name' => '"test.domain.local"', 'domain-name-servers' => '184.108.40.206, 220.127.116.11' ) action :create end dhcp_subnet '192.0.2.0' do comment 'Basic Subnet Declaration' subnet '192.0.2.0' netmask '255.255.255.0' options [ 'routers 192.168.1.1', ] pool( 'peer' => '192.168.0.2', 'range' => '192.168.1.100 192.168.1.200' ) parameters( 'ddns-domainname' => '"test.domain"' ) end
Please check for more varied working examples in the [test cookbook](./test/cookbooks/test/).
This project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
This cookbook has no specified dependencies.
8.0.0 - 2021-05-12
- Chef 17 compatibility changes - @bmhughes
- All resources now run with
- All resources now run with
7.3.0 - 2021-03-30
- Fix generating multiple actions from the service resource - @bmhughes
7.2.1 - 2020-11-19
- Enhance the pre-service action configuration test to remove compile/converge bug - @bmhughes
- resolved cookstyle error: libraries/helpers.rb:120:44 refactor:
- resolved cookstyle error: libraries/helpers.rb:154:24 refactor:
- resolved cookstyle error: libraries/helpers.rb:161:14 refactor:
- resolved cookstyle error: libraries/helpers.rb:193:44 refactor:
- Fix the service resource not using the unit file content property
- Slightly simplified the libraries with a platform helper
- Fix verification of the isc-dhcp-server configuration on Ubuntu
- Ensure that a service restart does not occur upon a configuration test failure
- Fix configuration test running every chef run regardless of service action - @bmhughes
- Add configuration test option to the
dhcp_serviceresource - @bmhughes
Version 7.0.0 is a major change! Please see [UPGRADING.md](./UPGRADING.md).
- DHCPv6 server configuration support - @bmhughes
- Migrated to github actions - @Xorima
- Remodel cookbook as resource library - @bmhughes
- Remove - @bmhughes
- Data bag functionality
- Add resources to manage install and services for dhcpd/dhcpd6 - @bmhughes
- Rewrite resources to current standard removing pure ruby code - @bmhughes
- Added ability to add extra custom lines to pool config https://github.com/sous-chefs/dhcp/issues/117
- Converted all LWRPs to Custom Resources
- Ran latest cookstyle fixes
- Migrated testing to circleci
- Remove matchers. Breaking change. This requires ChefDK 2.0+
- Allow specifying array of
- Convert to custom resources
- Drop support for Chef 12
- Add support for Fedora
- Use Berkshelf instead of Policyfiles
- Remove support for RHEL5
- Use dokken images for travis testing
- Require Chef 12.7+ for
- Remove Chef 10/11 compatibility code that resulted in Foodcritic deprecation warnings
- Fix misplaced closing brace for dhcpd hooks in template file
- Fix: attribute breaking Chef 13 runs.
- Added hooks
- bug #67: Removed blank? from helper libraries but was still calling in code. Addressed by removing blank? calls from code and using empty? instead.
- bug: Update
- Remove dependencies on helper cookbooks
- Allow specifying with
node['dhcp']['extra_files']externally managed configs to load
- bug: Load classes before subnets
- bug: Include classes.d/list.conf in dhcp.conf
- bug: Make
dhcp_subnetnames declared in
- bug: Pin partial templates to dhcp cookbook
BREAKING feature: Allow defining multiple pools in a subnet
- This moves
dhcp_subnetblock to embedded
dhcp_subnet. See updated examples.
- Currently this DOES NOT break defining subnets via data_bags or node attributes
- This moves
- bug: Allow defining dhcp_class with no subclasses
- improve: Add dhcp_class ChefSpec matcher
- feature: dhcp_class provider
- fix: be able to declare a blank subnet inside a shared-network
- feature: dhcp_shared_network provider to define subnets inside a shared-network block
- improve: allowing as blank as possible of a subnet block
- improve: setting next-server in a subnet block
- improve: allow dhcp_subnet range to be set with a String
- improve: documentation
- fix: including dhcp_host config files
- fix: Chef 12 support
- fix/improve: testing
- feature: allow setting multiple ranges in subnets. The range param now HAS to be an array, existing cooks will not work.
- improve: hostname in group configs is no long forced instead you can specify this in paramaters you pass.
- fix: Debian system have Chef with version Chef: 11.10.0.rc.1 that Chef::Version doesn't detect correctly
- fix: handle case where peer is unavailable on cluster start
- improve: better chef-solo support
- feature: Allow setting slaves and masters in attributes.
- feature: Added ability to pass eval into subnets
- support attribute driven mode, where no databags are needed to operate
- feature: add evals to groups
- fix error in subnet provider caused by mis-merged comma :(
- change write_config to write_include, write_config doesn't work on ubuntu 12.04
- allow you to set ddns-domainname for each subnet
- convert "not if"'s to "unles"
- Cleanup Readme for readability and attribution
- update contributors
- add tailor cane, kitchen testing
- chef specs for chefspec 3.0
- allow ddns update in subnet (pull request #13 from simonjohansson)
- fixes for chef11 compatibility
- fix version check in DSL condition
- update service notifications to new format
- Initial public release
- Restructure entire cookbook for better reusability
- Remove Internal/non-public dependencies
- Fix: master/slave replication issues
- Fix: LWRP notification method
- Add minimal spec's for libraries
- New: examples directory with databags and environments
- New: configurable bag lookups for dhcp/dns bags
- New: Group host list support
- New: Defaults to mac address as hostname for non registered clients
- New: Defines global defaults in default attributes