redis
: This class installs redisredis::administration
: Allows various administrative settings for Redisredis::globals
: Set a global config for Redisredis::sentinel
: Install redis-sentinel
redis::config
: This class provides configuration for Redis.redis::dnfmodule
: Manage the DNF moduleredis::install
: This class installs the application.redis::params
: This class provides a number of parameters.redis::preinstall
: Provides anything required by the install class, such as package repositories.redis::service
: This class manages the Redis daemon.redis::ulimit
: Redis class for configuring ulimit Used to DRY up the config class, and move the logic for ulimit changes all into one place. Parameters are
redis::instance
: Allows the configuration of multiple redis configurations on one machine
redis::get
: Returns the value of the key being looked up orundef
if the key does not exist.
Redis::LogLevel
: Specify the server verbosity level.Redis::MemoryPolicy
: Specify the server maxmemory_policy.Redis::RedisUrl
: validate URL matches redis protocol
redis_cli
: Executes a redis-cli command on the target system
This class installs redis
include redis
class { '::redis':
bind => '10.0.1.2',
slaveof => '10.0.1.1 6379',
}
class { 'redis':
bind => ['127.0.0.1', '10.0.0.1', '10.1.0.1'],
}
class { 'redis':
bind => [],
}
The following parameters are available in the redis
class:
activerehashing
aof_load_truncated
aof_rewrite_incremental_fsync
appendfilename
appendfsync
appendonly
auto_aof_rewrite_min_size
auto_aof_rewrite_percentage
bind
bin_path
config_dir
config_dir_mode
config_file_orig
config_file
config_file_mode
config_group
config_owner
conf_template
daemonize
default_install
databases
dbfilename
extra_config_file
hash_max_ziplist_entries
hash_max_ziplist_value
hll_sparse_max_bytes
hz
latency_monitor_threshold
list_max_ziplist_entries
list_max_ziplist_value
log_dir
log_dir_mode
log_file
log_level
manage_repo
manage_package
managed_by_cluster_manager
masterauth
maxclients
maxmemory
maxmemory_policy
maxmemory_samples
min_slaves_max_lag
min_slaves_to_write
modules
no_appendfsync_on_rewrite
notify_keyspace_events
notify_service
output_buffer_limit_slave
output_buffer_limit_pubsub
package_ensure
package_name
pid_file
port
protected_mode
ppa_repo
redis_apt_repo
apt_location
apt_repos
apt_release
apt_key_id
apt_key_server
apt_key_options
rdbcompression
rename_commands
repl_announce_ip
repl_announce_port
repl_backlog_size
repl_backlog_ttl
repl_disable_tcp_nodelay
repl_ping_slave_period
repl_timeout
requirepass
save_db_to_disk
save_db_to_disk_interval
service_manage
service_enable
service_ensure
service_group
service_name
service_user
service_timeout_start
service_timeout_stop
set_max_intset_entries
slave_priority
slave_read_only
slave_serve_stale_data
slaveof
replicaof
slowlog_log_slower_than
slowlog_max_len
stop_writes_on_bgsave_error
syslog_enabled
syslog_facility
tcp_backlog
tcp_keepalive
timeout
tls_port
tls_cert_file
tls_key_file
tls_ca_cert_file
tls_ca_cert_dir
tls_auth_clients
tls_replication
tls_cluster
tls_ciphers
tls_ciphersuites
tls_protocols
tls_prefer_server_ciphers
ulimit
ulimit_managed
unixsocket
unixsocketperm
workdir
workdir_mode
zset_max_ziplist_entries
zset_max_ziplist_value
cluster_enabled
cluster_config_file
cluster_node_timeout
cluster_slave_validity_factor
cluster_require_full_coverage
cluster_migration_barrier
instances
io_threads
io_threads_do_reads
cluster_allow_reads_when_down
cluster_replica_no_failover
dynamic_hz
activedefrag
active_defrag_ignore_bytes
active_defrag_threshold_lower
active_defrag_threshold_upper
active_defrag_cycle_min
active_defrag_cycle_max
active_defrag_max_scan_fields
jemalloc_bg_thread
rdb_save_incremental_fsync
dnf_module_stream
manage_service_file
Data type: Boolean
Enable/disable active rehashing.
Default value: true
Data type: Boolean
Enable/disable loading truncated AOF file
Default value: true
Data type: Boolean
Enable/disable fsync for AOF file
Default value: true
Data type: String[1]
The name of the append only file
Default value: 'appendonly.aof'
Data type: Enum['no', 'always', 'everysec']
Adjust fsync mode
Default value: 'everysec'
Data type: Boolean
Enable/disable appendonly mode.
Default value: false
Data type: String[1]
Adjust minimum size for auto-aof-rewrite.
Default value: '64mb'
Data type: Integer[0]
Adjust percentatge for auto-aof-rewrite.
Default value: 100
Data type: Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]
Configure which IP address(es) to listen on. To bind on all interfaces, use an empty array.
Default value: ['127.0.0.1']
Data type: Stdlib::Absolutepath
Directory containing redis binary executables.
Default value: $redis::params::bin_path
Data type: Stdlib::Absolutepath
Directory containing the configuration files.
Default value: $redis::params::config_dir
Data type: Stdlib::Filemode
Adjust mode for directory containing configuration files.
Default value: $redis::params::config_dir_mode
Data type: Stdlib::Absolutepath
The location and name of a config file that provides the source
Default value: $redis::params::config_file_orig
Data type: Stdlib::Absolutepath
Adjust main configuration file.
Default value: $redis::params::config_file
Data type: Stdlib::Filemode
Adjust permissions for configuration files.
Default value: '0640'
Data type: String[1]
Adjust filesystem group for config files.
Default value: $redis::params::config_group
Data type: String[1]
Adjust filesystem owner for config files.
Default value: $redis::params::config_owner
Data type: String[1]
Define which template to use.
Default value: 'redis/redis.conf.epp'
Data type: Boolean
Have Redis run as a daemon.
Default value: $redis::params::daemonize
Data type: Boolean
Configure a default install of redis.
Default value: true
Data type: Integer[1]
Set the number of databases.
Default value: 16
Data type: Variant[String[1], Boolean]
The filename where to dump the DB
Default value: 'dump.rdb'
Data type: Optional[String]
Optional extra config file to include
Default value: undef
Data type: Integer[0]
Set max ziplist entries for hashes.
Default value: 512
Data type: Integer[0]
Set max ziplist values for hashes.
Default value: 64
Data type: Integer[0]
HyperLogLog sparse representation bytes limit
Default value: 3000
Data type: Integer[1, 500]
Set redis background tasks frequency
Default value: 10
Data type: Integer[0]
Latency monitoring threshold in milliseconds
Default value: 0
Data type: Integer[0]
Set max ziplist entries for lists.
Default value: 512
Data type: Integer[0]
Set max ziplist values for lists.
Default value: 64
Data type: Stdlib::Absolutepath
Specify directory where to write log entries.
Default value: $redis::params::log_dir
Data type: Stdlib::Filemode
Adjust mode for directory containing log files.
Default value: $redis::params::log_dir_mode
Data type: String
Specify file where to write log entries. Relative paths will be prepended with log_dir but absolute paths are also accepted.
Default value: 'redis.log'
Data type: Redis::LogLevel
Specify the server verbosity level.
Default value: 'notice'
Data type: Boolean
Enable/disable upstream repository configuration.
Default value: false
Data type: Boolean
Enable/disable management of package
Default value: true
Data type: Boolean
Choose if redis will be managed by a cluster manager such as pacemaker or rgmanager
Default value: false
Data type: Optional[Variant[String[1], Sensitive[String[1]], Deferred]]
If the master is password protected (using the "requirepass" configuration
Default value: undef
Data type: Integer[1]
Set the max number of connected clients at the same time.
Default value: 10000
Data type: Any
Don't use more memory than the specified amount of bytes.
Default value: undef
Data type: Optional[Redis::MemoryPolicy]
How Redis will select what to remove when maxmemory is reached.
Default value: undef
Data type: Optional[Integer[1, 10]]
Select as well the sample size to check.
Default value: undef
Data type: Integer[0]
The lag in seconds
Default value: 10
Data type: Integer[0]
Minimum number of slaves to be in "online" state
Default value: 0
Data type: Array[Stdlib::Absolutepath]
Additional redis modules to load (.so path)
Default value: []
Data type: Boolean
If you have latency problems turn this to 'true'. Otherwise leave it as
Default value: false
Data type: Optional[String[1]]
Which events to notify Pub/Sub clients about events happening
Default value: undef
Data type: Boolean
You may disable service reloads when config files change
Default value: true
Data type: String[1]
Value of client-output-buffer-limit-slave in redis config
Default value: '256mb 64mb 60'
Data type: String[1]
Value of client-output-buffer-limit-pubsub in redis config
Default value: '32mb 8mb 60'
Data type: String[1]
Default action for package.
Default value: 'installed'
Data type: String[1]
Upstream package name.
Default value: $redis::params::package_name
Data type: Stdlib::Absolutepath
Where to store the pid.
Default value: $redis::params::pid_file
Data type: Stdlib::Port
Configure which port to listen on.
Default value: 6379
Data type: Boolean
Whether protected mode is enabled or not. Only applicable when no bind is set.
Default value: true
Data type: Optional[String]
Specify upstream (Ubuntu) PPA entry.
Default value: undef
Data type: Boolean
If you want to use the redis apt repository.
Default value: false
Data type: Stdlib::HTTPSUrl
Specify the URL of the apt repository.
Default value: 'https://packages.redis.io/deb/'
Data type: String[1]
Specify the repository to use for apt. Defaults to 'main'.
Default value: 'main'
Data type: Optional[String]
Specify the os codename.
Default value: undef
Data type: String[1]
Specify the PGP key id to use for apt.
Default value: '54318FA4052D1E61A6B6F7BB5F4349D6BF53AA0C'
Data type: String[1]
Specify the PGP key server to use for apt.
Default value: 'hkp://keyserver.ubuntu.com/'
Data type: Optional[String]
Passes additional options to apt-key adv --keyserver-options
.
Default value: undef
Data type: Boolean
Enable/disable compression of string objects using LZF when dumping.
Default value: true
Data type: Hash[String,String]
A list of Redis commands to rename or disable for security reasons
Default value: {}
Data type: Optional[Stdlib::Host]
The specific IP or hostname a replica will report to its master
Default value: undef
Data type: Optional[Stdlib::Port]
The specific port a replica will report to its master
Default value: undef
Data type: String[1]
The replication backlog size
Default value: '1mb'
Data type: Integer[0]
The number of seconds to elapse before freeing backlog buffer
Default value: 3600
Data type: Boolean
Enable/disable TCP_NODELAY on the slave socket after SYNC
Default value: false
Data type: Integer[1]
Slaves send PINGs to server in a predefined interval. It's possible
Default value: 10
Data type: Integer[1]
Set the replication timeout for:
Default value: 60
Data type: Optional[Variant[String, Deferred]]
Require clients to issue AUTH before processing any other commands.
Default value: undef
Data type: Boolean
Set if save db to disk.
Default value: true
Data type: Hash
save the dataset every N seconds if there are at least M changes in the dataset
Default value: { '900' => '1', '300' => '10', '60' => '10000' }
Data type: Boolean
Specify if the service should be part of the catalog.
Default value: true
Data type: Boolean
Enable/disable daemon at boot.
Default value: true
Data type: Stdlib::Ensure::Service
Specify if the server should be running.
Default value: 'running'
Data type: String[1]
Specify which group to run as.
Default value: 'redis'
Data type: String[1]
Specify the service name for Init or Systemd.
Default value: $redis::params::service_name
Data type: String[1]
Specify which user to run as.
Default value: 'redis'
Data type: Optional[Integer[0]]
Specify the time after which a service startup should be considered as failed.
Default value: undef
Data type: Optional[Integer[0]]
Specify the time after which a service stop should be considered as failed.
Default value: undef
Data type: Integer[0]
The following configuration setting sets the limit in the size of the set in order to use this special memory saving encoding.
Default value: 512
Data type: Integer[0]
The priority number for slave promotion by Sentinel
Default value: 100
Data type: Boolean
You can configure a slave instance to accept writes or not.
Default value: true
Data type: Boolean
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:
- 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.
- 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.
Default value: true
Data type: Optional[String[1]]
Use slaveof to make a Redis instance a copy of another Redis server.
Default value: undef
Data type: Optional[String[1]]
Use replicaof to make a Redis instance a copy of another Redis server.
Default value: undef
Data type: Integer[-1]
Tells Redis what is the execution time, in microseconds, to exceed in order for the command to get logged.
Default value: 10000
Data type: Integer[0]
Tells Redis what is the length to exceed in order for the command to get logged.
Default value: 1024
Data type: Boolean
If false then Redis will continue to work as usual even if there are problems with disk, permissions, and so forth.
Default value: true
Data type: Boolean
Enable/disable logging to the system logger.
Default value: false
Data type: Optional[String[1]]
Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
Default value: undef
Data type: Integer[0]
Sets the TCP backlog
Default value: 511
Data type: Integer[0]
TCP keepalive.
Default value: 0
Data type: Integer[0]
Close the connection after a client is idle for N seconds (0 to disable).
Default value: 0
Data type: Optional[Stdlib::Port]
Configure which TLS port to listen on.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 certificate file to use for TLS connections.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which privaye key file to use for TLS connections.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle file to use.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle directory to use.
Default value: undef
Data type: Enum['yes', 'no', 'optional']
Specify if clients and replicas are required to authenticate using valid client side certificates.
Default value: 'no'
Data type: Boolean
Specify if TLS should be enabled on replication links.
Default value: false
Data type: Boolean
Specify if TLS should be used for the bus protocol.
Default value: false
Data type: Optional[String[1]]
Configure allowed ciphers for TLS <= TLSv1.2.
Default value: undef
Data type: Optional[String[1]]
Configure allowed TLSv1.3 ciphersuites.
Default value: undef
Data type: Optional[String[1]]
Configure allowed TLS protocol versions.
Default value: undef
Data type: Boolean
Specify if the server's preference should be used when choosing a cipher.
Default value: false
Data type: Integer[0]
Limit the use of system-wide resources.
Default value: 65536
Data type: Boolean
Defines wheter the max number of open files for the systemd service unit is explicitly managed.
Default value: true
Data type: Variant[Stdlib::Absolutepath, Enum['']]
Define unix socket path
Default value: '/var/run/redis/redis.sock'
Data type: Variant[Stdlib::Filemode, Enum['']]
Define unix socket file permissions
Default value: '0755'
Data type: Stdlib::Absolutepath
The DB will be written inside this directory, with the filename specified above using the 'dbfilename' configuration directive.
Default value: $redis::params::workdir
Data type: Stdlib::Filemode
Adjust mode for data directory.
Default value: '0750'
Data type: Integer[0]
Set max entries for sorted sets.
Default value: 128
Data type: Integer[0]
Set max values for sorted sets.
Default value: 64
Data type: Boolean
Enables redis 3.0 cluster functionality
Default value: false
Data type: String[1]
Config file for saving cluster nodes configuration. This file is never touched by humans. Only set if cluster_enabled is true
Default value: 'nodes.conf'
Data type: Integer[1]
Node timeout. Only set if cluster_enabled is true
Default value: 5000
Data type: Integer[0]
Control variable to disable promoting slave in case of disconnection from master Only set if cluster_enabled is true
Default value: 0
Data type: Boolean
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
Default value: true
Data type: Integer[0]
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
Default value: 1
Data type: Hash[String[1], Hash]
Iterate through multiple instance configurations
Default value: {}
Data type: Optional[Integer[1]]
Number of threads to handle IO operations in Redis
Default value: undef
Data type: Optional[Boolean]
Enabled/disable io_threads to handle reads
Default value: undef
Data type: Optional[Boolean]
Allows nodes to serve read data while cluster status is down
Default value: undef
Data type: Optional[Boolean]
Disabled automatic failover for replica
Default value: undef
Data type: Optional[Boolean]
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.
Default value: undef
Data type: Optional[Boolean]
Enable/disable active defragmentation
Default value: undef
Data type: String[1]
Minimum amount of fragmentation waste to start active defrag Only set if activedefrag is true
Default value: '100mb'
Data type: Integer[1, 100]
Minimum percentage of fragmentation to start active defrag Only set if activedefrag is true
Default value: 10
Data type: Integer[1, 100]
Maximum percentage of fragmentation at which we use maximum effort Only set if activedefrag is true
Default value: 100
Data type: Integer[1, 100]
Minimal effort for defrag in CPU percentage, to be used when the lower threshold is reached Only set if activedefrag is true
Default value: 1
Data type: Integer[1, 100]
Maximal effort for defrag in CPU percentage, to be used when the upper threshold is reached Only set if activedefrag is true
Default value: 100
Data type: Integer[1]
Maximum number of set/hash/zset/list fields that will be processed from the main dictionary scan Only set if activedefrag is true
Default value: 1000
Data type: Optional[Boolean]
Jemalloc background thread for purging will be enabled by default
Default value: undef
Data type: Optional[Boolean]
When redis saves RDB file, if the following option is enabled the file will be fsync-ed every 32 MB of data generated.
Default value: undef
Data type: Optional[String[1]]
Manage the DNF module and set the version. This only makes sense on distributions that use DNF package manager, such as EL8 or Fedora.
Default value: undef
Data type: Boolean
Determine if the systemd service file should be managed
Default value: false
As documented in the FAQ and https://redis.io/topics/admin. For disabling Transparent Huge Pages (THP), use separate module such as: https://forge.puppet.com/modules/alexharvey/disable_transparent_hugepage
Note that this class requires the herculesteam/augeasproviders_sysctl module.
include redis::administration
class {'redis::administration':
enable_overcommit_memory => false,
}
The following parameters are available in the redis::administration
class:
Data type: Boolean
Enable the overcommit memory setting
Default value: true
Data type: Integer[0]
Set somaxconn value
Default value: 65535
Set a global config for Redis
The following parameters are available in the redis::globals
class:
Data type: Optional[String]
Use a specific Software Collection on Red Hat 7 based systems
Default value: undef
Install redis-sentinel
include redis::sentinel
class {'redis::sentinel':
down_after => 80000,
log_file => '/var/log/redis/sentinel.log',
}
The following parameters are available in the redis::sentinel
class:
auth_pass
config_file
config_file_orig
config_file_mode
conf_template
daemonize
down_after
failover_timeout
log_file
log_level
master_name
redis_host
redis_port
requirepass
protected_mode
package_name
package_ensure
parallel_sync
pid_file
quorum
sentinel_announce_hostnames
sentinel_announce_ip
sentinel_bind
sentinel_port
sentinel_resolve_hostnames
sentinel_tls_port
service_group
service_name
service_user
service_enable
tls_cert_file
tls_key_file
tls_ca_cert_file
tls_ca_cert_dir
tls_auth_clients
tls_replication
working_dir
notification_script
client_reconfig_script
service_ensure
Data type: Optional[Variant[String[1], Sensitive[String[1]]]]
The password to use to authenticate with the master and slaves.
Default value: undef
Data type: Stdlib::Absolutepath
The location and name of the sentinel config file.
Default value: $redis::params::sentinel_config_file
Data type: Stdlib::Absolutepath
The location and name of a config file that provides the source of the sentinel config file. Two different files are needed because sentinel itself writes to its own config file and we do not want override that when puppet is run unless there are changes from the manifests.
Default value: $redis::params::sentinel_config_file_orig
Data type: Stdlib::Filemode
Permissions of config file.
Default value: '0644'
Data type: String[1]
Define which template to use.
Default value: 'redis/redis-sentinel.conf.erb'
Data type: Boolean
Have Redis sentinel run as a daemon.
Default value: $redis::params::sentinel_daemonize
Data type: Integer[1]
Number of milliseconds the master (or any attached slave or sentinel) should be unreachable (as in, not acceptable reply to PING, continuously, for the specified period) in order to consider it in S_DOWN state.
Default value: 30000
Data type: Integer[1]
Specify the failover timeout in milliseconds.
Default value: 180000
Data type: Stdlib::Absolutepath
Specify where to write log entries.
Default value: $redis::params::sentinel_log_file
Data type: Redis::LogLevel
Specify how much we should log.
Default value: 'notice'
Data type: String[1]
Specify the name of the master redis server. The valid charset is A-z 0-9 and the three characters ".-_".
Default value: 'mymaster'
Data type: Stdlib::Host
Specify the bound host of the master redis server.
Default value: '127.0.0.1'
Data type: Stdlib::Port
Specify the port of the master redis server.
Default value: 6379
Data type: Optional[String[1]]
Specify the password to require client authentication via the AUTH command, however this feature is only available starting with Redis 5.0.1.
Default value: undef
Data type: Boolean
Whether protected mode is enabled or not. Only applicable when no bind is set.
Default value: true
Data type: String[1]
The name of the package that installs sentinel.
Default value: $redis::params::sentinel_package_name
Data type: String[1]
Do we ensure this package. This parameter takes effect only if an independent package is required for sentinel.
Default value: 'installed'
Data type: Integer[0]
How many slaves can be reconfigured at the same time to use a new master after a failover.
Default value: 1
Data type: Stdlib::Absolutepath
If sentinel is daemonized it will write its pid at this location.
Default value: $redis::params::sentinel_pid_file
Data type: Integer[1]
Number of sentinels that must agree that a master is down to signal sdown state.
Default value: 2
Data type: Optional[Enum['yes', 'no']]
Whether or not sentinels will announce hostnames instead of ip addresses to clients. This can be required for TLS.
Default value: undef
Data type: Optional[Stdlib::Host]
Specify the IP or hostname that Sentinel will announce
Default value: undef
Data type: Variant[Undef, Stdlib::IP::Address, Array[Stdlib::IP::Address]]
Allow optional sentinel server ip binding. Can help overcome issues arising from protect-mode added Redis 3.2
Default value: undef
Data type: Stdlib::Port
The port of sentinel server.
Default value: 26379
Data type: Optional[Enum['yes', 'no']]
Whether or not sentinels can resolve hostnames to ip addresses.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
Configure which TLS port to listen on.
Default value: undef
Data type: String[1]
The group of the config file.
Default value: 'redis'
Data type: String[1]
The name of the service (for puppet to manage).
Default value: $redis::params::sentinel_service_name
Data type: String[1]
The owner of the config file.
Default value: 'redis'
Data type: Boolean
Enable the service at boot time.
Default value: true
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 certificate file to use for TLS connections.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which privaye key file to use for TLS connections.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle file to use.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle directory to use.
Default value: undef
Data type: Enum['yes', 'no', 'optional']
Specify if clients and replicas are required to authenticate using valid client side certificates.
Default value: 'no'
Data type: Boolean
Specify if TLS should be enabled on replication links.
Default value: false
Data type: Stdlib::Absolutepath
The directory into which sentinel will change to avoid mount conflicts.
Default value: $redis::params::sentinel_working_dir
Data type: Optional[Stdlib::Absolutepath]
Path to the notification script
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Path to the client-reconfig script
Default value: undef
Data type: Stdlib::Ensure::Service
Default value: 'running'
This is an defined type to allow the configuration of multiple redis instances on one machine without conflicts
redis::instance {'6380':
port => 6380,
}
The following parameters are available in the redis::instance
defined type:
activerehashing
aof_load_truncated
aof_rewrite_incremental_fsync
appendfilename
appendfsync
appendonly
auto_aof_rewrite_min_size
auto_aof_rewrite_percentage
bind
config_file_orig
config_file
config_file_mode
config_group
config_owner
conf_template
daemonize
databases
dbfilename
extra_config_file
hash_max_ziplist_entries
hash_max_ziplist_value
hll_sparse_max_bytes
hz
latency_monitor_threshold
list_max_ziplist_entries
list_max_ziplist_value
log_dir
log_dir_mode
log_file
log_level
managed_by_cluster_manager
manage_service_file
masterauth
maxclients
maxmemory
maxmemory_policy
maxmemory_samples
min_slaves_max_lag
min_slaves_to_write
modules
no_appendfsync_on_rewrite
notify_keyspace_events
notify_service
pid_file
port
protected_mode
rdbcompression
rename_commands
repl_announce_ip
repl_announce_port
repl_backlog_size
repl_backlog_ttl
repl_disable_tcp_nodelay
repl_ping_slave_period
repl_timeout
requirepass
save_db_to_disk
save_db_to_disk_interval
service_name
service_enable
service_ensure
service_group
service_user
service_timeout_start
service_timeout_stop
set_max_intset_entries
slave_priority
slave_read_only
slave_serve_stale_data
slaveof
replicaof
slowlog_log_slower_than
slowlog_max_len
stop_writes_on_bgsave_error
syslog_enabled
syslog_facility
tcp_backlog
tcp_keepalive
timeout
tls_port
tls_cert_file
tls_key_file
tls_ca_cert_file
tls_ca_cert_dir
tls_auth_clients
tls_replication
tls_cluster
tls_ciphers
tls_ciphersuites
tls_protocols
tls_prefer_server_ciphers
ulimit
ulimit_managed
unixsocket
unixsocketperm
workdir
workdir_mode
zset_max_ziplist_entries
zset_max_ziplist_value
cluster_enabled
cluster_config_file
cluster_node_timeout
cluster_slave_validity_factor
cluster_require_full_coverage
cluster_migration_barrier
io_threads
io_threads_do_reads
cluster_allow_reads_when_down
cluster_replica_no_failover
dynamic_hz
activedefrag
active_defrag_ignore_bytes
active_defrag_threshold_lower
active_defrag_threshold_upper
active_defrag_cycle_min
active_defrag_cycle_max
active_defrag_max_scan_fields
jemalloc_bg_thread
rdb_save_incremental_fsync
output_buffer_limit_slave
output_buffer_limit_pubsub
Data type: Boolean
Enable/disable active rehashing.
Default value: $redis::activerehashing
Data type: Boolean
Enable/disable loading truncated AOF file
Default value: $redis::aof_load_truncated
Data type: Boolean
Enable/disable fsync for AOF file
Default value: $redis::aof_rewrite_incremental_fsync
Data type: String[1]
The name of the append only file
Default value: $redis::appendfilename
Data type: Enum['no', 'always', 'everysec']
Adjust fsync mode. Valid options: always, everysec, no.
Default value: $redis::appendfsync
Data type: Boolean
Enable/disable appendonly mode.
Default value: $redis::appendonly
Data type: String[1]
Adjust minimum size for auto-aof-rewrite.
Default value: $redis::auto_aof_rewrite_min_size
Data type: Integer[0]
Adjust percentatge for auto-aof-rewrite.
Default value: $redis::auto_aof_rewrite_percentage
Data type: Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]
Configure which IP address(es) to listen on. To bind on all interfaces, use an empty array.
Default value: $redis::bind
Data type: Stdlib::Absolutepath
The location and name of a config file that provides the source
Default value: $redis::config_file_orig
Data type: Stdlib::Absolutepath
Adjust main configuration file.
Default value: $redis::config_file
Data type: Stdlib::Filemode
Adjust permissions for configuration files.
Default value: $redis::config_file_mode
Data type: String[1]
Adjust filesystem group for config files.
Default value: $redis::config_group
Data type: String[1]
Adjust filesystem owner for config files.
Default value: $redis::config_owner
Data type: String[1]
Define which template to use.
Default value: $redis::conf_template
Data type: Boolean
Have Redis run as a daemon.
Default value: true
Data type: Integer[1]
Set the number of databases.
Default value: $redis::databases
Data type: Variant[String[1], Boolean]
The filename where to dump the DB
Default value: $redis::dbfilename
Data type: Optional[String]
Optional extra config file to include
Default value: $redis::extra_config_file
Data type: Integer[0]
Set max ziplist entries for hashes.
Default value: $redis::hash_max_ziplist_entries
Data type: Integer[0]
Set max ziplist values for hashes.
Default value: $redis::hash_max_ziplist_value
Data type: Integer[0]
HyperLogLog sparse representation bytes limit
Default value: $redis::hll_sparse_max_bytes
Data type: Integer[1, 500]
Set redis background tasks frequency
Default value: $redis::hz
Data type: Integer[0]
Latency monitoring threshold in milliseconds
Default value: $redis::latency_monitor_threshold
Data type: Integer[0]
Set max ziplist entries for lists.
Default value: $redis::list_max_ziplist_entries
Data type: Integer[0]
Set max ziplist values for lists.
Default value: $redis::list_max_ziplist_value
Data type: Stdlib::Absolutepath
Specify directory where to write log entries.
Default value: $redis::log_dir
Data type: Stdlib::Filemode
Adjust mode for directory containing log files.
Default value: $redis::log_dir_mode
Data type: String
Specify file where to write log entries. Relative paths will be prepended with log_dir but absolute paths are also accepted.
Default value: "redis-server-${name}.log"
Data type: Redis::LogLevel
Specify the server verbosity level.
Default value: $redis::log_level
Data type: Boolean
Choose if redis will be managed by a cluster manager such as pacemaker or rgmanager
Default value: $redis::managed_by_cluster_manager
Data type: Boolean
Determine if the systemd service file should be managed
Default value: true
Data type: Optional[Variant[String[1], Sensitive[String[1]], Deferred]]
If the master is password protected (using the "requirepass" configuration
Default value: $redis::masterauth
Data type: Integer[1]
Set the max number of connected clients at the same time.
Default value: $redis::maxclients
Data type: Optional[Variant[Integer, String]]
Don't use more memory than the specified amount of bytes.
Default value: $redis::maxmemory
Data type: Optional[Redis::MemoryPolicy]
How Redis will select what to remove when maxmemory is reached.
Default value: $redis::maxmemory_policy
Data type: Optional[Integer[1, 10]]
Select as well the sample size to check.
Default value: $redis::maxmemory_samples
Data type: Integer[0]
The lag in seconds
Default value: $redis::min_slaves_max_lag
Data type: Integer[0]
Minimum number of slaves to be in "online" state
Default value: $redis::min_slaves_to_write
Data type: Array[Stdlib::Absolutepath]
Additional redis modules to load (.so path)
Default value: $redis::modules
Data type: Boolean
If you have latency problems turn this to 'true'. Otherwise leave it as
Default value: $redis::no_appendfsync_on_rewrite
Data type: Optional[String[1]]
Which events to notify Pub/Sub clients about events happening
Default value: $redis::notify_keyspace_events
Data type: Boolean
You may disable instance service reloads when config file changes
Default value: true
Data type: Stdlib::Absolutepath
Where to store the pid.
Default value: "/var/run/${service_name}/redis.pid"
Data type: Stdlib::Port
Configure which port to listen on.
Default value: $redis::port
Data type: Boolean
Whether protected mode is enabled or not. Only applicable when no bind is set.
Default value: $redis::protected_mode
Data type: Boolean
Enable/disable compression of string objects using LZF when dumping.
Default value: $redis::rdbcompression
Data type: Hash[String,String]
A list of Redis commands to rename or disable for security reasons
Default value: $redis::rename_commands
Data type: Optional[Stdlib::Host]
The specific IP or hostname a replica will report to its master
Default value: $redis::repl_announce_ip
Data type: Optional[Stdlib::Port]
The specific port a replica will report to its master
Default value: $redis::repl_announce_port
Data type: String[1]
The replication backlog size
Default value: $redis::repl_backlog_size
Data type: Integer[0]
The number of seconds to elapse before freeing backlog buffer
Default value: $redis::repl_backlog_ttl
Data type: Boolean
Enable/disable TCP_NODELAY on the slave socket after SYNC
Default value: $redis::repl_disable_tcp_nodelay
Data type: Integer[1]
Slaves send PINGs to server in a predefined interval. It's possible
Default value: $redis::repl_ping_slave_period
Data type: Integer[1]
Set the replication timeout for:
Default value: $redis::repl_timeout
Data type: Optional[Variant[String, Deferred]]
Require clients to issue AUTH before processing any other commands.
Default value: $redis::requirepass
Data type: Boolean
Set if save db to disk.
Default value: $redis::save_db_to_disk
Data type: Hash
save the dataset every N seconds if there are at least M changes in the dataset
Default value: $redis::save_db_to_disk_interval
Data type: String[1]
The service name for this instance
Default value: "redis-server-${name}"
Data type: Boolean
Enable/disable daemon at boot.
Default value: $redis::service_enable
Data type: Stdlib::Ensure::Service
Specify if the server should be running.
Default value: $redis::service_ensure
Data type: String[1]
Specify which group to run as.
Default value: $redis::service_group
Data type: String[1]
Specify which user to run as.
Default value: $redis::service_user
Data type: Optional[Integer[0]]
Specify the time after which a service startup should be considered as failed.
Default value: $redis::service_timeout_start
Data type: Optional[Integer[0]]
Specify the time after which a service stop should be considered as failed.
Default value: $redis::service_timeout_stop
Data type: Integer[0]
The following configuration setting sets the limit in the size of the set in order to use this special memory saving encoding.
Default value: $redis::set_max_intset_entries
Data type: Integer[0]
The priority number for slave promotion by Sentinel
Default value: $redis::slave_priority
Data type: Boolean
You can configure a slave instance to accept writes or not.
Default value: $redis::slave_read_only
Data type: Boolean
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:
- 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.
- 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.
Default value: $redis::slave_serve_stale_data
Data type: Optional[String[1]]
Use slaveof to make a Redis instance a copy of another Redis server.
Default value: $redis::slaveof
Data type: Optional[String[1]]
Use replicaof to make a Redis instance a copy of another Redis server.
Default value: $redis::replicaof
Data type: Integer[-1]
Tells Redis what is the execution time, in microseconds, to exceed in order for the command to get logged.
Default value: $redis::slowlog_log_slower_than
Data type: Integer[0]
Tells Redis what is the length to exceed in order for the command to get logged.
Default value: $redis::slowlog_max_len
Data type: Boolean
If false then Redis will continue to work as usual even if there are problems with disk, permissions, and so forth.
Default value: $redis::stop_writes_on_bgsave_error
Data type: Boolean
Enable/disable logging to the system logger.
Default value: $redis::syslog_enabled
Data type: Optional[String[1]]
Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
Default value: $redis::syslog_facility
Data type: Integer[0]
Sets the TCP backlog
Default value: $redis::tcp_backlog
Data type: Integer[0]
TCP keepalive.
Default value: $redis::tcp_keepalive
Data type: Integer[0]
Close the connection after a client is idle for N seconds (0 to disable).
Default value: $redis::timeout
Data type: Optional[Stdlib::Port]
Configure which TLS port to listen on.
Default value: $redis::tls_port
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 certificate file to use for TLS connections.
Default value: $redis::tls_cert_file
Data type: Optional[Stdlib::Absolutepath]
Specify which privaye key file to use for TLS connections.
Default value: $redis::tls_key_file
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle file to use.
Default value: $redis::tls_ca_cert_file
Data type: Optional[Stdlib::Absolutepath]
Specify which X.509 CA certificate(s) bundle directory to use.
Default value: $redis::tls_ca_cert_dir
Data type: Enum['yes', 'no', 'optional']
Specify if clients and replicas are required to authenticate using valid client side certificates.
Default value: $redis::tls_auth_clients
Data type: Boolean
Specify if TLS should be enabled on replication links.
Default value: $redis::tls_replication
Data type: Boolean
Specify if TLS should be used for the bus protocol.
Default value: $redis::tls_cluster
Data type: Optional[String[1]]
Configure allowed ciphers for TLS <= TLSv1.2.
Default value: $redis::tls_ciphers
Data type: Optional[String[1]]
Configure allowed TLSv1.3 ciphersuites.
Default value: $redis::tls_ciphersuites
Data type: Optional[String[1]]
Configure allowed TLS protocol versions.
Default value: $redis::tls_protocols
Data type: Optional[Boolean]
Specify if the server's preference should be used when choosing a cipher.
Default value: $redis::tls_prefer_server_ciphers
Data type: Integer[0]
Limit the use of system-wide resources.
Default value: $redis::ulimit
Data type: Boolean
Defines wheter the max number of open files for the systemd service unit is explicitly managed.
Default value: $redis::ulimit_managed
Data type: Variant[Stdlib::Absolutepath, Enum['']]
Define unix socket path
Default value: "/var/run/${service_name}/redis.sock"
Data type: Variant[Stdlib::Filemode, Enum['']]
Define unix socket file permissions
Default value: $redis::unixsocketperm
Data type: Stdlib::Absolutepath
The DB will be written inside this directory, with the filename specified above using the 'dbfilename' configuration directive.
Default value: "${redis::workdir}/redis-server-${name}"
Data type: Stdlib::Filemode
Adjust mode for data directory.
Default value: $redis::workdir_mode
Data type: Integer[0]
Set max entries for sorted sets.
Default value: $redis::zset_max_ziplist_entries
Data type: Integer[0]
Set max values for sorted sets.
Default value: $redis::zset_max_ziplist_value
Data type: Boolean
Enables redis 3.0 cluster functionality
Default value: $redis::cluster_enabled
Data type: String[1]
Config file for saving cluster nodes configuration. This file is never touched by humans. Only set if cluster_enabled is true
Default value: $redis::cluster_config_file
Data type: Integer[1]
Node timeout. Only set if cluster_enabled is true
Default value: $redis::cluster_node_timeout
Data type: Integer[0]
Control variable to disable promoting slave in case of disconnection from master Only set if cluster_enabled is true
Default value: $redis::cluster_slave_validity_factor
Data type: Boolean
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
Default value: $redis::cluster_require_full_coverage
Data type: Integer[0]
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
Default value: $redis::cluster_migration_barrier
Data type: Optional[Integer[1]]
Number of threads to handle IO operations in Redis
Default value: $redis::io_threads
Data type: Optional[Boolean]
Enabled/disable io_threads to handle reads
Default value: $redis::io_threads_do_reads
Data type: Optional[Boolean]
Allows nodes to serve read data while cluster status is down
Default value: $redis::cluster_allow_reads_when_down
Data type: Optional[Boolean]
Disabled automatic failover for replica
Default value: $redis::cluster_replica_no_failover
Data type: Optional[Boolean]
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.
Default value: $redis::dynamic_hz
Data type: Optional[Boolean]
Enable/disable active defragmentation
Default value: $redis::activedefrag
Data type: String[1]
Minimum amount of fragmentation waste to start active defrag Only set if activedefrag is true
Default value: $redis::active_defrag_ignore_bytes
Data type: Integer[1, 100]
Minimum percentage of fragmentation to start active defrag Only set if activedefrag is true
Default value: $redis::active_defrag_threshold_lower
Data type: Integer[1, 100]
Maximum percentage of fragmentation at which we use maximum effort Only set if activedefrag is true
Default value: $redis::active_defrag_threshold_upper
Data type: Integer[1, 100]
Minimal effort for defrag in CPU percentage, to be used when the lower threshold is reached Only set if activedefrag is true
Default value: $redis::active_defrag_cycle_min
Data type: Integer[1, 100]
Maximal effort for defrag in CPU percentage, to be used when the upper threshold is reached Only set if activedefrag is true
Default value: $redis::active_defrag_cycle_max
Data type: Integer[1]
Maximum number of set/hash/zset/list fields that will be processed from the main dictionary scan Only set if activedefrag is true
Default value: $redis::active_defrag_max_scan_fields
Data type: Optional[Boolean]
Jemalloc background thread for purging will be enabled by default
Default value: $redis::jemalloc_bg_thread
Data type: Optional[Boolean]
When redis saves RDB file, if the following option is enabled the file will be fsync-ed every 32 MB of data generated.
Default value: $redis::rdb_save_incremental_fsync
Data type: String[1]
Value of client-output-buffer-limit-slave in redis config
Default value: $redis::output_buffer_limit_slave
Data type: String[1]
Value of client-output-buffer-limit-pubsub in redis config
Default value: $redis::output_buffer_limit_pubsub
Type: Ruby 4.x API
Returns the value of the key being looked up or undef
if the key does not exist.
$version = redis::get('version.myapp', 'redis://redis.example.com:6379')
$version_with_default = redis::get('version.myapp', 'redis://redis.example.com:6379', $::myapp_version)
The redis::get function.
Returns: Optional[String]
Returns the value of the key from Redis
$version = redis::get('version.myapp', 'redis://redis.example.com:6379')
$version_with_default = redis::get('version.myapp', 'redis://redis.example.com:6379', $::myapp_version)
Data type: String[1]
The key to look up in redis
Data type: Redis::RedisUrl
The endpoint of the Redis instance
Data type: Optional[String]
The value to return if the key is not found or the connection to Redis fails
This can be one of:
- debug (a lot of information, useful for development/testing)
- verbose (many rarely useful info, but not a mess like the debug level)
- notice (moderately verbose, what you want in production probably)
- warning (only very important / critical messages are logged)
Alias of Enum['debug', 'verbose', 'notice', 'warning']
This can be one of:
- volatile-lru (Evict using approximated LRU, only keys with an expire set)
- allkeys-lru (Evict any key using approximated LRU)
- volatile-lfu (Evict using approximated LFU, only keys with an expire set)
- allkeys-lfu (Evict any key using approximated LFU)
- volatile-random (Remove a random key having an expire set)
- allkeys-random (Remove a random key, any key)
- volatile-ttl (Remove the key with the nearest expire time (minor TTL)
- noeviction (Don't evict anything, just return an error on write operations)
Alias of Enum['volatile-lru', 'allkeys-lru', 'volatile-lfu', 'allkeys-lfu', 'volatile-random', 'allkeys-random', 'volatile-ttl', 'noeviction']
validate URL matches redis protocol
Alias of Pattern[/(^redis:\/\/)/]
Executes a redis-cli command on the target system
Supports noop? false
Data type: String[1]
The command to run, including all arguments