From b00f1a4c44c033e64ce4f1a7e574be83a304110d Mon Sep 17 00:00:00 2001 From: Crest Date: Mon, 4 Jul 2022 02:54:03 +0200 Subject: [PATCH] Use path variables for Redis. Changes #31 --- roles/redis/handlers/main.yml | 4 ++-- roles/redis/tasks/main.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/redis/handlers/main.yml b/roles/redis/handlers/main.yml index da1f10d..e327e54 100644 --- a/roles/redis/handlers/main.yml +++ b/roles/redis/handlers/main.yml @@ -5,7 +5,7 @@ state: reloaded - name: 'Restart redis-{{ redis_instance }}' - command: s6-svc -wR -T 15000 -ru /run/service/redis-{{ redis_instance }} + command: s6-svc -wR -T 15000 -ru {{ s6_scan_dir }}/redis-{{ redis_instance }} - name: 'Restart redis-{{ redis_instance }} log' - command: s6-svc -wR -T 5000 -ru /run/service/redis-{{ redis_instance }}-log + command: s6-svc -wR -T 5000 -ru {{ s6_scan_dir }}/redis-{{ redis_instance }}-log diff --git a/roles/redis/tasks/main.yml b/roles/redis/tasks/main.yml index aef58df..2d32a89 100644 --- a/roles/redis/tasks/main.yml +++ b/roles/redis/tasks/main.yml @@ -30,7 +30,7 @@ - name: 'Create redis-{{ redis_instance }} service directories' file: - path: '/etc/s6-rc/service/redis-{{ redis_instance}}{{ item }}' + path: '{{ s6_etc_dir }}/service/redis-{{ redis_instance}}{{ item }}' state: directory owner: root group: wheel @@ -43,7 +43,7 @@ - name: 'Generate redis-{{ redis_instance }} service scripts' template: - dest: '/etc/s6-rc/service/redis-{{ redis_instance }}{{ item }}' + dest: '{{ s6_etc_dir }}/service/redis-{{ redis_instance }}{{ item }}' src: 'redis{{ item }}.j2' mode: 0555 owner: root @@ -56,7 +56,7 @@ - name: 'Generate redis-{{ redis_instance }} service configuration' copy: - dest: '/etc/s6-rc/service/redis-{{ redis_instance}}{{ item.name }}' + dest: '{{ s6_etc_dir }}/service/redis-{{ redis_instance}}{{ item.name }}' content: '{{ item.content }}' mode: 0444 owner: root @@ -83,13 +83,13 @@ meta: flush_handlers - name: 'Start redis-{{ redis_instance }}' - command: 'fdmove -c 2 1 s6-rc -u -v 2 -t 15000 change redis-{{ redis_instance }}' + command: 'fdmove -c 2 1 s6-rc -l {{ s6_live_dir }} -u -v 2 -t 15000 change redis-{{ redis_instance }}' register: change changed_when: change.stdout | length > 0 - name: 'Enable redis-{{ redis_instance }}' lineinfile: - path: /etc/s6-rc/service/enabled/contents + path: '{{ s6_etc_dir }}/service/enabled/contents' regexp: "^redis-{{ redis_instance }}$" line: 'redis-{{ redis_instance }}' state: present