mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
fix(redis): ensure idempotency is guaranteed
This commit is contained in:
parent
3a218f4ac3
commit
1aa29f98d1
2 changed files with 11 additions and 1 deletions
7
roles/redis/handlers/main.yml
Normal file
7
roles/redis/handlers/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
|
||||
- name: restart-redis
|
||||
docker_container:
|
||||
name: "{{ redis_docker_container_name }}"
|
||||
state: started
|
||||
restart: yes
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue