Defined Type: redis::instance

Defined in:
manifests/instance.pp

Summary

Allows the configuration of multiple redis configurations on one machine

Overview

This is an defined type to allow the configuration of multiple redis instances on one machine without conflicts

Examples:

redis::instance {'6380':
  port => 6380,
}

Parameters:

  • activerehashing (Boolean) (defaults to: $redis::activerehashing)

    Enable/disable active rehashing.

  • aof_load_truncated (Boolean) (defaults to: $redis::aof_load_truncated)

    Enable/disable loading truncated AOF file

  • aof_rewrite_incremental_fsync (Boolean) (defaults to: $redis::aof_rewrite_incremental_fsync)

    Enable/disable fsync for AOF file

  • appendfilename (String[1]) (defaults to: $redis::appendfilename)

    The name of the append only file

  • appendfsync (Enum['no', 'always', 'everysec']) (defaults to: $redis::appendfsync)

    Adjust fsync mode. Valid options: always, everysec, no.

  • appendonly (Boolean) (defaults to: $redis::appendonly)

    Enable/disable appendonly mode.

  • auto_aof_rewrite_min_size (String[1]) (defaults to: $redis::auto_aof_rewrite_min_size)

    Adjust minimum size for auto-aof-rewrite.

  • auto_aof_rewrite_percentage (Integer[0]) (defaults to: $redis::auto_aof_rewrite_percentage)

    Adjust percentatge for auto-aof-rewrite.

  • bind (Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]) (defaults to: $redis::bind)

    Configure which IP address(es) to listen on. To bind on all interfaces, use an empty array.

  • config_file_orig (Stdlib::Absolutepath) (defaults to: $redis::config_file_orig)

    The location and name of a config file that provides the source

  • config_file (Stdlib::Absolutepath) (defaults to: $redis::config_file)

    Adjust main configuration file.

  • config_file_mode (Stdlib::Filemode) (defaults to: $redis::config_file_mode)

    Adjust permissions for configuration files.

  • config_group (String[1]) (defaults to: $redis::config_group)

    Adjust filesystem group for config files.

  • config_owner (String[1]) (defaults to: $redis::config_owner)

    Adjust filesystem owner for config files.

  • conf_template (String[1]) (defaults to: $redis::conf_template)

    Define which template to use.

  • daemonize (Boolean) (defaults to: true)

    Have Redis run as a daemon.

  • databases (Integer[1]) (defaults to: $redis::databases)

    Set the number of databases.

  • dbfilename (Variant[String[1], Boolean]) (defaults to: $redis::dbfilename)

    The filename where to dump the DB

  • extra_config_file (Optional[String]) (defaults to: $redis::extra_config_file)

    Optional extra config file to include

  • hash_max_ziplist_entries (Integer[0]) (defaults to: $redis::hash_max_ziplist_entries)

    Set max ziplist entries for hashes.

  • hash_max_ziplist_value (Integer[0]) (defaults to: $redis::hash_max_ziplist_value)

    Set max ziplist values for hashes.

  • hll_sparse_max_bytes (Integer[0]) (defaults to: $redis::hll_sparse_max_bytes)

    HyperLogLog sparse representation bytes limit

  • hz (Integer[1, 500]) (defaults to: $redis::hz)

    Set redis background tasks frequency

  • latency_monitor_threshold (Integer[0]) (defaults to: $redis::latency_monitor_threshold)

    Latency monitoring threshold in milliseconds

  • list_max_ziplist_entries (Integer[0]) (defaults to: $redis::list_max_ziplist_entries)

    Set max ziplist entries for lists.

  • list_max_ziplist_value (Integer[0]) (defaults to: $redis::list_max_ziplist_value)

    Set max ziplist values for lists.

  • log_dir (Stdlib::Absolutepath) (defaults to: $redis::log_dir)

    Specify directory where to write log entries.

  • log_dir_mode (Stdlib::Filemode) (defaults to: $redis::log_dir_mode)

    Adjust mode for directory containing log files.

  • log_file (String) (defaults to: "redis-server-${name}.log")

    Specify file where to write log entries. Relative paths will be prepended with log_dir but absolute paths are also accepted.

  • log_level (Redis::LogLevel) (defaults to: $redis::log_level)

    Specify the server verbosity level.

  • managed_by_cluster_manager (Boolean) (defaults to: $redis::managed_by_cluster_manager)

    Choose if redis will be managed by a cluster manager such as pacemaker or rgmanager

  • manage_service_file (Boolean) (defaults to: true)

    Determine if the systemd service file should be managed

  • masterauth (Optional[Variant[String[1], Sensitive[String[1]], Deferred]]) (defaults to: $redis::masterauth)

    If the master is password protected (using the “requirepass” configuration

  • maxclients (Integer[1]) (defaults to: $redis::maxclients)

    Set the max number of connected clients at the same time.

  • maxmemory (Optional[Variant[Integer, String]]) (defaults to: $redis::maxmemory)

    Don’t use more memory than the specified amount of bytes.

  • maxmemory_policy (Optional[Redis::MemoryPolicy]) (defaults to: $redis::maxmemory_policy)

    How Redis will select what to remove when maxmemory is reached.

  • maxmemory_samples (Optional[Integer[1, 10]]) (defaults to: $redis::maxmemory_samples)

    Select as well the sample size to check.

  • min_slaves_max_lag (Integer[0]) (defaults to: $redis::min_slaves_max_lag)

    The lag in seconds

  • min_slaves_to_write (Integer[0]) (defaults to: $redis::min_slaves_to_write)

    Minimum number of slaves to be in “online” state

  • modules (Array[Stdlib::Absolutepath]) (defaults to: $redis::modules)

    Additional redis modules to load (.so path)

  • no_appendfsync_on_rewrite (Boolean) (defaults to: $redis::no_appendfsync_on_rewrite)

    If you have latency problems turn this to ‘true’. Otherwise leave it as

  • notify_keyspace_events (Optional[String[1]]) (defaults to: $redis::notify_keyspace_events)

    Which events to notify Pub/Sub clients about events happening

  • notify_service (Boolean) (defaults to: true)

    You may disable instance service reloads when config file changes

  • pid_file (Stdlib::Absolutepath) (defaults to: "/var/run/${service_name}/redis.pid")

    Where to store the pid.

  • port (Stdlib::Port) (defaults to: $redis::port)

    Configure which port to listen on.

  • protected_mode (Boolean) (defaults to: $redis::protected_mode)

    Whether protected mode is enabled or not. Only applicable when no bind is set.

  • rdbcompression (Boolean) (defaults to: $redis::rdbcompression)

    Enable/disable compression of string objects using LZF when dumping.

  • rename_commands (Hash[String,String]) (defaults to: $redis::rename_commands)

    A list of Redis commands to rename or disable for security reasons

  • repl_announce_ip (Optional[Stdlib::Host]) (defaults to: $redis::repl_announce_ip)

    The specific IP or hostname a replica will report to its master

  • repl_announce_port (Optional[Stdlib::Port]) (defaults to: $redis::repl_announce_port)

    The specific port a replica will report to its master

  • repl_backlog_size (String[1]) (defaults to: $redis::repl_backlog_size)

    The replication backlog size

  • repl_backlog_ttl (Integer[0]) (defaults to: $redis::repl_backlog_ttl)

    The number of seconds to elapse before freeing backlog buffer

  • repl_disable_tcp_nodelay (Boolean) (defaults to: $redis::repl_disable_tcp_nodelay)

    Enable/disable TCP_NODELAY on the slave socket after SYNC

  • repl_ping_slave_period (Integer[1]) (defaults to: $redis::repl_ping_slave_period)

    Slaves send PINGs to server in a predefined interval. It’s possible

  • repl_timeout (Integer[1]) (defaults to: $redis::repl_timeout)

    Set the replication timeout for:

  • requirepass (Optional[Variant[String, Sensitive[String[1]], Deferred]]) (defaults to: $redis::requirepass)

    Require clients to issue AUTH <PASSWORD> before processing any other commands.

  • save_db_to_disk (Boolean) (defaults to: $redis::save_db_to_disk)

    Set if save db to disk.

  • save_db_to_disk_interval (Hash) (defaults to: $redis::save_db_to_disk_interval)

    save the dataset every N seconds if there are at least M changes in the dataset

  • service_name (String[1]) (defaults to: "redis-server-${name}")

    The service name for this instance

  • service_enable (Boolean) (defaults to: $redis::service_enable)

    Enable/disable daemon at boot.

  • service_ensure (Stdlib::Ensure::Service) (defaults to: $redis::service_ensure)

    Specify if the server should be running.

  • service_group (String[1]) (defaults to: $redis::service_group)

    Specify which group to run as.

  • service_user (String[1]) (defaults to: $redis::service_user)

    Specify which user to run as.

  • service_timeout_start (Optional[Integer[0]]) (defaults to: $redis::service_timeout_start)

    Specify the time after which a service startup should be considered as failed.

  • service_timeout_stop (Optional[Integer[0]]) (defaults to: $redis::service_timeout_stop)

    Specify the time after which a service stop should be considered as failed.

  • set_max_intset_entries (Integer[0]) (defaults to: $redis::set_max_intset_entries)

    The following configuration setting sets the limit in the size of the set in order to use this special memory saving encoding.

  • slave_priority (Integer[0]) (defaults to: $redis::slave_priority)

    The priority number for slave promotion by Sentinel

  • slave_read_only (Boolean) (defaults to: $redis::slave_read_only)

    You can configure a slave instance to accept writes or not.

  • slave_serve_stale_data (Boolean) (defaults to: $redis::slave_serve_stale_data)

    When a slave loses its connection with the master, or when the replication is still in progress, the slave can act in two different ways: 1) if slave-serve-stale-data is set to ‘yes’ (the default) the slave will

    still reply to client requests, possibly with out of date data, or the
    data set may just be empty if this is the first synchronization.
    

    2) if slave-serve-stale-data is set to ‘no’ the slave will reply with

    an error "SYNC with master in progress" to all the kind of commands
    but to INFO and SLAVEOF.
    
  • slaveof (Optional[String[1]]) (defaults to: $redis::slaveof)

    Use slaveof to make a Redis instance a copy of another Redis server.

  • replicaof (Optional[String[1]]) (defaults to: $redis::replicaof)

    Use replicaof to make a Redis instance a copy of another Redis server.

  • slowlog_log_slower_than (Integer[-1]) (defaults to: $redis::slowlog_log_slower_than)

    Tells Redis what is the execution time, in microseconds, to exceed in order for the command to get logged.

  • slowlog_max_len (Integer[0]) (defaults to: $redis::slowlog_max_len)

    Tells Redis what is the length to exceed in order for the command to get logged.

  • stop_writes_on_bgsave_error (Boolean) (defaults to: $redis::stop_writes_on_bgsave_error)

    If false then Redis will continue to work as usual even if there are problems with disk, permissions, and so forth.

  • syslog_enabled (Boolean) (defaults to: $redis::syslog_enabled)

    Enable/disable logging to the system logger.

  • syslog_facility (Optional[String[1]]) (defaults to: $redis::syslog_facility)

    Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.

  • tcp_backlog (Integer[0]) (defaults to: $redis::tcp_backlog)

    Sets the TCP backlog

  • tcp_keepalive (Integer[0]) (defaults to: $redis::tcp_keepalive)

    TCP keepalive.

  • timeout (Integer[0]) (defaults to: $redis::timeout)

    Close the connection after a client is idle for N seconds (0 to disable).

  • tls_port (Optional[Stdlib::Port]) (defaults to: $redis::tls_port)

    Configure which TLS port to listen on.

  • tls_cert_file (Optional[Stdlib::Absolutepath]) (defaults to: $redis::tls_cert_file)

    Specify which X.509 certificate file to use for TLS connections.

  • tls_key_file (Optional[Stdlib::Absolutepath]) (defaults to: $redis::tls_key_file)

    Specify which privaye key file to use for TLS connections.

  • tls_ca_cert_file (Optional[Stdlib::Absolutepath]) (defaults to: $redis::tls_ca_cert_file)

    Specify which X.509 CA certificate(s) bundle file to use.

  • tls_ca_cert_dir (Optional[Stdlib::Absolutepath]) (defaults to: $redis::tls_ca_cert_dir)

    Specify which X.509 CA certificate(s) bundle directory to use.

  • tls_auth_clients (Enum['yes', 'no', 'optional']) (defaults to: $redis::tls_auth_clients)

    Specify if clients and replicas are required to authenticate using valid client side certificates.

  • tls_replication (Boolean) (defaults to: $redis::tls_replication)

    Specify if TLS should be enabled on replication links.

  • tls_cluster (Boolean) (defaults to: $redis::tls_cluster)

    Specify if TLS should be used for the bus protocol.

  • tls_ciphers (Optional[String[1]]) (defaults to: $redis::tls_ciphers)

    Configure allowed ciphers for TLS <= TLSv1.2.

  • tls_ciphersuites (Optional[String[1]]) (defaults to: $redis::tls_ciphersuites)

    Configure allowed TLSv1.3 ciphersuites.

  • tls_protocols (Optional[String[1]]) (defaults to: $redis::tls_protocols)

    Configure allowed TLS protocol versions.

  • tls_prefer_server_ciphers (Optional[Boolean]) (defaults to: $redis::tls_prefer_server_ciphers)

    Specify if the server’s preference should be used when choosing a cipher.

  • ulimit (Integer[0]) (defaults to: $redis::ulimit)

    Limit the use of system-wide resources.

  • ulimit_managed (Boolean) (defaults to: $redis::ulimit_managed)

    Defines wheter the max number of open files for the systemd service unit is explicitly managed.

  • unixsocket (Variant[Stdlib::Absolutepath, Enum['']]) (defaults to: "/var/run/${service_name}/redis.sock")

    Define unix socket path

  • unixsocketperm (Variant[Stdlib::Filemode, Enum['']]) (defaults to: $redis::unixsocketperm)

    Define unix socket file permissions

  • workdir (Stdlib::Absolutepath) (defaults to: "${redis::workdir}/redis-server-${name}")

    The DB will be written inside this directory, with the filename specified above using the ‘dbfilename’ configuration directive.

  • workdir_mode (Stdlib::Filemode) (defaults to: $redis::workdir_mode)

    Adjust mode for data directory.

  • zset_max_ziplist_entries (Integer[0]) (defaults to: $redis::zset_max_ziplist_entries)

    Set max entries for sorted sets.

  • zset_max_ziplist_value (Integer[0]) (defaults to: $redis::zset_max_ziplist_value)

    Set max values for sorted sets.

  • cluster_enabled (Boolean) (defaults to: $redis::cluster_enabled)

    Enables redis 3.0 cluster functionality

  • cluster_config_file (String[1]) (defaults to: $redis::cluster_config_file)

    Config file for saving cluster nodes configuration. This file is never touched by humans. Only set if cluster_enabled is true

  • cluster_node_timeout (Integer[1]) (defaults to: $redis::cluster_node_timeout)

    Node timeout. Only set if cluster_enabled is true

  • cluster_slave_validity_factor (Integer[0]) (defaults to: $redis::cluster_slave_validity_factor)

    Control variable to disable promoting slave in case of disconnection from master Only set if cluster_enabled is true

  • cluster_require_full_coverage (Boolean) (defaults to: $redis::cluster_require_full_coverage)

    If false Redis Cluster will server queries even if requests about a subset of keys can be processed Only set if cluster_enabled is true

  • cluster_migration_barrier (Integer[0]) (defaults to: $redis::cluster_migration_barrier)

    Minimum number of slaves master will remain connected with, for another slave to migrate to a master which is no longer covered by any slave Only set if cluster_enabled is true

  • io_threads (Optional[Integer[1]]) (defaults to: $redis::io_threads)

    Number of threads to handle IO operations in Redis

  • io_threads_do_reads (Optional[Boolean]) (defaults to: $redis::io_threads_do_reads)

    Enabled/disable io_threads to handle reads

  • cluster_allow_reads_when_down (Optional[Boolean]) (defaults to: $redis::cluster_allow_reads_when_down)

    Allows nodes to serve read data while cluster status is down

  • cluster_replica_no_failover (Optional[Boolean]) (defaults to: $redis::cluster_replica_no_failover)

    Disabled automatic failover for replica

  • dynamic_hz (Optional[Boolean]) (defaults to: $redis::dynamic_hz)

    When dynamic HZ is enabled, the actual configured HZ will be used as a baseline, but multiples of the configured HZ value will be actually used as needed once more clients are connected.

  • activedefrag (Optional[Boolean]) (defaults to: $redis::activedefrag)

    Enable/disable active defragmentation

  • active_defrag_ignore_bytes (String[1]) (defaults to: $redis::active_defrag_ignore_bytes)

    Minimum amount of fragmentation waste to start active defrag Only set if activedefrag is true

  • active_defrag_threshold_lower (Integer[1, 100]) (defaults to: $redis::active_defrag_threshold_lower)

    Minimum percentage of fragmentation to start active defrag Only set if activedefrag is true

  • active_defrag_threshold_upper (Integer[1, 100]) (defaults to: $redis::active_defrag_threshold_upper)

    Maximum percentage of fragmentation at which we use maximum effort Only set if activedefrag is true

  • active_defrag_cycle_min (Integer[1, 100]) (defaults to: $redis::active_defrag_cycle_min)

    Minimal effort for defrag in CPU percentage, to be used when the lower threshold is reached Only set if activedefrag is true

  • active_defrag_cycle_max (Integer[1, 100]) (defaults to: $redis::active_defrag_cycle_max)

    Maximal effort for defrag in CPU percentage, to be used when the upper threshold is reached Only set if activedefrag is true

  • active_defrag_max_scan_fields (Integer[1]) (defaults to: $redis::active_defrag_max_scan_fields)

    Maximum number of set/hash/zset/list fields that will be processed from the main dictionary scan Only set if activedefrag is true

  • jemalloc_bg_thread (Optional[Boolean]) (defaults to: $redis::jemalloc_bg_thread)

    Jemalloc background thread for purging will be enabled by default

  • rdb_save_incremental_fsync (Optional[Boolean]) (defaults to: $redis::rdb_save_incremental_fsync)

    When redis saves RDB file, if the following option is enabled the file will be fsync-ed every 32 MB of data generated.

  • acls (Array[String[1]]) (defaults to: $redis::acls)

    This is a way to pass an array of raw ACLs to Redis. The ACLs must be in the form of:

    user USERNAME [additional ACL options]
    
  • output_buffer_limit_slave (String[1]) (defaults to: $redis::output_buffer_limit_slave)

    Value of client-output-buffer-limit-slave in redis config

  • output_buffer_limit_pubsub (String[1]) (defaults to: $redis::output_buffer_limit_pubsub)

    Value of client-output-buffer-limit-pubsub in redis config

  • custom_options (Hash[String[1],Variant[String[1], Integer]]) (defaults to: {})

    hash of custom options, not available as direct parameter.



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'manifests/instance.pp', line 295

