From 24f7c925413df0cb8ff05a2613732c8ffcd75e60 Mon Sep 17 00:00:00 2001 From: Yannik Sembritzki Date: Wed, 25 May 2022 18:10:35 +0200 Subject: [PATCH] Add option to configure redis node password for sentinel (auth-pass) --- tasks/{install.yml => install_from_source.yml} | 0 templates/redis_sentinel.conf.j2 | 4 ++++ 2 files changed, 4 insertions(+) rename tasks/{install.yml => install_from_source.yml} (100%) diff --git a/tasks/install.yml b/tasks/install_from_source.yml similarity index 100% rename from tasks/install.yml rename to tasks/install_from_source.yml diff --git a/templates/redis_sentinel.conf.j2 b/templates/redis_sentinel.conf.j2 index 2fc59390..717c6c11 100644 --- a/templates/redis_sentinel.conf.j2 +++ b/templates/redis_sentinel.conf.j2 @@ -15,6 +15,10 @@ requirepass {{ redis_sentinel_password }} {% for master in redis_sentinel_monitors -%} sentinel monitor {{ master.name }} {{ master.host }} {{ master.port }} {{ master.quorum|d('2') }} +{% if master.password is defined %} +sentinel auth-pass {{ master.name }} {{ master.password }} +{% endif %} + {% for option in ('auth_pass', 'down_after_milliseconds', 'parallel_syncs', 'failover_timeout', 'notification_script', 'client_reconfig_script') -%} {% if master[option] is defined and master[option] -%} sentinel {{ option|replace('_', '-') }} {{ master.name }} {{ master[option] }}