diff --git a/ansible/roles/cinder/tasks/precheck.yml b/ansible/roles/cinder/tasks/precheck.yml index ed97d539c0..6e44a2c799 100644 --- a/ansible/roles/cinder/tasks/precheck.yml +++ b/ansible/roles/cinder/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - cinder_api + register: container_facts + +- name: Checking free port for Cinder API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ cinder_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['cinder_api'] is not defined + - inventory_hostname in groups['cinder-api'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 6619b4f57b..4a0bae697c 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 Cinder API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ cinder_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_cinder | bool + - "{{ 'cinder_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Cloudkitty 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 5903bb204a..6ed52d17db 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -93,26 +93,6 @@ - enable_congress | bool - inventory_hostname in groups['haproxy'] -- name: Checking free port for Cinder API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ cinder_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_cinder | bool - - inventory_hostname in groups['cinder-api'] - -- name: Checking free port for Cinder API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ cinder_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_cinder | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Etcd Peer wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"