diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 9472c06ff1..24873493bc 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -157,6 +157,17 @@ - "{{ 'sahara_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] +- name: Checking free port for Senlin API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ senlin_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_senlin | bool + - "{{ 'senlin_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Tacker Server 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 3a7d784162..9779fa6441 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -640,26 +640,6 @@ - enable_grafana | bool - inventory_hostname in groups['haproxy'] -- name: Checking free port for Senlin API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ senlin_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_senlin | bool - - inventory_hostname in groups['senlin-api'] - -- name: Checking free port for Senlin API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ senlin_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_senlin | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Mistral API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" diff --git a/ansible/roles/senlin/tasks/precheck.yml b/ansible/roles/senlin/tasks/precheck.yml index ed97d539c0..b62943621b 100644 --- a/ansible/roles/senlin/tasks/precheck.yml +++ b/ansible/roles/senlin/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - senlin_api + register: container_facts + +- name: Checking free port for Senlin API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ senlin_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['senlin_api'] is not defined + - inventory_hostname in groups['senlin-api']