kolla-ansible/ansible/roles/grafana/handlers/main.yml
Ivan Halomi 4ca2d41762 Adding container_engine to kolla_toolbox module
Second part of patchset:
https://review.opendev.org/c/openstack/kolla-ansible/+/799229/
in which was suggested to split patch into smaller ones.

THis change adds container_engine to module parameters
so when we introduce podman, kolla_toolbox can be used
for both engines.

Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com>
Co-authored-by: Martin Hiner <m.hiner@partner.samsung.com>
Change-Id: Ic2093aa9341a0cb36df8f340cf290d62437504ad
2022-11-04 15:32:30 +01:00

55 lines
1.7 KiB
YAML

---
- name: Restart first grafana container
listen: Restart grafana container
vars:
service_name: "grafana"
service: "{{ grafana_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 }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname == groups[service.group] | first
- name: Waiting for grafana to start on first node
listen: Restart grafana container
vars:
service_name: "grafana"
service: "{{ grafana_services[service_name] }}"
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: uri
module_args:
url: "http://{{ api_interface_address | put_address_in_context('url') }}:{{ grafana_server_port }}/login"
status_code: 200
register: result
until: result.get('status') == 200
retries: "{{ grafana_start_first_node_retries }}"
delay: "{{ grafana_start_first_node_delay }}"
when:
- kolla_action != "config"
- inventory_hostname == groups[service.group] | first
- name: Restart remaining grafana containers
listen: Restart grafana container
vars:
service_name: "grafana"
service: "{{ grafana_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 }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname != groups[service.group] | first