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: