---
- name: Get container facts
  kolla_container_facts:
    name:
      - karbor_api
  register: container_facts

- name: Checking free port for Karbor Admin
  wait_for:
    host: "{{ api_interface_address }}"
    port: "{{ karbor_api_port }}"
    connect_timeout: 1
    timeout: 1
    state: stopped
  when:
    - inventory_hostname in groups['karbor-api']
    - container_facts['karbor-api'] is not defined
