From 302ce5583fce6c70e45dd0dc31e82ea7d1787b5b Mon Sep 17 00:00:00 2001 From: Keith Noguchi Date: Wed, 1 Jul 2020 02:30:09 -0700 Subject: [PATCH] redis_sentinel.conf.j2: Support sentinel rename-command option --- README.md | 2 +- defaults/main.yml | 1 + templates/redis_sentinel.conf.j2 | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c7649d68..2f45592f 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ redis_sentinel_monitors: failover_timeout: 180000 notification_script: false client_reconfig_script: false - + rename_commands: [] ``` ## Facts diff --git a/defaults/main.yml b/defaults/main.yml index 03b353f4..6efc37ec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -138,3 +138,4 @@ redis_sentinel_monitors: failover_timeout: 180000 notification_script: false client_reconfig_script: false + rename_commands: [] diff --git a/templates/redis_sentinel.conf.j2 b/templates/redis_sentinel.conf.j2 index c5f5d889..2fc59390 100644 --- a/templates/redis_sentinel.conf.j2 +++ b/templates/redis_sentinel.conf.j2 @@ -20,7 +20,11 @@ sentinel monitor {{ master.name }} {{ master.host }} {{ master.port }} {{ master sentinel {{ option|replace('_', '-') }} {{ master.name }} {{ master[option] }} {% endif %} {% endfor -%} - +{% if master['rename_commands'] is defined -%} +{% for command in master['rename_commands'] -%} +sentinel rename-command {{ master.name }} {{ command }} +{% endfor -%} +{% endif -%} {% endfor -%} logfile {{ redis_sentinel_logfile }}