diff --git a/ansible/roles/etcd/tasks/precheck.yml b/ansible/roles/etcd/tasks/precheck.yml index ed97d539c0..e8179afaf0 100644 --- a/ansible/roles/etcd/tasks/precheck.yml +++ b/ansible/roles/etcd/tasks/precheck.yml @@ -1 +1,26 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - etcd + register: container_facts + +- name: Checking free port for Etcd Peer + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ etcd_peer_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['etcd'] is not defined + - inventory_hostname in groups['etcd'] + +- name: Checking free port for Etcd Client + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ etcd_client_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['etcd'] is not defined + - inventory_hostname in groups['etcd'] diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index f7b8649011..274241c817 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 Etcd Peer - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ etcd_peer_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_etcd | bool - - inventory_hostname in groups['etcd'] - -- name: Checking free port for Etcd Client - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ etcd_client_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_etcd | bool - - inventory_hostname in groups['etcd'] - - name: Checking free port for Kuryr wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"