feat: create redisha module

- manage redis/sentinel clusters
- ensure ulimit_managed is false
- dynamically find servers in role to identify master
- add redisadm and sentineladm commands
- add script to check if the current host in the master
This commit is contained in:
2024-08-09 23:22:37 +10:00
parent aadd0275ac
commit b7fc6a1993
8 changed files with 202 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
class redisha::tools (
Stdlib::Host $redis_host = $redisha::params::redis_host,
Stdlib::Port $redis_port = $redisha::params::redis_port,
Stdlib::Port $sentinel_port = $redisha::params::sentinel_port,
Optional[String] $requirepass = $redisha::params::requirepass,
) inherits redisha::params {
# add command to automate redis-cli commands against redis
file {'/usr/local/sbin/redisadm':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0700',
content => template('redisha/redisadm.erb'),
}
# add command to automate redis-cli commands against sentinel
file {'/usr/local/sbin/sentineladm':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0700',
content => template('redisha/sentineladm.erb'),
}
# add command to check if current host is the redis master
file {'/usr/local/bin/check_redis_master':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0755',
content => template('redisha/check_redis_master.erb'),
}
}