diff --git a/ansible/roles/gnocchi/tasks/precheck.yml b/ansible/roles/gnocchi/tasks/precheck.yml index ed97d539c0..2a3f65770b 100644 --- a/ansible/roles/gnocchi/tasks/precheck.yml +++ b/ansible/roles/gnocchi/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - gnocchi_api + register: container_facts + +- name: Checking free port for Gnocchi API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ gnocchi_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['gnocchi_api'] is not defined + - inventory_hostname in groups['gnocchi-api'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 22dafd1a9e..7df879df81 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -58,6 +58,17 @@ - inventory_hostname in groups['haproxy'] - "{{ 'glance_registry' not in haproxy_stat }}" +- name: Checking free port for Gnocchi API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ gnocchi_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_gnocchi | bool + - "{{ 'gnocchi_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Heat API HAProxy wait_for: host: "{{ kolla_internal_vip_address }}" diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 65d6146874..7a8c51cbb6 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -133,26 +133,6 @@ - enable_etcd | bool - inventory_hostname in groups['etcd'] -- name: Checking free port for Gnocchi API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ gnocchi_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_gnocchi | bool - - inventory_hostname in groups['gnocchi-api'] - -- name: Checking free port for Gnocchi API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ gnocchi_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_gnocchi | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Kuryr wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"