Skip to content

Commit

Permalink
Merge pull request #40 from lbetz/add-type-db-options
Browse files Browse the repository at this point in the history
Add new data type for db options
  • Loading branch information
lbetz authored Sep 24, 2024
2 parents c66a64a + f16dd61 commit a2999a0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
34 changes: 23 additions & 11 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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): Data type for options to connect the IcingaDB database.

## Classes

### <a name="icingadb"></a>`icingadb`
Expand Down Expand Up @@ -328,17 +332,7 @@ Default value: `undef`

##### <a name="-icingadb--db_options"></a>`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.
Expand Down Expand Up @@ -759,3 +753,21 @@ Data type: `Stdlib::Absolutepath`



## Data types

### <a name="IcingaDB--DBOptions"></a>`IcingaDB::DBOptions`

Data type for options to connect the IcingaDB database.

Alias of

```puppet
Hash[Enum[
'max_connections',
'max_connections_per_table',
'max_placeholders_per_statement',
'max_rows_per_transaction',
'wsrep_sync_wait'
], Integer[1]]
```

8 changes: 1 addition & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions types/dboptions.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# @summary
# Data type for options to connect the IcingaDB database.
#
type IcingaDB::DBOptions = Hash[
Enum[
'max_connections',
'max_connections_per_table',
'max_placeholders_per_statement',
'max_rows_per_transaction',
'wsrep_sync_wait'
], Integer[1]
]

0 comments on commit a2999a0

Please sign in to comment.