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 }}