---
# Label nodes and wait for apiserver and controller to be running (at least one)
- name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
  oc_label:
    name: "{{ openshift.node.nodename }}"
    kind: node
    state: add
    labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | lib_utils_oo_dict_to_list_of_dict }}"

# wait to see that the apiserver is available
- name: wait for api server to be ready
  command: >
    curl -k https://apiserver.kube-service-catalog.svc/healthz
  args:
    # Disables the following warning:
    # Consider using get_url or uri module rather than running curl
    warn: no
  register: api_health
  until: api_health.stdout == 'ok'
  retries: 60
  delay: 5
  changed_when: false

---
# Label nodes and wait for apiserver and controller to be running (at least one)
- name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
  oc_label:
    name: "{{ openshift.node.nodename }}"
    kind: node
    state: add
    labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | lib_utils_oo_dict_to_list_of_dict }}"

# wait to see that the apiserver is available
- name: wait for api server to be ready
  command: >
    curl --noproxy '*' -k https://apiserver.kube-service-catalog.svc/healthz
  args:
    # Disables the following warning:
    # Consider using get_url or uri module rather than running curl
    warn: no
  register: api_health
  until: api_health.stdout == 'ok'
  retries: 60
  delay: 5
  changed_when: false

Use curl --noproxy option for internal apiserver access
Use curl --noproxy option for internal apiserver access
