---
kafka_services:
  kafka:
    container_name: kafka
    group: kafka
    enabled: false
    image: "{{ kafka_image_full }}"
    environment:
      LOG_DIR: "{{ kafka_log_dir }}"
      KAFKA_HEAP_OPTS: "{{ kafka_heap_opts }}"
    volumes: "{{ kafka_default_volumes + kafka_extra_volumes }}"
    dimensions: "{{ kafka_dimensions }}"
    healthcheck: "{{ kafka_healthcheck }}"


####################
# Docker
####################
kafka_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/kafka"
kafka_tag: "{{ openstack_tag }}"
kafka_image_full: "{{ kafka_image }}:{{ kafka_tag }}"
kafka_dimensions: "{{ default_container_dimensions }}"

kafka_enable_healthchecks: "{{ enable_container_healthchecks }}"
kafka_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
kafka_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
kafka_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
kafka_healthcheck_test: ["CMD-SHELL", "healthcheck_listen java {{ kafka_port }}"]
kafka_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
kafka_healthcheck:
  interval: "{{ kafka_healthcheck_interval }}"
  retries: "{{ kafka_healthcheck_retries }}"
  start_period: "{{ kafka_healthcheck_start_period }}"
  test: "{% if kafka_enable_healthchecks | bool %}{{ kafka_healthcheck_test }}{% else %}NONE{% endif %}"
  timeout: "{{ kafka_healthcheck_timeout }}"

kafka_default_volumes:
  - "{{ node_config_directory }}/kafka/:{{ container_config_directory }}/"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "{{ kafka_datadir_volume }}:/var/lib/kafka/data"
  - "kolla_logs:/var/log/kolla/"
kafka_extra_volumes: "{{ default_extra_volumes }}"
