From 2fb6546b03709962e06be35d721edfceb73bc80a Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 10:16:32 -0400 Subject: [PATCH] docs: add until example to k8s_info (#885) (#1119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I would liked to have an example like this when I was using the documentation. (cherry picked from commit 4d7dc2a7d11eb81db787a30f1f715dba8179def4) Co-authored-by: Birger Johan Nordølum <33870508+MindTooth@users.noreply.github.com> --- 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"""