Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tasks/install_from_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
3 changes: 1 addition & 2 deletions tasks/sentinel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this actually needs to be

Suggested change
when: redis_as_service and ansible_service_mgr|default() == "systemd"
when: redis_as_service and ansible_service_mgr|default() == "systemd" and redis_service_name == 'redis')

But I was just trying to get this working, and figure out why later.


- name: create systemd tmpfiles configuration
template:
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions tasks/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down