---
- name: Restart prometheus-server container
  vars:
    service_name: "prometheus-server"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-node-exporter container
  vars:
    service_name: "prometheus-node-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    pid_mode: "{{ service.pid_mode | default(omit) }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-mysqld-exporter container
  vars:
    service_name: "prometheus-mysqld-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-memcached-exporter container
  vars:
    service_name: "prometheus-memcached-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-cadvisor container
  vars:
    service_name: "prometheus-cadvisor"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-alertmanager container
  vars:
    service_name: "prometheus-alertmanager"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-openstack-exporter container
  vars:
    service_name: "prometheus-openstack-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"
    environment: "{{ service.environment | default(omit) }}"

- name: Restart prometheus-elasticsearch-exporter container
  vars:
    service_name: "prometheus-elasticsearch-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-blackbox-exporter container
  vars:
    service_name: "prometheus-blackbox-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"

- name: Restart prometheus-libvirt-exporter container
  vars:
    service_name: "prometheus-libvirt-exporter"
    service: "{{ prometheus_services[service_name] }}"
  become: true
  kolla_container:
    action: "recreate_or_restart_container"
    common_options: "{{ docker_common_options }}"
    name: "{{ service.container_name }}"
    image: "{{ service.image }}"
    volumes: "{{ service.volumes }}"
    dimensions: "{{ service.dimensions }}"
