---
- name: Wait for API to become available
  # Using curl here since the uri module requires python-httplib2 and
  # wait_for port doesn't provide health information.
  command: >
    curl --silent --tlsv1.2
    --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
    {{ openshift.master.api_url }}/healthz/ready
  register: l_api_available_output
  until: l_api_available_output.stdout == 'ok'
  retries: 120
  delay: 1
  run_once: true
  changed_when: false
