From 96042e721b55a067252f970a26065e3e14704716 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Sun, 22 Sep 2024 12:22:33 +0200 Subject: [PATCH 1/2] Add new data type for db options --- REFERENCE.md | 34 +++++++++++++++++++++++----------- manifests/init.pp | 8 +------- types/dboptions.pp | 9 +++++++++ 3 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 types/dboptions.pp diff --git a/REFERENCE.md b/REFERENCE.md index 863c8ff..98a3eca 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -24,6 +24,10 @@ Configures IcingaDB * `icingadb::redis::service`: Manage IcingaDB Redis server service * `icingadb::service`: Manage IcingaDB service +### Data types + +* [`IcingaDB::DBOptions`](#IcingaDB--DBOptions) + ## Classes ### `icingadb` @@ -328,17 +332,7 @@ Default value: `undef` ##### `db_options` -Data type: - -```puppet -Hash[Enum[ - 'max_connections', - 'max_connections_per_table', - 'max_placeholders_per_statement', - 'max_rows_per_transaction', - 'wsrep_sync_wait' - ], Integer[1]] -``` +Data type: `IcingaDB::DBOptions` List of low-level database options that can be set to influence some Icinga DB internal default behaviours. @@ -759,3 +753,21 @@ Data type: `Stdlib::Absolutepath` +## Data types + +### `IcingaDB::DBOptions` + +The IcingaDB::DBOptions data type. + +Alias of + +```puppet +Hash[Enum[ + 'max_connections', + 'max_connections_per_table', + 'max_placeholders_per_statement', + 'max_rows_per_transaction', + 'wsrep_sync_wait' + ], Integer[1]] +``` + diff --git a/manifests/init.pp b/manifests/init.pp index 9752057..28a1bda 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -149,13 +149,7 @@ Optional[Stdlib::Absolutepath] $db_tls_cert_file = undef, Optional[Stdlib::Absolutepath] $db_tls_key_file = undef, Optional[Stdlib::Absolutepath] $db_tls_cacert_file = undef, - Hash[Enum[ - 'max_connections', - 'max_connections_per_table', - 'max_placeholders_per_statement', - 'max_rows_per_transaction', - 'wsrep_sync_wait' - ], Integer[1]] $db_options = {}, + IcingaDB::DBOptions $db_options = {}, Stdlib::Host $redis_host = 'localhost', Stdlib::Port $redis_port = 6380, Optional[Icinga::Secret] $redis_password = undef, diff --git a/types/dboptions.pp b/types/dboptions.pp new file mode 100644 index 0000000..db77df7 --- /dev/null +++ b/types/dboptions.pp @@ -0,0 +1,9 @@ +type IcingaDB::DBOptions = Hash[ + Enum[ + 'max_connections', + 'max_connections_per_table', + 'max_placeholders_per_statement', + 'max_rows_per_transaction', + 'wsrep_sync_wait' + ], Integer[1] +] From f16dd61d8e715c267285f3ffcb9dabc7141e7661 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Mon, 23 Sep 2024 12:25:17 +0000 Subject: [PATCH 2/2] Add missing comment to data type DBOptions --- REFERENCE.md | 4 ++-- types/dboptions.pp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 98a3eca..6ad5d57 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -26,7 +26,7 @@ Configures IcingaDB ### Data types -* [`IcingaDB::DBOptions`](#IcingaDB--DBOptions) +* [`IcingaDB::DBOptions`](#IcingaDB--DBOptions): Data type for options to connect the IcingaDB database. ## Classes @@ -757,7 +757,7 @@ Data type: `Stdlib::Absolutepath` ### `IcingaDB::DBOptions` -The IcingaDB::DBOptions data type. +Data type for options to connect the IcingaDB database. Alias of diff --git a/types/dboptions.pp b/types/dboptions.pp index db77df7..e532b92 100644 --- a/types/dboptions.pp +++ b/types/dboptions.pp @@ -1,3 +1,6 @@ +# @summary +# Data type for options to connect the IcingaDB database. +# type IcingaDB::DBOptions = Hash[ Enum[ 'max_connections',