Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 3714171

Browse files
Merge pull request #129 from Normo/128-fix-sentinel-restart
fix Redis Sentinel restart
2 parents 8dbe9bd + f907297 commit 3714171

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tasks/main.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,29 @@
153153
- "{{ redis_sentinel_configuration_file }}"
154154
- "{{ redis_server_configuration_file }}"
155155

156-
- name: Configure Redis and Sentinel.
156+
- name: Configure Redis Server.
157157
become: yes
158158
ansible.builtin.blockinfile:
159-
block: "{{ lookup('ansible.builtin.template', item.template_file) }}"
160-
path: "{{ item.path }}"
159+
block: "{{ lookup('ansible.builtin.template', 'redis.conf.j2') }}"
160+
path: "{{ redis_server_configuration_file }}"
161161
insertbefore: "# Generated by CONFIG REWRITE"
162162
create: true
163163
mode: 0600
164164
owner: "{{ redis_user }}"
165165
group: "{{ redis_group }}"
166166
notify: Restart Redis Server
167-
loop:
168-
- { template_file: "redis.conf.j2", path: "{{ redis_server_configuration_file }}" }
169-
- { template_file: "sentinel.conf.j2", path: "{{ redis_sentinel_configuration_file }}" }
167+
168+
- name: Configure Redis Sentinel.
169+
become: yes
170+
ansible.builtin.blockinfile:
171+
block: "{{ lookup('ansible.builtin.template', 'sentinel.conf.j2') }}"
172+
path: "{{ redis_sentinel_configuration_file }}"
173+
insertbefore: "# Generated by CONFIG REWRITE"
174+
create: true
175+
mode: 0600
176+
owner: "{{ redis_user }}"
177+
group: "{{ redis_group }}"
178+
notify: Restart Redis Sentinel
170179

171180
- name: Create Redis Lib Directory.
172181
become: yes

0 commit comments

Comments
 (0)