---
- name: Restart mistral-api container
  vars:
    service_name: "mistral-api"
    service: "{{ mistral_services[service_name] }}"
  become: true
  kolla_docker:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes | reject('equalto', '') | list }}"
    dimensions: "{{ service.dimensions }}"
    healthcheck: "{{ service.healthcheck | default(omit) }}"
  when:
    - kolla_action != "config"

- name: Restart mistral-engine container
  vars:
    service_name: "mistral-engine"
    service: "{{ mistral_services[service_name] }}"
  become: true
  kolla_docker:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes | reject('equalto', '') | list }}"
    dimensions: "{{ service.dimensions }}"
    healthcheck: "{{ service.healthcheck | default(omit) }}"
  when:
    - kolla_action != "config"

- name: Restart mistral-event-engine container
  vars:
    service_name: "mistral-event-engine"
    service: "{{ mistral_services[service_name] }}"
  become: true
  kolla_docker:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes | reject('equalto', '') | list }}"
    healthcheck: "{{ service.healthcheck | default(omit) }}"
    dimensions: "{{ service.dimensions }}"
  when:
    - kolla_action != "config"

- name: Restart mistral-executor container
  vars:
    service_name: "mistral-executor"
    service: "{{ mistral_services[service_name] }}"
  become: true
  kolla_docker:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes | reject('equalto', '') | list }}"
    dimensions: "{{ service.dimensions }}"
    healthcheck: "{{ service.healthcheck | default(omit) }}"
  when:
    - kolla_action != "config"
