2016-02-10 10:51:39 +00:00
|
|
|
---
|
2021-03-24 00:26:05 +00:00
|
|
|
- hosts: kube_control_plane
|
2016-02-10 10:51:39 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Check the API servers are responding
|
2016-07-03 14:18:04 +00:00
|
|
|
uri:
|
2020-04-21 19:31:53 +00:00
|
|
|
url: "https://{{ access_ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port | default(6443) }}/version"
|
2016-02-10 10:51:39 +00:00
|
|
|
validate_certs: no
|
2020-04-21 19:31:53 +00:00
|
|
|
status_code: 200
|
|
|
|
register: apiserver_response
|
|
|
|
|
2021-07-12 07:00:47 +00:00
|
|
|
- debug: # noqa unnamed-task
|
2020-04-21 19:31:53 +00:00
|
|
|
msg: "{{ apiserver_response.json }}"
|
|
|
|
|
|
|
|
- name: Check API servers version
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- apiserver_response.json.gitVersion == kube_version
|
|
|
|
fail_msg: "apiserver version different than expected {{ kube_version }}"
|
2020-06-29 19:39:59 +00:00
|
|
|
when: kube_version is defined
|