---
monasca_services:
  monasca-api:
    container_name: monasca_api
    group: monasca-api
    enabled: false
    image: "{{ monasca_api_image_full }}"
    volumes: "{{ monasca_api_default_volumes + monasca_api_extra_volumes }}"
    dimensions: "{{ monasca_api_dimensions }}"
    haproxy:
      monasca_api:
        enabled: false
        mode: "http"
        external: false
        port: "{{ monasca_api_port }}"
      monasca_api_external:
        enabled: false
        mode: "http"
        external: true
        port: "{{ monasca_api_port }}"
  monasca-log-persister:
    container_name: monasca_log_persister
    group: monasca-log-persister
    enabled: false
    image: "{{ monasca_logstash_image_full }}"
    volumes: "{{ monasca_log_persister_default_volumes + monasca_log_persister_extra_volumes }}"
    dimensions: "{{ monasca_log_persister_dimensions }}"
  # TODO(dszumski): We can remove log-metrics and all other references to it after
  # the Xena release. This is used for cleaning up the service.
  monasca-log-metrics:
    container_name: monasca_log_metrics
    group: monasca-log-metrics
    enabled: false
    image: "{{ monasca_logstash_image_full }}"
    volumes: "{{ monasca_log_metrics_default_volumes + monasca_log_metrics_extra_volumes }}"
    dimensions: "{{ monasca_log_metrics_dimensions }}"
  monasca-thresh:
    container_name: monasca_thresh
    group: monasca-thresh
    enabled: false
    image: "{{ monasca_thresh_image_full }}"
    volumes: "{{ monasca_thresh_default_volumes + monasca_thresh_extra_volumes }}"
    dimensions: "{{ monasca_thresh_dimensions }}"
    state: "exited"
  monasca-notification:
    container_name: monasca_notification
    group: monasca-notification
    enabled: false
    image: "{{ monasca_notification_image_full }}"
    volumes: "{{ monasca_notification_default_volumes + monasca_notification_extra_volumes }}"
    dimensions: "{{ monasca_notification_dimensions }}"
  monasca-persister:
    container_name: monasca_persister
    group: monasca-persister
    enabled: false
    image: "{{ monasca_persister_image_full }}"
    volumes: "{{ monasca_persister_default_volumes + monasca_persister_extra_volumes }}"
    dimensions: "{{ monasca_persister_dimensions }}"
  monasca-agent-collector:
    container_name: monasca_agent_collector
    group: monasca-agent-collector
    enabled: false
    image: "{{ monasca_agent_image_full }}"
    pid_mode: "host"
    volumes: "{{ monasca_agent_collector_default_volumes + monasca_agent_collector_extra_volumes }}"
    dimensions: "{{ monasca_agent_dimensions }}"
  monasca-agent-statsd:
    container_name: monasca_agent_statsd
    group: monasca-agent-statsd
    enabled: false
    image: "{{ monasca_agent_image_full }}"
    volumes: "{{ monasca_agent_statsd_default_volumes + monasca_agent_statsd_extra_volumes }}"
    dimensions: "{{ monasca_agent_dimensions }}"
  monasca-agent-forwarder:
    container_name: monasca_agent_forwarder
    group: monasca-agent-forwarder
    enabled: false
    image: "{{ monasca_agent_image_full }}"
    volumes: "{{ monasca_agent_forwarder_default_volumes + monasca_agent_forwarder_extra_volumes }}"
    dimensions: "{{ monasca_agent_dimensions }}"

####################
# Docker
####################

# NOTE(dszumski): Binary support for Monasca images is not yet available in Kolla
monasca_tag: "{{ openstack_tag }}"

monasca_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/monasca-agent"
monasca_agent_tag: "{{ monasca_tag }}"
monasca_agent_image_full: "{{ monasca_agent_image }}:{{ monasca_agent_tag }}"

monasca_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/monasca-api"
monasca_api_tag: "{{ monasca_tag }}"
monasca_api_image_full: "{{ monasca_api_image }}:{{ monasca_api_tag }}"

monasca_logstash_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/logstash"
monasca_logstash_tag: "{{ monasca_tag }}"
monasca_logstash_image_full: "{{ monasca_logstash_image }}:{{ monasca_logstash_tag }}"

monasca_thresh_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/monasca-thresh"
monasca_thresh_tag: "{{ monasca_tag }}"
monasca_thresh_image_full: "{{ monasca_thresh_image }}:{{ monasca_thresh_tag }}"

monasca_notification_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/monasca-notification"
monasca_notification_tag: "{{ monasca_tag }}"
monasca_notification_image_full: "{{ monasca_notification_image }}:{{ monasca_notification_tag }}"

monasca_persister_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/monasca-persister"
monasca_persister_tag: "{{ monasca_tag }}"
monasca_persister_image_full: "{{ monasca_persister_image }}:{{ monasca_persister_tag }}"

monasca_agent_dimensions: "{{ default_container_dimensions }}"
monasca_api_dimensions: "{{ default_container_dimensions }}"
monasca_log_api_dimensions: "{{ default_container_dimensions }}"
monasca_log_persister_dimensions: "{{ default_container_dimensions }}"
monasca_log_metrics_dimensions: "{{ default_container_dimensions }}"
monasca_thresh_dimensions: "{{ default_container_dimensions }}"
monasca_notification_dimensions: "{{ default_container_dimensions }}"
monasca_persister_dimensions: "{{ default_container_dimensions }}"

monasca_agent_collector_default_volumes:
  - "{{ node_config_directory }}/monasca-agent-collector/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
  - "/sys:/sys:ro"
  - "/dev/disk/:/dev/disk:ro"
monasca_agent_statsd_default_volumes:
  - "{{ node_config_directory }}/monasca-agent-statsd/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
monasca_agent_forwarder_default_volumes:
  - "{{ node_config_directory }}/monasca-agent-forwarder/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
monasca_api_default_volumes:
  - "{{ node_config_directory }}/monasca-api/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
monasca_log_persister_default_volumes:
  - "{{ node_config_directory }}/monasca-log-persister/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
  - "monasca_log_persister_data:/var/lib/logstash"
monasca_log_metrics_default_volumes:
  - "{{ node_config_directory }}/monasca-log-metrics/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
  - "monasca_log_metrics_data:/var/lib/logstash"
monasca_thresh_default_volumes:
  - "{{ node_config_directory }}/monasca-thresh/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "monasca_thresh:/var/lib/monasca-thresh/"
  - "kolla_logs:/var/log/kolla"
monasca_notification_default_volumes:
  - "{{ node_config_directory }}/monasca-notification/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"
monasca_persister_default_volumes:
  - "{{ node_config_directory }}/monasca-persister/:{{ container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
  - "kolla_logs:/var/log/kolla"

monasca_extra_volumes: "{{ default_extra_volumes }}"
monasca_agent_collector_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_agent_statsd_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_agent_forwarder_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_api_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_log_persister_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_log_metrics_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_thresh_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_notification_extra_volumes: "{{ monasca_extra_volumes }}"
monasca_persister_extra_volumes: "{{ monasca_extra_volumes }}"
