diff --git a/ansible/roles/aodh/tasks/precheck.yml b/ansible/roles/aodh/tasks/precheck.yml index ed97d539c0..89413eac7f 100644 --- a/ansible/roles/aodh/tasks/precheck.yml +++ b/ansible/roles/aodh/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - aodh_api + register: container_facts + +- name: Checking free port for Aodh API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ aodh_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['aodh_api'] is not defined + - inventory_hostname in groups['aodh-api'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 066a776b5f..ffac091162 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -14,6 +14,17 @@ - set_fact: haproxy_stat: "{{ haproxy_stat_shell.stdout|default('') }}" +- name: Checking free port for Aodh API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ aodh_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_aodh | bool + - "{{ 'aodh_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Barbican 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 24f6331129..3dd53cd016 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -33,26 +33,6 @@ kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none" when: enable_haproxy | bool -- name: Checking free port for Aodh API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ aodh_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_aodh | bool - - inventory_hostname in groups['aodh-api'] - -- name: Checking free port for Aodh API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ aodh_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_aodh | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Congress API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"