puppet-prod/modules/redisha/templates/sentineladm.erb
Ben Vincent b7fc6a1993 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
2024-08-10 17:39:24 +10:00

10 lines
288 B
Plaintext

#!/usr/bin/bash
REDIS_HOST=<%= @redis_host %>
SENTINEL_PORT=<%= @sentinel_port %>
if [ $# -gt 0 ]; then
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$SENTINEL_PORT" "$@"
else
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$SENTINEL_PORT"
fi