Skip to content

Commit

Permalink
add custom_options parameter for instance
Browse files Browse the repository at this point in the history
  • Loading branch information
trefzer committed Mar 11, 2024
1 parent e8ca35a commit e34b0e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@
# @param output_buffer_limit_pubsub
# Value of client-output-buffer-limit-pubsub in redis config
#
# @param custom_options
# hash of custom options, not available as direct parameter.
#
define redis::instance (
Boolean $activerehashing = $redis::activerehashing,
Boolean $aof_load_truncated = $redis::aof_load_truncated,
Expand Down Expand Up @@ -412,6 +415,7 @@
Optional[Boolean] $jemalloc_bg_thread = $redis::jemalloc_bg_thread,
Optional[Boolean] $rdb_save_incremental_fsync = $redis::rdb_save_incremental_fsync,
Array[String[1]] $acls = $redis::acls,
Hash[String[1],Variant[String[1], Integer]] $custom_options = {},
) {
if $title == 'default' {
$redis_file_name_orig = $config_file_orig
Expand Down Expand Up @@ -604,6 +608,7 @@
jemalloc_bg_thread => $jemalloc_bg_thread,
rdb_save_incremental_fsync => $rdb_save_incremental_fsync,
acls => $acls,
custom_options => $custom_options,
}
),
}
Expand Down
4 changes: 4 additions & 0 deletions templates/redis.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
Optional[Boolean] $jemalloc_bg_thread,
Optional[Boolean] $rdb_save_incremental_fsync,
Array[String[1]] $acls,
Hash[String[1],Variant[String[1], Integer]] $custom_options,
| -%>
# Redis configuration file example

Expand Down Expand Up @@ -1178,6 +1179,9 @@ active-defrag-max-scan-fields <%= $active_defrag_max_scan_fields %>

# Jemalloc background thread for purging will be enabled by default
<% if $jemalloc_bg_thread { -%>jemalloc-bg-thread <%= $jemalloc_bg_thread ? {true => 'yes', default => 'no'} %><% } -%>
<% $custom_options.each |String $k, String $v| { -%>
<%= $k %> <%= $v %>
<% } -%>

################################## MODULES #####################################

Expand Down

0 comments on commit e34b0e2

Please sign in to comment.