Skip to content

Commit

Permalink
Fix #35 add support for DB options
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Sep 19, 2024
1 parent 6f06c87 commit b6f88e2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
18 changes: 18 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The following parameters are available in the `icingadb` class:
* [`db_tls_key_file`](#-icingadb--db_tls_key_file)
* [`db_tls_cacert`](#-icingadb--db_tls_cacert)
* [`db_tls_cacert_file`](#-icingadb--db_tls_cacert_file)
* [`db_options`](#-icingadb--db_options)
* [`logging_level`](#-icingadb--logging_level)
* [`logging_output`](#-icingadb--logging_output)
* [`logging_interval`](#-icingadb--logging_interval)
Expand Down Expand Up @@ -325,6 +326,23 @@ Location of the CA root certificate. Only valid if `db_use_tls` is turned on.

Default value: `undef`

##### <a name="-icingadb--db_options"></a>`db_options`

Data type:

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

List of low-level database options that can be set to influence some
Icinga DB internal default behaviours.

Default value: `undef`

##### <a name="-icingadb--logging_level"></a>`logging_level`

Data type: `Enum['fatal','error','warn','info','debug']`
Expand Down
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
db_tls_key => $db_tls_files['key_file'],
db_tls_cacert => $db_tls_files['cacert_file'],
db_tls_insecure => $icingadb::db_tls_insecure,
db_options => $icingadb::db_options,
redis_tls => $icingadb::redis_use_tls,
redis_tls_cert => $redis_tls_files['cert_file'],
redis_tls_key => $redis_tls_files['key_file'],
Expand Down
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
# @param db_tls_cacert_file
# Location of the CA root certificate. Only valid if `db_use_tls` is turned on.
#
# @param db_options
# List of low-level database options that can be set to influence some
# Icinga DB internal default behaviours.
#
# @param logging_level
# Specifies the default logging level. Can be set to fatal, error, warn, info or debug.
#
Expand Down Expand Up @@ -145,6 +149,11 @@
Optional[Stdlib::Absolutepath] $db_tls_cert_file = undef,
Optional[Stdlib::Absolutepath] $db_tls_key_file = undef,
Optional[Stdlib::Absolutepath] $db_tls_cacert_file = undef,
Optional[Hash[Enum['max_connections',
'max_connections_per_table',

Check warning on line 153 in manifests/init.pp

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

indent should be 8 chars and is 2 (check: strict_indent)
'max_placeholders_per_statement',

Check warning on line 154 in manifests/init.pp

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

indent should be 8 chars and is 2 (check: strict_indent)
'max_rows_per_transaction',

Check warning on line 155 in manifests/init.pp

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

indent should be 8 chars and is 2 (check: strict_indent)
'wsrep_sync_wait'],Integer[1]]] $db_options = undef,
Stdlib::Host $redis_host = 'localhost',
Stdlib::Port $redis_port = 6380,
Optional[Icinga::Secret] $redis_password = undef,
Expand Down
9 changes: 8 additions & 1 deletion templates/config.yml.epp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Optional[String] $db_tls_key = undef,
Optional[String] $db_tls_cacert = undef,
Optional[Boolean] $db_tls_insecure = undef,
Optional[Hash] $db_options = undef,
Stdlib::Host $redis_host,
Optional[Stdlib::Port] $redis_port = undef,
Optional[Variant[String, Sensitive[String]]] $redis_password = undef,
Expand Down Expand Up @@ -51,7 +52,13 @@ database:
insecure: <%= $db_tls_insecure %>
<% } -%>
<% } -%>

<% if $db_options { -%>
options:
<% $db_options.each |String $opt, Integer $val| { -%>
<%= $opt %>: <%= $val %>
<% } -%>
<% } -%>

redis:
host: <%= $redis_host %>
<% if $redis_port { -%>
Expand Down

0 comments on commit b6f88e2

Please sign in to comment.