From 4d7dc2a7d11eb81db787a30f1f715dba8179def4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Birger=20Johan=20Nord=C3=B8lum?= <33870508+MindTooth@users.noreply.github.com> Date: Tue, 5 May 2026 21:47:19 +0200 Subject: [PATCH] docs: add until example to k8s_info (#885) I would liked to have an example like this when I was using the documentation. --- docs/kubernetes.core.k8s_info_module.rst | 15 +++++++++++++++ plugins/modules/k8s_info.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/docs/kubernetes.core.k8s_info_module.rst b/docs/kubernetes.core.k8s_info_module.rst index cbd56feb..c9768004 100644 --- a/docs/kubernetes.core.k8s_info_module.rst +++ b/docs/kubernetes.core.k8s_info_module.rst @@ -701,6 +701,21 @@ Examples wait_sleep: 10 wait_timeout: 360 + - name: Wait for OpenShift bootstrap to complete + kubernetes.core.k8s_info: + api_version: v1 + kind: ConfigMap + name: bootstrap + namespace: kube-system + register: ocp_bootstrap_status + until: > + ocp_bootstrap_status.resources is defined and + (ocp_bootstrap_status.resources | length > 0) and + (ocp_bootstrap_status.resources[0].data.status is defined) and + (ocp_bootstrap_status.resources[0].data.status == 'complete') + retries: 60 + delay: 15 + Return Values diff --git a/plugins/modules/k8s_info.py b/plugins/modules/k8s_info.py index 306425ad..ffff1aaa 100644 --- a/plugins/modules/k8s_info.py +++ b/plugins/modules/k8s_info.py @@ -120,6 +120,21 @@ EXAMPLES = r""" namespace: default wait_sleep: 10 wait_timeout: 360 + +- name: Wait for OpenShift bootstrap to complete + kubernetes.core.k8s_info: + api_version: v1 + kind: ConfigMap + name: bootstrap + namespace: kube-system + register: ocp_bootstrap_status + until: > + ocp_bootstrap_status.resources is defined and + (ocp_bootstrap_status.resources | length > 0) and + (ocp_bootstrap_status.resources[0].data.status is defined) and + (ocp_bootstrap_status.resources[0].data.status == 'complete') + retries: 60 + delay: 15 """ RETURN = r"""