mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
* Update and rename 389-fix-apis-being-overwritten-in-k8s_cluster_info.yaml to 41-fix-apis-being-overwritten-in-k8s_cluster_info.yaml * Update changelogs/fragments/41-fix-apis-being-overwritten-in-k8s_cluster_info.yaml Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
25 lines
647 B
YAML
25 lines
647 B
YAML
---
|
|
- name: Get Information about All APIs
|
|
k8s_cluster_info:
|
|
register: api_details
|
|
|
|
- name: Print all APIs for debugging
|
|
debug:
|
|
msg: "{{ api_details.apis }}"
|
|
|
|
- name: Get core API version
|
|
set_fact:
|
|
crd: "{{ api_details.apis['apiextensions.k8s.io/v1'] }}"
|
|
host: "{{ api_details.connection['host'] }}"
|
|
client_version: "{{ api_details.version['client'] }}"
|
|
|
|
- name: Check if all APIs are present
|
|
assert:
|
|
that:
|
|
- api_details.apis is defined
|
|
- api_details.apis.v1.Secret is defined
|
|
- api_details.apis.v1.Service is defined
|
|
- crd is defined
|
|
- host is defined
|
|
- client_version is defined
|