From c7a01faed65f8f52cf163894c5d88e9f3899abae Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Tue, 9 Jul 2024 12:53:13 +0100 Subject: [PATCH] Implement per-resource sorting (#25) --- CHANGELOG.md | 2 ++ metadata.rb | 2 +- resources/config_dhcp4_client_class.rb | 2 +- resources/config_dhcp4_global_host_reservation.rb | 1 + resources/config_dhcp4_hooks_library.rb | 1 + resources/config_dhcp4_loggers.rb | 1 + resources/config_dhcp4_loggers_output.rb | 1 + resources/config_dhcp4_option_data.rb | 1 + resources/config_dhcp4_option_def.rb | 1 + resources/config_dhcp4_shared_network.rb | 1 + resources/config_dhcp4_shared_network_option_data.rb | 1 + resources/config_dhcp4_shared_network_subnet.rb | 1 + resources/config_dhcp4_shared_network_subnet_option_data.rb | 1 + resources/config_dhcp4_shared_network_subnet_pool.rb | 1 + resources/config_dhcp4_subnet.rb | 1 + resources/config_dhcp4_subnet_host_reservation.rb | 1 + resources/config_dhcp4_subnet_host_reservation_option_data.rb | 1 + resources/config_dhcp4_subnet_option_data.rb | 1 + resources/config_dhcp4_subnet_pool.rb | 1 + resources/config_dhcp4_subnet_pool_option_data.rb | 1 + resources/config_dhcp6_client_class.rb | 2 +- resources/config_dhcp6_config_control_config_database.rb | 1 + resources/config_dhcp6_global_host_reservation.rb | 3 ++- resources/config_dhcp6_hooks_library.rb | 1 + resources/config_dhcp6_loggers.rb | 1 + resources/config_dhcp6_loggers_output.rb | 1 + resources/config_dhcp6_option_data.rb | 1 + resources/config_dhcp6_option_def.rb | 1 + resources/config_dhcp6_shared_network.rb | 1 + resources/config_dhcp6_shared_network_option_data.rb | 1 + resources/config_dhcp6_shared_network_subnet.rb | 1 + resources/config_dhcp6_shared_network_subnet_option_data.rb | 1 + resources/config_dhcp6_shared_network_subnet_pd_pool.rb | 1 + resources/config_dhcp6_shared_network_subnet_pool.rb | 1 + resources/config_dhcp6_subnet.rb | 1 + resources/config_dhcp6_subnet_host_reservation.rb | 1 + resources/config_dhcp6_subnet_host_reservation_option_data.rb | 1 + resources/config_dhcp6_subnet_option_data.rb | 1 + resources/config_dhcp6_subnet_pd_pool.rb | 1 + resources/config_dhcp6_subnet_pool.rb | 1 + resources/config_dhcp6_subnet_pool_option_data.rb | 1 + resources/config_dhcp6_subnet_prefix_delegation.rb | 1 + resources/config_dhcp_ddns_forward_ddns_domain.rb | 1 + resources/config_dhcp_ddns_hooks_library.rb | 1 + resources/config_dhcp_ddns_loggers.rb | 1 + resources/config_dhcp_ddns_loggers_output.rb | 1 + resources/config_dhcp_ddns_reverse_ddns_domain.rb | 1 + resources/config_dhcp_ddns_tsig_key.rb | 1 + resources/partial/_config_auto_accumulator_kea.rb | 4 ++++ resources/partial/_config_auto_accumulator_stork.rb | 4 ++++ 50 files changed, 58 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c22934..2591dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of isc_kea. ## Unreleased +- Add per-resource sorting for all array based configuration resources + ## 1.5.0 - *2024-07-08* - Add sort functions to `config_dhcp4_client_class` and `config_dhcp6_client_class` diff --git a/metadata.rb b/metadata.rb index 0e4d873..b170a48 100644 --- a/metadata.rb +++ b/metadata.rb @@ -17,5 +17,5 @@ supports 'scientific' supports 'ubuntu' -depends 'chef_auto_accumulator', '~> 0.5' +depends 'chef_auto_accumulator', '~> 0.6' depends 'yum-epel', '~> 4.1' diff --git a/resources/config_dhcp4_client_class.rb b/resources/config_dhcp4_client_class.rb index 47188b7..d3a2bba 100644 --- a/resources/config_dhcp4_client_class.rb +++ b/resources/config_dhcp4_client_class.rb @@ -26,7 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 client-classes), config_path_type: :array, - config_path_sort_function: [:fetch, 'name'], + config_path_sort_keys: %w(name), config_match: { 'name' => class_name, }, diff --git a/resources/config_dhcp4_global_host_reservation.rb b/resources/config_dhcp4_global_host_reservation.rb index f06a26f..ad48529 100644 --- a/resources/config_dhcp4_global_host_reservation.rb +++ b/resources/config_dhcp4_global_host_reservation.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 reservations), config_path_type: :array, + config_path_sort_keys: %w(ip_address), config_match: { 'ip_address' => ip_address, }, diff --git a/resources/config_dhcp4_hooks_library.rb b/resources/config_dhcp4_hooks_library.rb index 603399e..635f1db 100644 --- a/resources/config_dhcp4_hooks_library.rb +++ b/resources/config_dhcp4_hooks_library.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 hooks-libraries), config_path_type: :array, + config_path_sort_keys: %w(library), config_match: { 'library' => library, }, diff --git a/resources/config_dhcp4_loggers.rb b/resources/config_dhcp4_loggers.rb index 1c84be5..257ba9d 100644 --- a/resources/config_dhcp4_loggers.rb +++ b/resources/config_dhcp4_loggers.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 loggers), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => logger_name, }, diff --git a/resources/config_dhcp4_loggers_output.rb b/resources/config_dhcp4_loggers_output.rb index 7bb1470..0746db8 100644 --- a/resources/config_dhcp4_loggers_output.rb +++ b/resources/config_dhcp4_loggers_output.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(logger_name), config_path_override: %w(Dhcp4 loggers), config_path_type: :array_contained, + config_path_sort_keys: %w(library), config_path_match_key: 'name', config_path_match_value: logger_name, config_path_contained_key: 'output_options', diff --git a/resources/config_dhcp4_option_data.rb b/resources/config_dhcp4_option_data.rb index 89bcaa0..974581b 100644 --- a/resources/config_dhcp4_option_data.rb +++ b/resources/config_dhcp4_option_data.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 option-data), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => option_name, 'code' => code, diff --git a/resources/config_dhcp4_option_def.rb b/resources/config_dhcp4_option_def.rb index 77b7173..b1c3c71 100644 --- a/resources/config_dhcp4_option_def.rb +++ b/resources/config_dhcp4_option_def.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 option-def), config_path_type: :array, + config_path_sort_keys: %w(code name), config_match: { 'name' => option_name, 'code' => code, diff --git a/resources/config_dhcp4_shared_network.rb b/resources/config_dhcp4_shared_network.rb index ed91354..b624c2b 100644 --- a/resources/config_dhcp4_shared_network.rb +++ b/resources/config_dhcp4_shared_network.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 shared-networks), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => network_name, }, diff --git a/resources/config_dhcp4_shared_network_option_data.rb b/resources/config_dhcp4_shared_network_option_data.rb index d185c26..be54474 100644 --- a/resources/config_dhcp4_shared_network_option_data.rb +++ b/resources/config_dhcp4_shared_network_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name), config_path_override: %w(Dhcp4 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: 'name', config_path_match_value: shared_network_name, config_path_contained_key: 'option-data', diff --git a/resources/config_dhcp4_shared_network_subnet.rb b/resources/config_dhcp4_shared_network_subnet.rb index d0f450e..2f204b1 100644 --- a/resources/config_dhcp4_shared_network_subnet.rb +++ b/resources/config_dhcp4_shared_network_subnet.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name), config_path_override: %w(Dhcp4 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(subnet), config_path_match_key: 'name', config_path_match_value: shared_network_name, config_path_contained_key: 'subnet4', diff --git a/resources/config_dhcp4_shared_network_subnet_option_data.rb b/resources/config_dhcp4_shared_network_subnet_option_data.rb index 3979b3b..7611fab 100644 --- a/resources/config_dhcp4_shared_network_subnet_option_data.rb +++ b/resources/config_dhcp4_shared_network_subnet_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name subnet), config_path_override: %w(Dhcp4 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(name subnet), config_path_match_value: [ shared_network_name, subnet ], config_path_contained_key: %w(subnet4 option-data), diff --git a/resources/config_dhcp4_shared_network_subnet_pool.rb b/resources/config_dhcp4_shared_network_subnet_pool.rb index 7beff42..d7f4b8b 100644 --- a/resources/config_dhcp4_shared_network_subnet_pool.rb +++ b/resources/config_dhcp4_shared_network_subnet_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet shared_network_name), config_path_override: %w(Dhcp4 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(pool), config_path_match_key: %w(name subnet), config_path_match_value: [ shared_network_name, subnet ], config_path_contained_key: %w(subnet4 pools), diff --git a/resources/config_dhcp4_subnet.rb b/resources/config_dhcp4_subnet.rb index 20daab8..f085d43 100644 --- a/resources/config_dhcp4_subnet.rb +++ b/resources/config_dhcp4_subnet.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp4 subnet4), config_path_type: :array, + config_path_sort_keys: %w(id subnet), config_match: { 'subnet' => subnet, 'id' => id, diff --git a/resources/config_dhcp4_subnet_host_reservation.rb b/resources/config_dhcp4_subnet_host_reservation.rb index aaef8c1..7fe56af 100644 --- a/resources/config_dhcp4_subnet_host_reservation.rb +++ b/resources/config_dhcp4_subnet_host_reservation.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp4 subnet4), config_path_type: :array_contained, + config_path_sort_keys: %w(ip_address), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_match: { diff --git a/resources/config_dhcp4_subnet_host_reservation_option_data.rb b/resources/config_dhcp4_subnet_host_reservation_option_data.rb index 7e070fa..e54a132 100644 --- a/resources/config_dhcp4_subnet_host_reservation_option_data.rb +++ b/resources/config_dhcp4_subnet_host_reservation_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet ip_address), config_path_override: %w(Dhcp4 subnet4), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(subnet ip-address), config_path_match_value: [ subnet, ip_address ], config_path_contained_key: %w(reservations option-data), diff --git a/resources/config_dhcp4_subnet_option_data.rb b/resources/config_dhcp4_subnet_option_data.rb index e5b5228..e4bc2e4 100644 --- a/resources/config_dhcp4_subnet_option_data.rb +++ b/resources/config_dhcp4_subnet_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp4 subnet4), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'option-data', diff --git a/resources/config_dhcp4_subnet_pool.rb b/resources/config_dhcp4_subnet_pool.rb index be2b817..b871d07 100644 --- a/resources/config_dhcp4_subnet_pool.rb +++ b/resources/config_dhcp4_subnet_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp4 subnet4), config_path_type: :array_contained, + config_path_sort_keys: %w(pool), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'pools', diff --git a/resources/config_dhcp4_subnet_pool_option_data.rb b/resources/config_dhcp4_subnet_pool_option_data.rb index 74de0c4..2f5e96f 100644 --- a/resources/config_dhcp4_subnet_pool_option_data.rb +++ b/resources/config_dhcp4_subnet_pool_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet pool), config_path_override: %w(Dhcp4 subnet4), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(subnet pool), config_path_match_value: [ subnet, pool ], config_path_contained_key: %w(pools option-data), diff --git a/resources/config_dhcp6_client_class.rb b/resources/config_dhcp6_client_class.rb index 3c341ba..4a33f7a 100644 --- a/resources/config_dhcp6_client_class.rb +++ b/resources/config_dhcp6_client_class.rb @@ -26,7 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 client-classes), config_path_type: :array, - config_path_sort_function: [:fetch, 'name'], + config_path_sort_keys: %w(name), config_match: { 'name' => class_name, }, diff --git a/resources/config_dhcp6_config_control_config_database.rb b/resources/config_dhcp6_config_control_config_database.rb index 8c3b2ae..e36f6a2 100644 --- a/resources/config_dhcp6_config_control_config_database.rb +++ b/resources/config_dhcp6_config_control_config_database.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 config-control config-databases), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => database_name, }, diff --git a/resources/config_dhcp6_global_host_reservation.rb b/resources/config_dhcp6_global_host_reservation.rb index 5b7ca29..9272028 100644 --- a/resources/config_dhcp6_global_host_reservation.rb +++ b/resources/config_dhcp6_global_host_reservation.rb @@ -27,8 +27,9 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 reservations), config_path_type: :array, + config_path_sort_keys: %w(ip_addresses), config_match: { - 'ip_address' => ip_address, + 'ip_addresses' => ip_addresses, }, permit_nil_properties: true, }.freeze diff --git a/resources/config_dhcp6_hooks_library.rb b/resources/config_dhcp6_hooks_library.rb index af94feb..85529f9 100644 --- a/resources/config_dhcp6_hooks_library.rb +++ b/resources/config_dhcp6_hooks_library.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 hooks-libraries), config_path_type: :array, + config_path_sort_keys: %w(library), config_match: { 'library' => library, }, diff --git a/resources/config_dhcp6_loggers.rb b/resources/config_dhcp6_loggers.rb index 71fafe5..f1e4dc9 100644 --- a/resources/config_dhcp6_loggers.rb +++ b/resources/config_dhcp6_loggers.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 loggers), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => logger_name, }, diff --git a/resources/config_dhcp6_loggers_output.rb b/resources/config_dhcp6_loggers_output.rb index 1c38b64..5ab6303 100644 --- a/resources/config_dhcp6_loggers_output.rb +++ b/resources/config_dhcp6_loggers_output.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(logger_name), config_path_override: %w(Dhcp6 loggers), config_path_type: :array_contained, + config_path_sort_keys: %w(library), config_path_match_key: 'name', config_path_match_value: logger_name, config_path_contained_key: 'output_options', diff --git a/resources/config_dhcp6_option_data.rb b/resources/config_dhcp6_option_data.rb index c353a08..9a2f01c 100644 --- a/resources/config_dhcp6_option_data.rb +++ b/resources/config_dhcp6_option_data.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 option-data), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => option_name, 'code' => code, diff --git a/resources/config_dhcp6_option_def.rb b/resources/config_dhcp6_option_def.rb index 4957e62..47d1327 100644 --- a/resources/config_dhcp6_option_def.rb +++ b/resources/config_dhcp6_option_def.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 option-def), config_path_type: :array, + config_path_sort_keys: %w(code name), config_match: { 'name' => option_name, 'code' => code, diff --git a/resources/config_dhcp6_shared_network.rb b/resources/config_dhcp6_shared_network.rb index 26128b6..8e2820f 100644 --- a/resources/config_dhcp6_shared_network.rb +++ b/resources/config_dhcp6_shared_network.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array, + config_path_sort_keys: %w(name), config_path_match_key: 'name', config_path_match_value: network_name, property_translation_matrix: { diff --git a/resources/config_dhcp6_shared_network_option_data.rb b/resources/config_dhcp6_shared_network_option_data.rb index 604152c..3cebfa3 100644 --- a/resources/config_dhcp6_shared_network_option_data.rb +++ b/resources/config_dhcp6_shared_network_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name), config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: 'name', config_path_match_value: shared_network_name, config_path_contained_key: 'option-data', diff --git a/resources/config_dhcp6_shared_network_subnet.rb b/resources/config_dhcp6_shared_network_subnet.rb index 0c68c11..cace9f2 100644 --- a/resources/config_dhcp6_shared_network_subnet.rb +++ b/resources/config_dhcp6_shared_network_subnet.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name), config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(subnet), config_path_match_key: 'name', config_path_match_value: shared_network_name, config_path_contained_key: 'subnet4', diff --git a/resources/config_dhcp6_shared_network_subnet_option_data.rb b/resources/config_dhcp6_shared_network_subnet_option_data.rb index 18288d2..3aaec49 100644 --- a/resources/config_dhcp6_shared_network_subnet_option_data.rb +++ b/resources/config_dhcp6_shared_network_subnet_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(shared_network_name subnet), config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(name subnet), config_path_match_value: [ shared_network_name, subnet ], config_path_contained_key: %w(subnet6 option-data), diff --git a/resources/config_dhcp6_shared_network_subnet_pd_pool.rb b/resources/config_dhcp6_shared_network_subnet_pd_pool.rb index 654f039..917f0a0 100644 --- a/resources/config_dhcp6_shared_network_subnet_pd_pool.rb +++ b/resources/config_dhcp6_shared_network_subnet_pd_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(pool), config_path_match_key: %w(name subnet), config_path_match_value: [ shared_network_name, subnet ], config_path_contained_key: %w(subnet6 pd-pools), diff --git a/resources/config_dhcp6_shared_network_subnet_pool.rb b/resources/config_dhcp6_shared_network_subnet_pool.rb index ecc42df..9eece70 100644 --- a/resources/config_dhcp6_shared_network_subnet_pool.rb +++ b/resources/config_dhcp6_shared_network_subnet_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet shared_network_name), config_path_override: %w(Dhcp6 shared-networks), config_path_type: :array_contained, + config_path_sort_keys: %w(subnet), config_path_match_key: %w(name subnet), config_path_match_value: [ shared_network_name, subnet ], config_path_contained_key: %w(subnet6 pools), diff --git a/resources/config_dhcp6_subnet.rb b/resources/config_dhcp6_subnet.rb index 3f2fd9d..392c805 100644 --- a/resources/config_dhcp6_subnet.rb +++ b/resources/config_dhcp6_subnet.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override { config_path_override: %w(Dhcp6 subnet6), config_path_type: :array, + config_path_sort_keys: %w(id subnet), config_match: { 'subnet' => subnet, 'id' => id, diff --git a/resources/config_dhcp6_subnet_host_reservation.rb b/resources/config_dhcp6_subnet_host_reservation.rb index fabb324..72693f2 100644 --- a/resources/config_dhcp6_subnet_host_reservation.rb +++ b/resources/config_dhcp6_subnet_host_reservation.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(ip_addresses), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'reservations', diff --git a/resources/config_dhcp6_subnet_host_reservation_option_data.rb b/resources/config_dhcp6_subnet_host_reservation_option_data.rb index 4bb2ea9..f943d90 100644 --- a/resources/config_dhcp6_subnet_host_reservation_option_data.rb +++ b/resources/config_dhcp6_subnet_host_reservation_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet ip_addresses), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(subnet ip-addresses), config_path_match_value: [ subnet, ip_addresses ], config_path_contained_key: %w(reservations option-data), diff --git a/resources/config_dhcp6_subnet_option_data.rb b/resources/config_dhcp6_subnet_option_data.rb index 8d28a14..1298331 100644 --- a/resources/config_dhcp6_subnet_option_data.rb +++ b/resources/config_dhcp6_subnet_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'option-data', diff --git a/resources/config_dhcp6_subnet_pd_pool.rb b/resources/config_dhcp6_subnet_pd_pool.rb index 22457d7..63fbbd6 100644 --- a/resources/config_dhcp6_subnet_pd_pool.rb +++ b/resources/config_dhcp6_subnet_pd_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(prefix), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'pd-pools', diff --git a/resources/config_dhcp6_subnet_pool.rb b/resources/config_dhcp6_subnet_pool.rb index f1398a5..c448440 100644 --- a/resources/config_dhcp6_subnet_pool.rb +++ b/resources/config_dhcp6_subnet_pool.rb @@ -28,6 +28,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(pool), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'pools', diff --git a/resources/config_dhcp6_subnet_pool_option_data.rb b/resources/config_dhcp6_subnet_pool_option_data.rb index 6639d37..fa4898c 100644 --- a/resources/config_dhcp6_subnet_pool_option_data.rb +++ b/resources/config_dhcp6_subnet_pool_option_data.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet pool), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(code name), config_path_match_key: %w(subnet pool), config_path_match_value: [ subnet, pool ], config_path_contained_key: %w(pools option-data), diff --git a/resources/config_dhcp6_subnet_prefix_delegation.rb b/resources/config_dhcp6_subnet_prefix_delegation.rb index 283cc0f..3f3a2d7 100644 --- a/resources/config_dhcp6_subnet_prefix_delegation.rb +++ b/resources/config_dhcp6_subnet_prefix_delegation.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(subnet_id), config_path_override: %w(Dhcp6 subnet6), config_path_type: :array_contained, + config_path_sort_keys: %w(prefix), config_path_match_key: 'subnet', config_path_match_value: subnet, config_path_contained_key: 'reservations', diff --git a/resources/config_dhcp_ddns_forward_ddns_domain.rb b/resources/config_dhcp_ddns_forward_ddns_domain.rb index cdd69db..d1b56b6 100644 --- a/resources/config_dhcp_ddns_forward_ddns_domain.rb +++ b/resources/config_dhcp_ddns_forward_ddns_domain.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(DhcpDdns forward-ddns ddns-domains), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => zone_name, }, diff --git a/resources/config_dhcp_ddns_hooks_library.rb b/resources/config_dhcp_ddns_hooks_library.rb index ff1ece7..f6520c6 100644 --- a/resources/config_dhcp_ddns_hooks_library.rb +++ b/resources/config_dhcp_ddns_hooks_library.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(DhcpDdns hooks-libraries), config_path_type: :array, + config_path_sort_keys: %w(library), config_match: { 'library' => library, }, diff --git a/resources/config_dhcp_ddns_loggers.rb b/resources/config_dhcp_ddns_loggers.rb index def2819..3a82296 100644 --- a/resources/config_dhcp_ddns_loggers.rb +++ b/resources/config_dhcp_ddns_loggers.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(DhcpDdns loggers), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => logger_name, }, diff --git a/resources/config_dhcp_ddns_loggers_output.rb b/resources/config_dhcp_ddns_loggers_output.rb index 3f306c4..926ba81 100644 --- a/resources/config_dhcp_ddns_loggers_output.rb +++ b/resources/config_dhcp_ddns_loggers_output.rb @@ -27,6 +27,7 @@ def auto_accumulator_options_override config_properties_skip: %i(logger_name), config_path_override: %w(DhcpDdns loggers), config_path_type: :array_contained, + config_path_sort_keys: %w(library), config_path_match_key: 'name', config_path_match_value: logger_name, config_path_contained_key: 'output_options', diff --git a/resources/config_dhcp_ddns_reverse_ddns_domain.rb b/resources/config_dhcp_ddns_reverse_ddns_domain.rb index de27e0d..d5c54da 100644 --- a/resources/config_dhcp_ddns_reverse_ddns_domain.rb +++ b/resources/config_dhcp_ddns_reverse_ddns_domain.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(DhcpDdns reverse-ddns ddns-domains), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => zone_name, }, diff --git a/resources/config_dhcp_ddns_tsig_key.rb b/resources/config_dhcp_ddns_tsig_key.rb index 5a2116f..67a319e 100644 --- a/resources/config_dhcp_ddns_tsig_key.rb +++ b/resources/config_dhcp_ddns_tsig_key.rb @@ -26,6 +26,7 @@ def auto_accumulator_options_override { config_path_override: %w(DhcpDdns tsig-keys), config_path_type: :array, + config_path_sort_keys: %w(name), config_match: { 'name' => key_name, }, diff --git a/resources/partial/_config_auto_accumulator_kea.rb b/resources/partial/_config_auto_accumulator_kea.rb index 7d90455..038ac99 100644 --- a/resources/partial/_config_auto_accumulator_kea.rb +++ b/resources/partial/_config_auto_accumulator_kea.rb @@ -52,6 +52,10 @@ property :filemode, String, default: '0644' +property :sort, [true, false], + default: false, + desired_state: false + property :extra_options, Hash, coerce: proc { |p| p.transform_keys(&:to_s) } diff --git a/resources/partial/_config_auto_accumulator_stork.rb b/resources/partial/_config_auto_accumulator_stork.rb index 3f201bd..1f925da 100644 --- a/resources/partial/_config_auto_accumulator_stork.rb +++ b/resources/partial/_config_auto_accumulator_stork.rb @@ -52,6 +52,10 @@ property :filemode, String, default: '0644' +property :sort, [true, false], + default: false, + desired_state: false + property :extra_options, Hash, coerce: proc { |p| p.transform_keys(&:to_s) }