kolla-ansible/ansible/roles/redis/defaults/main.yml
LinPeiWen 66888bb7e0 Use Docker healthchecks for redis services
This change enables the use of Docker healthchecks for redis services.
Implements: blueprint container-health-check

Change-Id: I0590c5b22ef8eb733211b029cdd73a055d58af11
2021-03-03 07:06:39 +00:00

76 lines
3.6 KiB
YAML

---
project_name: "redis"
redis_services:
redis:
container_name: redis
group: redis
enabled: true
image: "{{ redis_image_full }}"
volumes: "{{ redis_default_volumes + redis_extra_volumes }}"
dimensions: "{{ redis_dimensions }}"
healthcheck: "{{ redis_healthcheck }}"
redis-sentinel:
container_name: redis_sentinel
group: redis
enabled: true
image: "{{ redis_sentinel_image_full }}"
volumes: "{{ redis_sentinel_default_volumes + redis_sentinel_extra_volumes }}"
dimensions: "{{ redis_sentinel_dimensions }}"
healthcheck: "{{ redis_sentinel_healthcheck }}"
####################
# Docker
####################
redis_install_type: "{{ kolla_install_type }}"
redis_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ redis_install_type }}-redis"
redis_tag: "{{ openstack_tag }}"
redis_image_full: "{{ redis_image }}:{{ redis_tag }}"
redis_sentinel_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ redis_install_type }}-redis-sentinel"
redis_sentinel_tag: "{{ openstack_tag }}"
redis_sentinel_image_full: "{{ redis_sentinel_image }}:{{ redis_tag }}"
redis_dimensions: "{{ default_container_dimensions }}"
redis_sentinel_dimensions: "{{ default_container_dimensions }}"
redis_enable_healthchecks: "{{ enable_container_healthchecks }}"
redis_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
redis_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
redis_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
redis_healthcheck_test: ["CMD-SHELL", "healthcheck_listen redis-server {{ redis_port }}"]
redis_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
redis_healthcheck:
interval: "{{ redis_healthcheck_interval }}"
retries: "{{ redis_healthcheck_retries }}"
start_period: "{{ redis_healthcheck_start_period }}"
test: "{% if redis_enable_healthchecks | bool %}{{ redis_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ redis_healthcheck_timeout }}"
redis_sentinel_enable_healthchecks: "{{ enable_container_healthchecks }}"
redis_sentinel_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
redis_sentinel_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
redis_sentinel_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
redis_sentinel_healthcheck_test: ["CMD-SHELL", "healthcheck_listen redis-sentinel {{ redis_sentinel_port }}"]
redis_sentinel_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
redis_sentinel_healthcheck:
interval: "{{ redis_sentinel_healthcheck_interval }}"
retries: "{{ redis_sentinel_healthcheck_retries }}"
start_period: "{{ redis_sentinel_healthcheck_start_period }}"
test: "{% if redis_sentinel_enable_healthchecks | bool %}{{ redis_sentinel_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ redis_sentinel_healthcheck_timeout }}"
redis_default_volumes:
- "{{ node_config_directory }}/redis/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}"
- "{{ project_name }}:/var/lib/redis/"
- "kolla_logs:/var/log/kolla/"
redis_sentinel_default_volumes:
- "{{ node_config_directory }}/redis-sentinel/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}"
- "kolla_logs:/var/log/kolla/"
redis_extra_volumes: "{{ default_extra_volumes }}"
redis_sentinel_extra_volumes: "{{ default_extra_volumes }}"