diff --git a/ansible/roles/ceilometer/tasks/precheck.yml b/ansible/roles/ceilometer/tasks/precheck.yml index ed97d539c0..224cc2a50b 100644 --- a/ansible/roles/ceilometer/tasks/precheck.yml +++ b/ansible/roles/ceilometer/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - ceilometer_api + register: container_facts + +- name: Checking free port for Ceilometer API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ ceilometer_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['ceilometer_api'] is not defined + - inventory_hostname in groups['ceilometer-api'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 4a0bae697c..96225b4bb6 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -25,6 +25,17 @@ - "{{ 'barbican_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] +- name: Checking free port for Ceilometer API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ ceilometer_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_ceilometer | bool + - "{{ 'ceilometer_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Cinder 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 6ed52d17db..a8b71f74d7 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -53,26 +53,6 @@ - enable_aodh | bool - inventory_hostname in groups['haproxy'] -- name: Checking free port for Ceilometer API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ ceilometer_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_ceilometer | bool - - inventory_hostname in groups['ceilometer-api'] - -- name: Checking free port for Ceilometer API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ ceilometer_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_ceilometer | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Congress API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"