You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
685 B

  1. ---
  2. - hosts: kube_control_plane
  3. tasks:
  4. - name: Check the API servers are responding
  5. uri:
  6. url: "https://{{ access_ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port | default(6443) }}/version"
  7. validate_certs: no
  8. status_code: 200
  9. register: apiserver_response
  10. retries: 12
  11. delay: 5
  12. until: apiserver_response is success
  13. - debug: # noqa unnamed-task
  14. msg: "{{ apiserver_response.json }}"
  15. - name: Check API servers version
  16. assert:
  17. that:
  18. - apiserver_response.json.gitVersion == kube_version
  19. fail_msg: "apiserver version different than expected {{ kube_version }}"
  20. when: kube_version is defined