diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 0dc35c9802539c4a6e099a3c04736ee7c4aa0e2e..f0520f551d2545a4e2257ff014e82b962bd4473f 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -35,3 +35,14 @@ - enable_glance | bool - inventory_hostname in groups['haproxy'] - "{{ 'glance_registry' not in haproxy_stat }}" + +- name: Checking free port for watcher API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ watcher_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_watcher | bool + - "{{ 'watcher_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 1c2ee0fd9984339a4e2293904bf982cdcdf3ca3b..be8131078ec2cc1418ba38bf43567b299419189c 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -890,26 +890,6 @@ - enable_mistral | bool - inventory_hostname in groups['haproxy'] -- name: Checking free port for Watcher API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ watcher_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_watcher | bool - - inventory_hostname in groups['watcher-api'] - -- name: Checking free port for Watcher API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ watcher_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_watcher | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Searchlight API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" diff --git a/ansible/roles/watcher/tasks/precheck.yml b/ansible/roles/watcher/tasks/precheck.yml index ed97d539c095cf1413af30cc23dea272095b97dd..d346f9ca87a6dadd76203e35daf70556590de48c 100644 --- a/ansible/roles/watcher/tasks/precheck.yml +++ b/ansible/roles/watcher/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - watcher_api + register: container_facts + +- name: Checking free port for watcher API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ watcher_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['watcher_api'] is not defined + - inventory_hostname in groups['watcher-api']