k8s_cluster_info: new module (#160)

Get information about k8s APIs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2020-09-28 14:01:37 +05:30
committed by GitHub
parent 00fa8789a2
commit 5de49373b7
4 changed files with 271 additions and 2 deletions

View File

@@ -27,8 +27,7 @@
- include_tasks: tasks/full.yml
- include_tasks: tasks/exec.yml
- include_tasks: tasks/log.yml
- include_tasks: tasks/info.yml
- include_tasks: tasks/template.yml
- include_tasks: tasks/cluster_info.yml
roles:
- helm

View File

@@ -0,0 +1,22 @@
---
- 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'] }}"
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
- crd is defined
- host is defined
- client_version is defined