From 930db222fbceabdba15d909da967b5bd67c3f1ef Mon Sep 17 00:00:00 2001 From: M1ha-Shvn Date: Tue, 6 Feb 2024 18:38:06 +0500 Subject: [PATCH] Added redis_supervised option to config file --- README.md | 4 ++++ defaults/main.yml | 1 + templates/redis.conf.j2 | 1 + 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index e16891de..934b94d4 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,10 @@ redis_syslog_facility: USER ## General configuration redis_daemonize: "yes" + +# Defaults to upstart or systemd depending on +redis_supervised: "no" + redis_pidfile: /var/run/redis/{{ redis_port }}.pid # Number of databases to allow redis_databases: 16 diff --git a/defaults/main.yml b/defaults/main.yml index dfc8956d..6e726855 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -69,6 +69,7 @@ redis_syslog_facility: USER ## General configuration redis_daemonize: "yes" +redis_supervised: "{{ 'systemd' if redis_as_service and ansible_service_mgr|default() in ('systemd', 'upstart') else 'no' }}" redis_pidfile: /var/run/redis/{{ redis_port }}.pid # Number of databases to allow redis_databases: 16 diff --git a/templates/redis.conf.j2 b/templates/redis.conf.j2 index 04e24a4f..ce1428b6 100644 --- a/templates/redis.conf.j2 +++ b/templates/redis.conf.j2 @@ -2,6 +2,7 @@ # General daemonize {{ redis_daemonize }} +supervised {{ redis_`supervised` }} protected-mode {{ redis_protected_mode }} pidfile {{ redis_pidfile }} dir {{ redis_dir }}