14ab9a7c4e
This patch implements the support for the elasticsearch-exporter in kolla-ansible The configuration and prechecks are reused from the other exporters Depends-On: Id138f12e10102a6dd2cd8d84f2cc47aa29af3972 Change-Id: Iae0eac0179089f159804490bf71f1cf2c38dde54
192 lines
7.9 KiB
YAML
192 lines
7.9 KiB
YAML
---
|
|
- name: Restart prometheus-server container
|
|
vars:
|
|
service_name: "prometheus-server"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_confs.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-node-exporter container
|
|
vars:
|
|
service_name: "prometheus-node-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
pid_mode: "{{ service.pid_mode | default(emit) }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-mysqld-exporter container
|
|
vars:
|
|
service_name: "prometheus-mysqld-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_conf_mycnf.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-haproxy-exporter container
|
|
vars:
|
|
service_name: "prometheus-haproxy-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-memcached-exporter container
|
|
vars:
|
|
service_name: "prometheus-memcached-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-cadvisor container
|
|
vars:
|
|
service_name: "prometheus-cadvisor"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-alertmanager container
|
|
vars:
|
|
service_name: "prometheus-alertmanager"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_alertmanager_confs.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-openstack-exporter container
|
|
vars:
|
|
service_name: "prometheus-openstack-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_openstack_exporter_confs.changed | bool
|
|
or prometheus_container.changed | bool
|
|
|
|
- name: Restart prometheus-elasticsearch-exporter container
|
|
vars:
|
|
service_name: "prometheus-elasticsearch-exporter"
|
|
service: "{{ prometheus_services[service_name] }}"
|
|
config_json: "{{ prometheus_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
prometheus_container: "{{ check_prometheus_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "recreate_or_restart_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ service.container_name }}"
|
|
image: "{{ service.image }}"
|
|
volumes: "{{ service.volumes }}"
|
|
dimensions: "{{ service.dimensions }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
- config_json.changed | bool
|
|
or prometheus_container.changed | bool
|