Puppet Class: redis

Inherits:
redis::params
Defined in:
manifests/init.pp

Overview

This class installs redis

Examples:

Default install

include redis

Slave Node

class { 'redis':
  bind    => '10.0.1.2',
  slaveof => '10.0.1.1 6379',
}

Binding on multiple interfaces

class { 'redis':
  bind => ['127.0.0.1', '10.0.0.1', '10.1.0.1'],
}

Binding on all interfaces

class { 'redis':
  bind => [],
}

Parameters:

  • activerehashing (Boolean) (defaults to: true)

    Enable/disable active rehashing.

  • aof_load_truncated (Boolean) (defaults to: true)

    Enable/disable loading truncated AOF file

  • aof_rewrite_incremental_fsync (Boolean) (defaults to: true)

    Enable/disable fsync for AOF file

  • appendfilename (String[1]) (defaults to: 'appendonly.aof')

    The name of the append only file

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

    Adjust fsync mode

  • appendonly (Boolean) (defaults to: false)

    Enable/disable appendonly mode.

  • auto_aof_rewrite_min_size (String[1]) (defaults to: '64mb')

    Adjust minimum size for auto-aof-rewrite.

  • auto_aof_rewrite_percentage (Integer[0]) (defaults to: 100)

    Adjust percentatge for auto-aof-rewrite.

  • bind (Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]) (defaults to: ['127.0.0.1'])

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

  • bin_path (Stdlib::Absolutepath) (defaults to: $redis::params::bin_path)

    Directory containing redis binary executables.

  • config_dir (Stdlib::Absolutepath) (defaults to: $redis::params::config_dir)

    Directory containing the configuration files.

  • config_dir_mode (Stdlib::Filemode) (defaults to: $redis::params::config_dir_mode)

    Adjust mode for directory containing configuration files.

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

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

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

    Adjust main configuration file.

  • config_file_mode (Stdlib::Filemode) (defaults to: '0640')

    Adjust permissions for configuration files.

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

    Adjust filesystem group for config files.

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

    Adjust filesystem owner for config files.

  • conf_template (String[1]) (defaults to: 'redis/redis.conf.epp')

    Define which template to use.

  • daemonize (Boolean) (defaults to: $redis::params::daemonize)

    Have Redis run as a daemon.

  • default_install (Boolean) (defaults to: true)

    Configure a default install of redis.

  • databases (Integer[1]) (defaults to: 16)

    Set the number of databases.

  • dbfilename (Variant[String[1], Boolean]) (defaults to: 'dump.rdb')

    The filename where to dump the DB

  • extra_config_file (Optional[String]) (defaults to: undef)

    Optional extra config file to include

  • hash_max_ziplist_entries (Integer[0]) (defaults to: 512)

    Set max ziplist entries for hashes.

  • hash_max_ziplist_value (Integer[0]) (defaults to: 64)

    Set max ziplist values for hashes.

  • hll_sparse_max_bytes (Integer[0]) (defaults to: 3000)

    HyperLogLog sparse representation bytes limit

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

    Set redis background tasks frequency

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

    Latency monitoring threshold in milliseconds

  • list_max_ziplist_entries (Integer[0]) (defaults to: 512)

    Set max ziplist entries for lists.

  • list_max_ziplist_value (Integer[0]) (defaults to: 64)

    Set max ziplist values for lists.

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

    Specify directory where to write log entries.

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

    Adjust mode for directory containing log files.

  • log_file (String) (defaults to: 'redis.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: 'notice')

    Specify the server verbosity level.

  • manage_repo (Boolean) (defaults to: false)

    Enable/disable upstream repository configuration.

  • manage_package (Boolean) (defaults to: true)

    Enable/disable management of package

  • managed_by_cluster_manager (Boolean) (defaults to: false)

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

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

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

  • maxclients (Integer[1]) (defaults to: 10000)

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

  • maxmemory (Any) (defaults to: undef)

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

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

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

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

    Select as well the sample size to check.

  • min_slaves_max_lag (Integer[0]) (defaults to: 10)

    The lag in seconds

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

    Minimum number of slaves to be in “online” state

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

    Additional redis modules to load (.so path)

  • no_appendfsync_on_rewrite (Boolean) (defaults to: false)

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

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

    Which events to notify Pub/Sub clients about events happening

  • notify_service (Boolean) (defaults to: true)

    You may disable service reloads when config files change

  • output_buffer_limit_slave (String[1]) (defaults to: '256mb 64mb 60')

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

  • output_buffer_limit_pubsub (String[1]) (defaults to: '32mb 8mb 60')

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

  • package_ensure (String[1]) (defaults to: 'installed')

    Default action for package.

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

    Upstream package name.

  • pid_file (Stdlib::Absolutepath) (defaults to: $redis::params::pid_file)

    Where to store the pid.

  • port (Stdlib::Port) (defaults to: 6379)

    Configure which port to listen on.

  • protected_mode (Boolean) (defaults to: true)

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

  • ppa_repo (Optional[String]) (defaults to: undef)

    Specify upstream (Ubuntu) PPA entry.

  • redis_apt_repo (Boolean) (defaults to: false)

    If you want to use the redis apt repository.

  • apt_location (Stdlib::HTTPSUrl) (defaults to: 'https://packages.redis.io/deb/')

    Specify the URL of the apt repository.

  • apt_repos (String[1]) (defaults to: 'main')

    Specify the repository to use for apt. Defaults to ‘main’.

  • apt_release (Optional[String]) (defaults to: undef)

    Specify the os codename.

  • apt_key_id (String[1]) (defaults to: '54318FA4052D1E61A6B6F7BB5F4349D6BF53AA0C')

    Specify the PGP key id to use for apt.

  • apt_key_server (String[1]) (defaults to: 'hkp://keyserver.ubuntu.com/')

    Specify the PGP key server to use for apt.

  • apt_key_options (Optional[String]) (defaults to: undef)

    Passes additional options to ‘apt-key adv –keyserver-options`.

  • rdbcompression (Boolean) (defaults to: true)

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

  • rename_commands (Hash[String,String]) (defaults to: {})

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

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

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

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

    The specific port a replica will report to its master

  • repl_backlog_size (String[1]) (defaults to: '1mb')

    The replication backlog size

  • repl_backlog_ttl (Integer[0]) (defaults to: 3600)

    The number of seconds to elapse before freeing backlog buffer

  • repl_disable_tcp_nodelay (Boolean) (defaults to: false)

    Enable/disable TCP_NODELAY on the slave socket after SYNC

  • repl_ping_slave_period (Integer[1]) (defaults to: 10)

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

  • repl_timeout (Integer[1]) (defaults to: 60)

    Set the replication timeout for:

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

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

  • save_db_to_disk (Boolean) (defaults to: true)

    Set if save db to disk.

  • save_db_to_disk_interval (Hash) (defaults to: { '900' => '1', '300' => '10', '60' => '10000' })

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

  • service_manage (Boolean) (defaults to: true)

    Specify if the service should be part of the catalog.

  • service_enable (Boolean) (defaults to: true)

    Enable/disable daemon at boot.

  • service_ensure (Stdlib::Ensure::Service) (defaults to: 'running')

    Specify if the server should be running.

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

    Specify which group to run as.

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

    Specify the service name for Init or Systemd.

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

    Specify which user to run as.

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

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

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

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

  • set_max_intset_entries (Integer[0]) (defaults to: 512)

    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: 100)

    The priority number for slave promotion by Sentinel

  • slave_read_only (Boolean) (defaults to: true)

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

  • slave_serve_stale_data (Boolean) (defaults to: true)

    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: undef)

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

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

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

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

    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: 1024)

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

  • stop_writes_on_bgsave_error (Boolean) (defaults to: true)

    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: false)

    Enable/disable logging to the system logger.

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

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

  • tcp_backlog (Integer[0]) (defaults to: 511)

    Sets the TCP backlog

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

    TCP keepalive.

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

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

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

    Configure which TLS port to listen on.

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

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

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

    Specify which privaye key file to use for TLS connections.

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

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

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

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

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

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

  • tls_replication (Boolean) (defaults to: false)

    Specify if TLS should be enabled on replication links.

  • tls_cluster (Boolean) (defaults to: false)

    Specify if TLS should be used for the bus protocol.

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

    Configure allowed ciphers for TLS <= TLSv1.2.

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

    Configure allowed TLSv1.3 ciphersuites.

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

    Configure allowed TLS protocol versions.

  • tls_prefer_server_ciphers (Boolean) (defaults to: false)

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

  • ulimit (Integer[0]) (defaults to: 65536)

    Limit the use of system-wide resources.

  • ulimit_managed (Boolean) (defaults to: true)

    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/redis/redis.sock')

    Define unix socket path

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

    Define unix socket file permissions

  • workdir (Stdlib::Absolutepath) (defaults to: $redis::params::workdir)

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

  • workdir_mode (Stdlib::Filemode) (defaults to: '0750')

    Adjust mode for data directory.

  • workdir_group (Optional[String[1]]) (defaults to: undef)

    Adjust filesystem group for $workdir.

  • workdir_owner (Optional[String[1]]) (defaults to: undef)

    Adjust filesystem owner for $workdir.

  • debdefault_group (Optional[String[1]]) (defaults to: undef)

    group of /etc/defaults/redis on Debian systems if undef, $redis::config_group is taken

  • debdefault_file_mode (Optional[Stdlib::Filemode]) (defaults to: undef)

    filemode of /etc/defaults/redis on Debian systems if undef, $redis::config_file_mode is taken

  • debdefault_owner (Optional[String[1]]) (defaults to: undef)

    owner of /etc/defaults/redis on Debian systems if undef, $redis::config_owner is taken

  • zset_max_ziplist_entries (Integer[0]) (defaults to: 128)

    Set max entries for sorted sets.

  • zset_max_ziplist_value (Integer[0]) (defaults to: 64)

    Set max values for sorted sets.

  • cluster_enabled (Boolean) (defaults to: false)

    Enables redis 3.0 cluster functionality

  • cluster_config_file (String[1]) (defaults to: 'nodes.conf')

    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: 5000)

    Node timeout. Only set if cluster_enabled is true

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

    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: true)

    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: 1)

    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

  • instances (Hash[String[1], Hash]) (defaults to: {})

    Iterate through multiple instance configurations

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

    Number of threads to handle IO operations in Redis

  • io_threads_do_reads (Optional[Boolean]) (defaults to: undef)

    Enabled/disable io_threads to handle reads

  • cluster_allow_reads_when_down (Optional[Boolean]) (defaults to: undef)

    Allows nodes to serve read data while cluster status is down

  • cluster_replica_no_failover (Optional[Boolean]) (defaults to: undef)

    Disabled automatic failover for replica

  • dynamic_hz (Optional[Boolean]) (defaults to: undef)

    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: undef)

    Enable/disable active defragmentation

  • active_defrag_ignore_bytes (String[1]) (defaults to: '100mb')

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

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

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

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

    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: 1)

    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: 100)

    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: 1000)

    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: undef)

    Jemalloc background thread for purging will be enabled by default

  • rdb_save_incremental_fsync (Optional[Boolean]) (defaults to: undef)

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

  • dnf_module_stream (Optional[String[1]]) (defaults to: undef)

    Manage the DNF module and set the version. This only makes sense on distributions that use DNF package manager, such as EL8 or Fedora.

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

    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]
    
  • manage_service_file (Boolean) (defaults to: false)

    Determine if the systemd service file should be managed



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
# File 'manifests/init.pp', line 354

class redis (
  Boolean $activerehashing                                       = true,
  Boolean $aof_load_truncated                                    = true,
  Boolean $aof_rewrite_incremental_fsync                         = true,
  String[1] $appendfilename                                      = 'appendonly.aof',
  Enum['no', 'always', 'everysec'] $appendfsync                  = 'everysec',
  Boolean $appendonly                                            = false,
  String[1] $auto_aof_rewrite_min_size                           = '64mb',
  Integer[0] $auto_aof_rewrite_percentage                        = 100,
  Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]] $bind = ['127.0.0.1'],
  String[1] $output_buffer_limit_slave                           = '256mb 64mb 60',
  String[1] $output_buffer_limit_pubsub                          = '32mb 8mb 60',
  Stdlib::Absolutepath $bin_path                                 = $redis::params::bin_path,
  String[1] $conf_template                                       = 'redis/redis.conf.epp',
  Stdlib::Absolutepath $config_dir                               = $redis::params::config_dir,
  Stdlib::Filemode $config_dir_mode                              = $redis::params::config_dir_mode,
  Stdlib::Absolutepath $config_file                              = $redis::params::config_file,
  Stdlib::Filemode $config_file_mode                             = '0640',
  Stdlib::Absolutepath $config_file_orig                         = $redis::params::config_file_orig,
  String[1] $config_group                                        = $redis::params::config_group,
  String[1] $config_owner                                        = $redis::params::config_owner,
  Boolean $daemonize                                             = $redis::params::daemonize,
  Integer[1] $databases                                          = 16,
  Boolean $default_install                                       = true,
  Variant[String[1], Boolean] $dbfilename                        = 'dump.rdb',
  Optional[String] $extra_config_file                            = undef,
  Integer[0] $hash_max_ziplist_entries                           = 512,
  Integer[0] $hash_max_ziplist_value                             = 64,
  Integer[0] $hll_sparse_max_bytes                               = 3000,
  Integer[1, 500] $hz                                            = 10,
  Integer[0] $latency_monitor_threshold                          = 0,
  Integer[0] $list_max_ziplist_entries                           = 512,
  Integer[0] $list_max_ziplist_value                             = 64,
  Stdlib::Absolutepath $log_dir                                  = $redis::params::log_dir,
  Stdlib::Filemode $log_dir_mode                                 = $redis::params::log_dir_mode,
  String $log_file                                               = 'redis.log',
  Redis::LogLevel $log_level                                     = 'notice',
  Boolean $manage_service_file                                   = false,
  Boolean $manage_package                                        = true,
  Boolean $manage_repo                                           = false,
  Optional[Variant[String[1], Sensitive[String[1]], Deferred]] $masterauth = undef,
  Integer[1] $maxclients                                         = 10000,
  $maxmemory                                                     = undef,
  Optional[Redis::MemoryPolicy] $maxmemory_policy                = undef,
  Optional[Integer[1, 10]] $maxmemory_samples                    = undef,
  Integer[0] $min_slaves_max_lag                                 = 10,
  Integer[0] $min_slaves_to_write                                = 0,
  Array[Stdlib::Absolutepath] $modules                           = [],
  Boolean $no_appendfsync_on_rewrite                             = false,
  Optional[String[1]] $notify_keyspace_events                    = undef,
  Boolean $notify_service                                        = true,
  Boolean $managed_by_cluster_manager                            = false,
  String[1] $package_ensure                                      = 'installed',
  String[1] $package_name                                        = $redis::params::package_name,
  Stdlib::Absolutepath $pid_file                                 = $redis::params::pid_file,
  Stdlib::Port $port                                             = 6379,
  Boolean $protected_mode                                        = true,
  Optional[String] $ppa_repo                                     = undef,
  Boolean $redis_apt_repo                                        = false,
  Stdlib::HTTPSUrl $apt_location                                 = 'https://packages.redis.io/deb/',
  String[1] $apt_repos                                           = 'main',
  Optional[String] $apt_release                                  = undef,
  String[1] $apt_key_id                                          = '54318FA4052D1E61A6B6F7BB5F4349D6BF53AA0C',
  String[1] $apt_key_server                                      = 'hkp://keyserver.ubuntu.com/',
  Optional[String] $apt_key_options                              = undef,
  Boolean $rdbcompression                                        = true,
  Hash[String,String] $rename_commands                           = {},
  Optional[Stdlib::Host] $repl_announce_ip                       = undef,
  Optional[Stdlib::Port] $repl_announce_port                     = undef,
  String[1] $repl_backlog_size                                   = '1mb',
  Integer[0] $repl_backlog_ttl                                   = 3600,
  Boolean $repl_disable_tcp_nodelay                              = false,
  Integer[1] $repl_ping_slave_period                             = 10,
  Integer[1] $repl_timeout                                       = 60,
  Optional[Variant[String, Sensitive[String[1]], Deferred]] $requirepass = undef,
  Boolean $save_db_to_disk                                       = true,
  Hash $save_db_to_disk_interval                                 = { '900' => '1', '300' => '10', '60' => '10000' },
  Boolean $service_enable                                        = true,
  Stdlib::Ensure::Service $service_ensure                        = 'running',
  String[1] $service_group                                       = 'redis',
  Boolean $service_manage                                        = true,
  String[1] $service_name                                        = $redis::params::service_name,
  String[1] $service_user                                        = 'redis',
  Optional[Integer[0]] $service_timeout_start                    = undef,
  Optional[Integer[0]] $service_timeout_stop                     = undef,
  Integer[0] $set_max_intset_entries                             = 512,
  Integer[0] $slave_priority                                     = 100,
  Boolean $slave_read_only                                       = true,
  Boolean $slave_serve_stale_data                                = true,
  Optional[String[1]] $slaveof                                   = undef,
  Optional[String[1]] $replicaof                                 = undef,
  Integer[-1] $slowlog_log_slower_than                           = 10000,
  Integer[0] $slowlog_max_len                                    = 1024,
  Boolean $stop_writes_on_bgsave_error                           = true,
  Boolean $syslog_enabled                                        = false,
  Optional[String[1]] $syslog_facility                           = undef,
  Integer[0] $tcp_backlog                                        = 511,
  Integer[0] $tcp_keepalive                                      = 0,
  Integer[0] $timeout                                            = 0,
  Optional[Stdlib::Port] $tls_port                               = undef,
  Optional[Stdlib::Absolutepath] $tls_cert_file                  = undef,
  Optional[Stdlib::Absolutepath] $tls_key_file                   = undef,
  Optional[Stdlib::Absolutepath] $tls_ca_cert_file               = undef,
  Optional[Stdlib::Absolutepath] $tls_ca_cert_dir                = undef,
  Enum['yes', 'no', 'optional'] $tls_auth_clients                = 'no',
  Boolean $tls_replication                                       = false,
  Boolean $tls_cluster                                           = false,
  Optional[String[1]] $tls_ciphers                               = undef,
  Optional[String[1]] $tls_ciphersuites                          = undef,
  Optional[String[1]] $tls_protocols                             = undef,
  Boolean $tls_prefer_server_ciphers                             = false,
  Variant[Stdlib::Absolutepath, Enum['']] $unixsocket            = '/var/run/redis/redis.sock',
  Variant[Stdlib::Filemode, Enum['']] $unixsocketperm            = '0755',
  Integer[0] $ulimit                                             = 65536,
  Boolean $ulimit_managed                                        = true,
  Stdlib::Absolutepath $workdir                                  = $redis::params::workdir,
  Stdlib::Filemode $workdir_mode                                 = '0750',
  Optional[String[1]] $workdir_group                             = undef,
  Optional[String[1]] $workdir_owner                             = undef,
  Optional[String[1]] $debdefault_group                          = undef,
  Optional[Stdlib::Filemode] $debdefault_file_mode               = undef,
  Optional[String[1]] $debdefault_owner                          = undef,
  Integer[0] $zset_max_ziplist_entries                           = 128,
  Integer[0] $zset_max_ziplist_value                             = 64,
  Boolean $cluster_enabled                                       = false,
  String[1] $cluster_config_file                                 = 'nodes.conf',
  Integer[1] $cluster_node_timeout                               = 5000,
  Integer[0] $cluster_slave_validity_factor                      = 0,
  Boolean $cluster_require_full_coverage                         = true,
  Integer[0] $cluster_migration_barrier                          = 1,
  Hash[String[1], Hash] $instances                               = {},
  Optional[Integer[1]] $io_threads                               = undef,
  Optional[Boolean] $io_threads_do_reads                         = undef,
  Optional[Boolean] $cluster_allow_reads_when_down               = undef,
  Optional[Boolean] $cluster_replica_no_failover                 = undef,
  Optional[Boolean] $dynamic_hz                                  = undef,
  Optional[Boolean] $activedefrag                                = undef,
  String[1] $active_defrag_ignore_bytes                          = '100mb',
  Integer[1, 100] $active_defrag_threshold_lower                 = 10,
  Integer[1, 100] $active_defrag_threshold_upper                 = 100,
  Integer[1, 100] $active_defrag_cycle_min                       = 1,
  Integer[1, 100] $active_defrag_cycle_max                       = 100,
  Integer[1] $active_defrag_max_scan_fields                      = 1000,
  Optional[Boolean] $jemalloc_bg_thread                          = undef,
  Optional[Boolean] $rdb_save_incremental_fsync                  = undef,
  Optional[String[1]] $dnf_module_stream                         = undef,
  Array[String[1]] $acls                                         = [],
) inherits redis::params {
  contain redis::preinstall
  contain redis::install
  contain redis::config
  contain redis::service

  $instances.each | String $key, Hash $values | {
    redis::instance { $key:
      * => $values,
    }
  }

  Class['redis::preinstall']
  -> Class['redis::install']
  -> Class['redis::config']

  if $redis::notify_service {
    Class['redis::config']
    ~> Class['redis::service']
  }
}