define redis::instance (
  Boolean $activerehashing                                       = $redis::activerehashing,
  Boolean $aof_load_truncated                                    = $redis::aof_load_truncated,
  Boolean $aof_rewrite_incremental_fsync                         = $redis::aof_rewrite_incremental_fsync,
  String[1] $appendfilename                                      = $redis::appendfilename,
  Enum['no', 'always', 'everysec'] $appendfsync                  = $redis::appendfsync,
  Boolean $appendonly                                            = $redis::appendonly,
  String[1] $auto_aof_rewrite_min_size                           = $redis::auto_aof_rewrite_min_size,
  Integer[0] $auto_aof_rewrite_percentage                        = $redis::auto_aof_rewrite_percentage,
  Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]] $bind = $redis::bind,
  String[1] $output_buffer_limit_slave                           = $redis::output_buffer_limit_slave,
  String[1] $output_buffer_limit_pubsub                          = $redis::output_buffer_limit_pubsub,
  String[1] $conf_template                                       = $redis::conf_template,
  Stdlib::Absolutepath $config_file                              = $redis::config_file,
  Stdlib::Filemode $config_file_mode                             = $redis::config_file_mode,
  Stdlib::Absolutepath $config_file_orig                         = $redis::config_file_orig,
  String[1] $config_group                                        = $redis::config_group,
  String[1] $config_owner                                        = $redis::config_owner,
  Boolean $daemonize                                             = true,
  Integer[1] $databases                                          = $redis::databases,
  Variant[String[1], Boolean] $dbfilename                        = $redis::dbfilename,
  Optional[String] $extra_config_file                            = $redis::extra_config_file,
  Integer[0] $hash_max_ziplist_entries                           = $redis::hash_max_ziplist_entries,
  Integer[0] $hash_max_ziplist_value                             = $redis::hash_max_ziplist_value,
  Integer[0] $hll_sparse_max_bytes                               = $redis::hll_sparse_max_bytes,
  Integer[1, 500] $hz                                            = $redis::hz,
  Integer[0] $latency_monitor_threshold                          = $redis::latency_monitor_threshold,
  Integer[0] $list_max_ziplist_entries                           = $redis::list_max_ziplist_entries,
  Integer[0] $list_max_ziplist_value                             = $redis::list_max_ziplist_value,
  Stdlib::Absolutepath $log_dir                                  = $redis::log_dir,
  Stdlib::Filemode $log_dir_mode                                 = $redis::log_dir_mode,
  Redis::LogLevel $log_level                                     = $redis::log_level,
  Optional[Variant[String[1], Sensitive[String[1]], Deferred]] $masterauth = $redis::masterauth,
  Integer[1] $maxclients                                         = $redis::maxclients,
  Optional[Variant[Integer, String]] $maxmemory                  = $redis::maxmemory,
  Optional[Redis::MemoryPolicy] $maxmemory_policy                = $redis::maxmemory_policy,
  Optional[Integer[1, 10]] $maxmemory_samples                    = $redis::maxmemory_samples,
  Integer[0] $min_slaves_max_lag                                 = $redis::min_slaves_max_lag,
  Integer[0] $min_slaves_to_write                                = $redis::min_slaves_to_write,
  Array[Stdlib::Absolutepath] $modules                           = $redis::modules,
  Boolean $no_appendfsync_on_rewrite                             = $redis::no_appendfsync_on_rewrite,
  Optional[String[1]] $notify_keyspace_events                    = $redis::notify_keyspace_events,
  Boolean $notify_service                                        = true,
  Boolean $managed_by_cluster_manager                            = $redis::managed_by_cluster_manager,
  Stdlib::Port $port                                             = $redis::port,
  Boolean $protected_mode                                        = $redis::protected_mode,
  Boolean $rdbcompression                                        = $redis::rdbcompression,
  Hash[String,String] $rename_commands                           = $redis::rename_commands,
  Optional[Stdlib::Host] $repl_announce_ip                       = $redis::repl_announce_ip,
  Optional[Stdlib::Port] $repl_announce_port                     = $redis::repl_announce_port,
  String[1] $repl_backlog_size                                   = $redis::repl_backlog_size,
  Integer[0] $repl_backlog_ttl                                   = $redis::repl_backlog_ttl,
  Boolean $repl_disable_tcp_nodelay                              = $redis::repl_disable_tcp_nodelay,
  Integer[1] $repl_ping_slave_period                             = $redis::repl_ping_slave_period,
  Integer[1] $repl_timeout                                       = $redis::repl_timeout,
  Optional[Variant[String, Sensitive[String[1]], Deferred]] $requirepass = $redis::requirepass,
  Boolean $save_db_to_disk                                       = $redis::save_db_to_disk,
  Hash $save_db_to_disk_interval                                 = $redis::save_db_to_disk_interval,
  String[1] $service_user                                        = $redis::service_user,
  Integer[0] $set_max_intset_entries                             = $redis::set_max_intset_entries,
  Integer[0] $slave_priority                                     = $redis::slave_priority,
  Boolean $slave_read_only                                       = $redis::slave_read_only,
  Boolean $slave_serve_stale_data                                = $redis::slave_serve_stale_data,
  Optional[String[1]] $slaveof                                   = $redis::slaveof,
  Optional[String[1]] $replicaof                                 = $redis::replicaof,
  Integer[-1] $slowlog_log_slower_than                           = $redis::slowlog_log_slower_than,
  Integer[0] $slowlog_max_len                                    = $redis::slowlog_max_len,
  Boolean $stop_writes_on_bgsave_error                           = $redis::stop_writes_on_bgsave_error,
  Boolean $syslog_enabled                                        = $redis::syslog_enabled,
  Optional[String[1]] $syslog_facility                           = $redis::syslog_facility,
  Integer[0] $tcp_backlog                                        = $redis::tcp_backlog,
  Integer[0] $tcp_keepalive                                      = $redis::tcp_keepalive,
  Integer[0] $timeout                                            = $redis::timeout,
  Optional[Stdlib::Port] $tls_port                               = $redis::tls_port,
  Optional[Stdlib::Absolutepath] $tls_cert_file                  = $redis::tls_cert_file,
  Optional[Stdlib::Absolutepath] $tls_key_file                   = $redis::tls_key_file,
  Optional[Stdlib::Absolutepath] $tls_ca_cert_file               = $redis::tls_ca_cert_file,
  Optional[Stdlib::Absolutepath] $tls_ca_cert_dir                = $redis::tls_ca_cert_dir,
  Optional[String[1]] $tls_ciphers                               = $redis::tls_ciphers,
  Optional[String[1]] $tls_ciphersuites                          = $redis::tls_ciphersuites,
  Optional[String[1]] $tls_protocols                             = $redis::tls_protocols,
  Enum['yes', 'no', 'optional'] $tls_auth_clients                = $redis::tls_auth_clients,
  Boolean $tls_replication                                       = $redis::tls_replication,
  Boolean $tls_cluster                                           = $redis::tls_cluster,
  Optional[Boolean] $tls_prefer_server_ciphers                   = $redis::tls_prefer_server_ciphers,
  Variant[Stdlib::Filemode, Enum['']] $unixsocketperm            = $redis::unixsocketperm,
  Integer[0] $ulimit                                             = $redis::ulimit,
  Boolean $ulimit_managed                                        = $redis::ulimit_managed,
  Stdlib::Filemode $workdir_mode                                 = $redis::workdir_mode,
  Integer[0] $zset_max_ziplist_entries                           = $redis::zset_max_ziplist_entries,
  Integer[0] $zset_max_ziplist_value                             = $redis::zset_max_ziplist_value,
  Boolean $cluster_enabled                                       = $redis::cluster_enabled,
  String[1] $cluster_config_file                                 = $redis::cluster_config_file,
  Integer[1] $cluster_node_timeout                               = $redis::cluster_node_timeout,
  Integer[0] $cluster_slave_validity_factor                      = $redis::cluster_slave_validity_factor,
  Boolean $cluster_require_full_coverage                         = $redis::cluster_require_full_coverage,
  Integer[0] $cluster_migration_barrier                          = $redis::cluster_migration_barrier,
  String[1] $service_name                                        = "redis-server-${name}",
  Stdlib::Ensure::Service $service_ensure                        = $redis::service_ensure,
  Boolean $service_enable                                        = $redis::service_enable,
  String[1] $service_group                                       = $redis::service_group,
  Optional[Integer[0]] $service_timeout_start                    = $redis::service_timeout_start,
  Optional[Integer[0]] $service_timeout_stop                     = $redis::service_timeout_stop,
  Boolean $manage_service_file                                   = true,
  String $log_file                                               = "redis-server-${name}.log",
  Stdlib::Absolutepath $pid_file                                 = "/var/run/${service_name}/redis.pid",
  Variant[Stdlib::Absolutepath, Enum['']] $unixsocket            = "/var/run/${service_name}/redis.sock",
  Stdlib::Absolutepath $workdir                                  = "${redis::workdir}/redis-server-${name}",
  Optional[Integer[1]] $io_threads                               = $redis::io_threads,
  Optional[Boolean] $io_threads_do_reads                         = $redis::io_threads_do_reads,
  Optional[Boolean] $cluster_allow_reads_when_down               = $redis::cluster_allow_reads_when_down,
  Optional[Boolean] $cluster_replica_no_failover                 = $redis::cluster_replica_no_failover,
  Optional[Boolean] $dynamic_hz                                  = $redis::dynamic_hz,
  Optional[Boolean] $activedefrag                                = $redis::activedefrag,
  String[1] $active_defrag_ignore_bytes                          = $redis::active_defrag_ignore_bytes,
  Integer[1, 100] $active_defrag_threshold_lower                 = $redis::active_defrag_threshold_lower,
  Integer[1, 100] $active_defrag_threshold_upper                 = $redis::active_defrag_threshold_upper,
  Integer[1, 100] $active_defrag_cycle_min                       = $redis::active_defrag_cycle_min,
  Integer[1, 100] $active_defrag_cycle_max                       = $redis::active_defrag_cycle_max,
  Integer[1] $active_defrag_max_scan_fields                      = $redis::active_defrag_max_scan_fields,
  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
    $redis_file_name      = $config_file
  } else {
    $redis_file_name_orig = sprintf('%s/%s.%s', dirname($config_file_orig), $service_name, 'conf.puppet')
    $redis_file_name      = sprintf('%s/%s.%s', dirname($config_file), $service_name, 'conf')
  }

  if $log_dir != $redis::log_dir {
    file { $log_dir:
      ensure => directory,
      group  => $service_group,
      mode   => $log_dir_mode,
      owner  => $service_user,
    }
  }

  if $workdir != $redis::workdir {
    file { $workdir:
      ensure => directory,
      group  => $service_group,
      mode   => $workdir_mode,
      owner  => $service_user,
    }
  }

  if $manage_service_file {
    if $title != 'default' {
      $real_service_ensure = $service_ensure == 'running'
      $real_service_enable = $service_enable

      if $notify_service {
        Exec["copy ${redis_file_name_orig} to ${redis_file_name}"] ~> Service["${service_name}.service"]
      } else {
        Exec["copy ${redis_file_name_orig} to ${redis_file_name}"] -> Service["${service_name}.service"]
      }
    } else {
      $real_service_ensure = undef
      $real_service_enable = undef
    }

    systemd::unit_file { "${service_name}.service":
      ensure  => 'present',
      active  => $real_service_ensure,
      enable  => $real_service_enable,
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      content => epp(
        'redis/service_templates/redis.service.epp',
        {
          bin_path              => $redis::bin_path,
          instance_title        => $name,
          port                  => $port,
          redis_file_name       => $redis_file_name,
          service_name          => $service_name,
          service_user          => $service_user,
          service_timeout_start => $service_timeout_start,
          service_timeout_stop  => $service_timeout_stop,
          ulimit                => $ulimit,
          ulimit_managed        => $ulimit_managed,
        }
      ),
    }
  } else {
    if $ulimit_managed {
      systemd::manage_dropin { "${service_name}-90-limits.conf":
        ensure         => present,
        unit           => "${service_name}.service",
        service_entry  => {
          'LimitNOFILE' => $ulimit,
        },
        notify_service => false,
      }
    }
  }

  $_real_log_file = $log_file ? {
    Stdlib::Absolutepath => $log_file,
    default              => "${log_dir}/${log_file}",
  }

  $bind_arr = [$bind].flatten

  $_template_params = {
    daemonize                     => $daemonize,
    pid_file                      => $pid_file,
    protected_mode                => $protected_mode,
    port                          => $port,
    tcp_backlog                   => $tcp_backlog,
    bind_arr                      => $bind_arr,
    unixsocket                    => $unixsocket,
    unixsocketperm                => $unixsocketperm,
    timeout                       => $timeout,
    tcp_keepalive                 => $tcp_keepalive,
    log_level                     => $log_level,
    log_file                      => $_real_log_file,
    syslog_enabled                => $syslog_enabled,
    syslog_facility               => $syslog_facility,
    databases                     => $databases,
    save_db_to_disk               => $save_db_to_disk,
    save_db_to_disk_interval      => $save_db_to_disk_interval,
    stop_writes_on_bgsave_error   => $stop_writes_on_bgsave_error,
    rdbcompression                => $rdbcompression,
    dbfilename                    => $dbfilename,
    workdir                       => $workdir,
    slaveof                       => $slaveof,
    replicaof                     => $replicaof,
    masterauth                    => $masterauth,
    slave_serve_stale_data        => $slave_serve_stale_data,
    slave_read_only               => $slave_read_only,
    repl_announce_ip              => $repl_announce_ip,
    repl_announce_port            => $repl_announce_port,
    repl_ping_slave_period        => $repl_ping_slave_period,
    repl_timeout                  => $repl_timeout,
    repl_disable_tcp_nodelay      => $repl_disable_tcp_nodelay,
    repl_backlog_size             => $repl_backlog_size,
    repl_backlog_ttl              => $repl_backlog_ttl,
    slave_priority                => $slave_priority,
    min_slaves_to_write           => $min_slaves_to_write,
    min_slaves_max_lag            => $min_slaves_max_lag,
    requirepass                   => $requirepass,
    rename_commands               => $rename_commands,
    maxclients                    => $maxclients,
    maxmemory                     => $maxmemory,
    maxmemory_policy              => $maxmemory_policy,
    maxmemory_samples             => $maxmemory_samples,
    appendonly                    => $appendonly,
    appendfilename                => $appendfilename,
    appendfsync                   => $appendfsync,
    no_appendfsync_on_rewrite     => $no_appendfsync_on_rewrite,
    auto_aof_rewrite_percentage   => $auto_aof_rewrite_percentage,
    auto_aof_rewrite_min_size     => $auto_aof_rewrite_min_size,
    aof_load_truncated            => $aof_load_truncated,
    slowlog_log_slower_than       => $slowlog_log_slower_than,
    slowlog_max_len               => $slowlog_max_len,
    latency_monitor_threshold     => $latency_monitor_threshold,
    notify_keyspace_events        => $notify_keyspace_events,
    hash_max_ziplist_entries      => $hash_max_ziplist_entries,
    hash_max_ziplist_value        => $hash_max_ziplist_value,
    list_max_ziplist_entries      => $list_max_ziplist_entries,
    list_max_ziplist_value        => $list_max_ziplist_value,
    set_max_intset_entries        => $set_max_intset_entries,
    zset_max_ziplist_entries      => $zset_max_ziplist_entries,
    zset_max_ziplist_value        => $zset_max_ziplist_value,
    hll_sparse_max_bytes          => $hll_sparse_max_bytes,
    activerehashing               => $activerehashing,
    output_buffer_limit_slave     => $output_buffer_limit_slave,
    output_buffer_limit_pubsub    => $output_buffer_limit_pubsub,
    hz                            => $hz,
    aof_rewrite_incremental_fsync => $aof_rewrite_incremental_fsync,
    cluster_enabled               => $cluster_enabled,
    cluster_config_file           => $cluster_config_file,
    cluster_node_timeout          => $cluster_node_timeout,
    cluster_slave_validity_factor => $cluster_slave_validity_factor,
    cluster_require_full_coverage => $cluster_require_full_coverage,
    cluster_migration_barrier     => $cluster_migration_barrier,
    extra_config_file             => $extra_config_file,
    tls_port                      => $tls_port,
    tls_cert_file                 => $tls_cert_file,
    tls_key_file                  => $tls_key_file,
    tls_ca_cert_file              => $tls_ca_cert_file,
    tls_ca_cert_dir               => $tls_ca_cert_dir,
    tls_ciphers                   => $tls_ciphers,
    tls_ciphersuites              => $tls_ciphersuites,
    tls_protocols                 => $tls_protocols,
    tls_auth_clients              => $tls_auth_clients,
    tls_replication               => $tls_replication,
    tls_cluster                   => $tls_cluster,
    tls_prefer_server_ciphers     => $tls_prefer_server_ciphers,
    modules                       => $modules,
    io_threads                    => $io_threads,
    io_threads_do_reads           => $io_threads_do_reads,
    cluster_allow_reads_when_down => $cluster_allow_reads_when_down,
    cluster_replica_no_failover   => $cluster_replica_no_failover,
    dynamic_hz                    => $dynamic_hz,
    activedefrag                  => $activedefrag,
    active_defrag_ignore_bytes    => $active_defrag_ignore_bytes,
    active_defrag_threshold_lower => $active_defrag_threshold_lower,
    active_defrag_threshold_upper => $active_defrag_threshold_upper,
    active_defrag_cycle_min       => $active_defrag_cycle_min,
    active_defrag_cycle_max       => $active_defrag_cycle_max,
    active_defrag_max_scan_fields => $active_defrag_max_scan_fields,
    jemalloc_bg_thread            => $jemalloc_bg_thread,
    rdb_save_incremental_fsync    => $rdb_save_incremental_fsync,
    acls                          => $acls,
    custom_options                => $custom_options,
  }

  # TODO: Rely on https://github.com/puppetlabs/puppetlabs-stdlib/pull/1425
  # once available.
  if $_template_params.any |$_key, $_value| { $_value.is_a(Deferred) } {
    $_template_params_escaped = $_template_params.map | $_var , $_value | {
      if $_value.is_a(Deferred) {
        { $_var => "<%= \$${_var} %>" }
      } else {
        { $_var => $_value }
      }
    }.reduce | $_memo, $_kv | { $_memo + $_kv }

    $_content = Deferred(
      'inline_epp',
      [
        epp($conf_template,$_template_params_escaped),
        $_template_params,
      ]
    )
  } else {
    $_content = epp($conf_template, $_template_params)
  }

  file { $redis_file_name_orig:
    ensure  => file,
    owner   => $config_owner,
    group   => $config_group,
    mode    => $config_file_mode,
    content => $_content,
  }

  exec { "copy ${redis_file_name_orig} to ${redis_file_name}":
    path        => '/usr/bin:/bin',
    command     => "cp -p ${redis_file_name_orig} ${redis_file_name}",
    subscribe   => File[$redis_file_name_orig],
    refreshonly => true,
  }
}