From a536d3584ba545a82bf3a86231531ee6f0dbd98f Mon Sep 17 00:00:00 2001 From: "Benjamin M. Hughes" Date: Wed, 12 Jul 2023 20:11:30 +0100 Subject: [PATCH] Kea 2.4 Updates - Update installation packages to cover versions greater than 2.2 - Kitchen test with Kea 2.4 - Updates for Kea 2.4 release - Add `allocator` property to `config_dhcp4` - Add `allocator` and `pd_allocator` property to `config_dhcp6` - Add `template_test` property to `config_dhcp4_client_class` and `config_dhcp6_client_class` --- .github/workflows/ci.yml | 3 ++- CHANGELOG.md | 7 +++++++ libraries/install.rb | 16 ++++++++-------- resources/config_dhcp4.rb | 3 +++ resources/config_dhcp4_client_class.rb | 2 ++ resources/config_dhcp6.rb | 6 ++++++ resources/config_dhcp6_client_class.rb | 2 ++ .../partial/_config_dhcp4_parameters_subnet.rb | 3 +++ .../partial/_config_dhcp6_parameters_subnet.rb | 6 ++++++ test/cookbooks/isc_kea_test/recipes/install.rb | 2 +- 10 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae72ee9..87949b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,9 @@ jobs: - 'centos-stream-9' - 'rockylinux-8' - 'rockylinux-9' - - 'fedora-36' + - 'fedora-38' - 'debian-11' + - 'debian-12' - 'ubuntu-2004' - 'ubuntu-2204' suite: diff --git a/CHANGELOG.md b/CHANGELOG.md index f3804c5..43bd169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ This file is used to list changes made in each version of isc_kea. ## Unreleased +- Update installation packages to cover versions greater than 2.2 +- Kitchen test with Kea 2.4 +- Updates for Kea 2.4 release + - Add `allocator` property to `config_dhcp4` + - Add `allocator` and `pd_allocator` property to `config_dhcp6` + - Add `template_test` property to `config_dhcp4_client_class` and `config_dhcp6_client_class` + ## 1.0.2 - *2023-07-12* ## 1.0.1 - *2023-07-03* diff --git a/libraries/install.rb b/libraries/install.rb index 4759a11..9687045 100644 --- a/libraries/install.rb +++ b/libraries/install.rb @@ -52,6 +52,8 @@ def default_kea_debian_key_url 'https://dl.cloudsmith.io/public/isc/kea-2-2/gpg.A8CB727C62565FF8.key' when '2-3' 'https://dl.cloudsmith.io/public/isc/kea-2-3/gpg.DA05D46B7BABA24A.key' + when '2-4' + 'https://dl.cloudsmith.io/public/isc/kea-2-4/gpg.0D9D9A1439E23DB9.key' else raise ArgumentError, "Unsupported version #{install_version}" end @@ -60,18 +62,16 @@ def default_kea_debian_key_url def default_kea_install_packages case node['platform_family'] when 'amazon', 'fedora', 'rhel' - case install_version.gsub('-', '.').to_f - when 2.3 - %w(isc-kea isc-kea-admin isc-kea-common isc-kea-ctrl-agent isc-kea-devel isc-kea-dhcp-ddns isc-kea-dhcp4 isc-kea-dhcp6 isc-kea-doc isc-kea-hooks isc-kea-perfdhcp) - else + if install_version.gsub('-', '.').to_f <= 2.2 %w(isc-kea isc-kea-devel isc-kea-hooks isc-kea-libs isc-kea-shell) + else + %w(isc-kea isc-kea-admin isc-kea-common isc-kea-ctrl-agent isc-kea-devel isc-kea-dhcp-ddns isc-kea-dhcp4 isc-kea-dhcp6 isc-kea-doc isc-kea-hooks isc-kea-perfdhcp) end when 'debian' - case install_version.gsub('-', '.').to_f - when 2.3 - %w(isc-kea isc-kea-dev isc-kea-perfdhcp) - else + if install_version.gsub('-', '.').to_f <= 2.2 %w(isc-kea-admin isc-kea-common isc-kea-ctrl-agent isc-kea-dev isc-kea-dhcp-ddns-server isc-kea-dhcp4-server isc-kea-dhcp6-server isc-kea-doc) + else + %w(isc-kea isc-kea-dev isc-kea-perfdhcp) end else raise ArgumentError, "Unsupported platform family #{node['platform_family']}" diff --git a/resources/config_dhcp4.rb b/resources/config_dhcp4.rb index 1040421..80d01bf 100644 --- a/resources/config_dhcp4.rb +++ b/resources/config_dhcp4.rb @@ -26,6 +26,9 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4) }.freeze end +property :allocator, String, + equal_to: %w(iterative random flq) + property :authoritative, [true, false] property :boot_file_name, String diff --git a/resources/config_dhcp4_client_class.rb b/resources/config_dhcp4_client_class.rb index 76b4cbb..72732c4 100644 --- a/resources/config_dhcp4_client_class.rb +++ b/resources/config_dhcp4_client_class.rb @@ -40,6 +40,8 @@ def auto_accumulator_options_override property :test, String +property :template_test, String + property :option_def, [Array, Hash], coerce: proc { |p| p.is_a?(Array) ? p.deep_sort : [p.deep_sort] } diff --git a/resources/config_dhcp6.rb b/resources/config_dhcp6.rb index 2545855..52779b6 100644 --- a/resources/config_dhcp6.rb +++ b/resources/config_dhcp6.rb @@ -26,6 +26,9 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6) }.freeze end +property :allocator, String, + equal_to: %w(iterative random) + property :cache_threshold, Integer property :cache_max_age, Integer @@ -77,6 +80,9 @@ def auto_accumulator_options_override property :parked_packet_limit, Integer +property :pd_allocator, String, + equal_to: %w(iterative random flq) + property :preferred_lifetime, Integer property :rapid_commit, String diff --git a/resources/config_dhcp6_client_class.rb b/resources/config_dhcp6_client_class.rb index ffc28c4..6a979bc 100644 --- a/resources/config_dhcp6_client_class.rb +++ b/resources/config_dhcp6_client_class.rb @@ -40,6 +40,8 @@ def auto_accumulator_options_override property :test, String +property :template_test, String + property :option_def, [Array, Hash], coerce: proc { |p| p.is_a?(Array) ? p.deep_sort : [p.deep_sort] } diff --git a/resources/partial/_config_dhcp4_parameters_subnet.rb b/resources/partial/_config_dhcp4_parameters_subnet.rb index 49204a5..53fc92d 100644 --- a/resources/partial/_config_dhcp4_parameters_subnet.rb +++ b/resources/partial/_config_dhcp4_parameters_subnet.rb @@ -17,6 +17,9 @@ # limitations under the License. # +property :allocator, String, + equal_to: %w(iterative random flq) + property :subnet_4o6_interface, String property :subnet_4o6_interface_id, String diff --git a/resources/partial/_config_dhcp6_parameters_subnet.rb b/resources/partial/_config_dhcp6_parameters_subnet.rb index a10baea..79c28eb 100644 --- a/resources/partial/_config_dhcp6_parameters_subnet.rb +++ b/resources/partial/_config_dhcp6_parameters_subnet.rb @@ -17,6 +17,9 @@ # limitations under the License. # +property :allocator, String, + equal_to: %w(iterative random) + property :cache_threshold, [Integer, Float] property :cache_max_age, [Integer, Float] @@ -57,6 +60,9 @@ property :max_valid_lifetime, Integer +property :pd_allocator, String, + equal_to: %w(iterative random flq) + property :preferred_lifetime, Integer property :rapid_commit, [true, false] diff --git a/test/cookbooks/isc_kea_test/recipes/install.rb b/test/cookbooks/isc_kea_test/recipes/install.rb index 8520b7f..b191ae5 100644 --- a/test/cookbooks/isc_kea_test/recipes/install.rb +++ b/test/cookbooks/isc_kea_test/recipes/install.rb @@ -18,6 +18,6 @@ # isc_kea_install 'kea' do - install_version '2.3' + install_version '2.4' action :install end