From af5923ba5b93e6afea75ce30aeebe820ff056b6c Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Tue, 29 Jul 2025 17:01:06 -0400 Subject: [PATCH] Fixes based on Rocky Linux 8 installed from package This is based off some issues with the following RPM installed via Rocky 8 Linux. https://rockylinux.pkgs.org/8/rockylinux-appstream-x86_64/redis-5.0.3-5.module+el8.5.0+657+2674830e.x86_64.rpm.html Some variables were also set, similar to the following comment https://github.com/DavidWittman/ansible-redis/issues/286#issuecomment-1471158317 --- tasks/install_from_repo.yml | 16 +++++++++++++++- tasks/sentinel.yml | 3 +-- tasks/server.yml | 3 +-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tasks/install_from_repo.yml b/tasks/install_from_repo.yml index 37cb33d..61844f6 100644 --- a/tasks/install_from_repo.yml +++ b/tasks/install_from_repo.yml @@ -2,7 +2,21 @@ package: name: redis +- name: Check if redis-sentinel is included in redis package + command: which redis-sentinel + ignore_errors: true + register: sentinel_included + - name: Install redis-sentinel from repo package: name: redis-sentinel - when: redis_sentinel + when: + - redis_sentinel + - not sentinel_included + +- name: Ensure /etc/redis exists, in case package install doesn't create + file: + path: /etc/redis + state: directory + mode: 0755 + owner: "{{ redis_user }}" diff --git a/tasks/sentinel.yml b/tasks/sentinel.yml index 90e11b9..486a497 100644 --- a/tasks/sentinel.yml +++ b/tasks/sentinel.yml @@ -33,7 +33,7 @@ paths: - ../templates register: sentinel_unit_file - when: redis_as_service and ansible_service_mgr|default() == "systemd" and not (not redis_install_from_source and redis_service_name == 'redis') + when: redis_as_service and ansible_service_mgr|default() == "systemd" - name: create systemd tmpfiles configuration template: @@ -44,7 +44,6 @@ - redis_as_service - ansible_service_mgr|default() == "systemd" - (redis_sentinel_pidfile|dirname).startswith("/var/run") or (redis_sentinel_pidfile|dirname).startswith("/run") - - not (not redis_install_from_source and redis_service_name == 'redis') - name: reload systemd daemon systemd: diff --git a/tasks/server.yml b/tasks/server.yml index 1243c74..27e6cc9 100644 --- a/tasks/server.yml +++ b/tasks/server.yml @@ -33,7 +33,7 @@ paths: - ../templates register: redis_unit_file - when: redis_as_service and ansible_service_mgr|default() == "systemd" and not (not redis_install_from_source and redis_service_name == 'redis') + when: redis_as_service and ansible_service_mgr|default() == "systemd" - name: create systemd tmpfiles configuration template: @@ -44,7 +44,6 @@ - redis_as_service - ansible_service_mgr|default() == 'systemd' - (redis_pidfile|dirname).startswith('/var/run') or (redis_pidfile|dirname).startswith('/run') - - not (not redis_install_from_source and redis_service_name == 'redis') - name: reload systemd daemon systemd: