fix(redis): ensure idempotency is guaranteed

This commit is contained in:
transcaffeine 2021-03-23 06:55:31 +01:00
parent 3a218f4ac3
commit 1aa29f98d1
No known key found for this signature in database
GPG key ID: 03624C433676E465
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,7 @@
---
- name: restart-redis
docker_container:
name: "{{ redis_docker_container_name }}"
state: started
restart: yes

View file

@ -34,13 +34,13 @@
dest: "{{ redis_config_file }}"
owner: "{{ redis_user }}"
group: "{{ redis_user }}"
notify: restart-redis
- name: Setup redis docker container
docker_container:
image: "{{ redis_docker_image }}"
name: "{{ redis_docker_container_name }}"
restart_policy: unless-stopped
recreate: true
pull: true
user: "{{ redis_user_res.uid }}:{{ redis_user_res.group }}"
ports: "{{ redis_docker_ports }}"
@ -51,3 +51,6 @@
healthcheck:
test: >-
redis-cli -a {{ redis_secret }} PING || exit 1
- name: Ensure redis is restarted if config changed
meta: flush_handlers