diff --git a/ansible/roles/grafana/tasks/precheck.yml b/ansible/roles/grafana/tasks/precheck.yml index ed97d539c0..cac2b0a04c 100644 --- a/ansible/roles/grafana/tasks/precheck.yml +++ b/ansible/roles/grafana/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - grafana + register: container_facts + +- name: Checking free port for Grafana server + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ grafana_server_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['grafana'] is not defined + - inventory_hostname in groups['grafana'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index c5fec9d107..bbe5c86e4d 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -124,6 +124,17 @@ - "{{ 'gnocchi_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] +- name: Checking free port for Grafana server HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ grafana_server_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_grafana | bool + - "{{ 'grafana_server' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Heat 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 f7b8649011..aed211487f 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -540,26 +540,6 @@ - enable_ceph_rgw | bool - inventory_hostname in groups['haproxy'] -- name: Checking free port for Grafana server - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ grafana_server_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_grafana | bool - - inventory_hostname in groups['grafana'] - -- name: Checking free port for Grafana server HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ grafana_server_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_grafana | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for Searchlight API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"