Skip to content

Commit be6699e

Browse files
committed
docs: add until example to k8s_info
I would liked to have an example like this when I was using the documentation.
1 parent 05e5e0a commit be6699e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/kubernetes.core.k8s_info_module.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,20 @@ Examples
701701
wait_sleep: 10
702702
wait_timeout: 360
703703
704+
- name: Wait for OpenShift bootstrap to complete
705+
kubernetes.core.k8s_info:
706+
kind: ConfigMap
707+
name: bootstrap
708+
namespace: kube-system
709+
register: ocp_bootstrap_status
710+
until: >
711+
ocp_bootstrap_status.resources is defined and
712+
(ocp_bootstrap_status.resources | length > 0) and
713+
(ocp_bootstrap_status.resources[0].data.status is defined) and
714+
(ocp_bootstrap_status.resources[0].data.status == 'complete')
715+
retries: 60
716+
delay: 15
717+
704718
705719
706720
Return Values

plugins/modules/k8s_info.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@
120120
namespace: default
121121
wait_sleep: 10
122122
wait_timeout: 360
123+
124+
- name: Wait for OpenShift bootstrap to complete
125+
kubernetes.core.k8s_info:
126+
kind: ConfigMap
127+
name: bootstrap
128+
namespace: kube-system
129+
register: ocp_bootstrap_status
130+
until: >
131+
ocp_bootstrap_status.resources is defined and
132+
(ocp_bootstrap_status.resources | length > 0) and
133+
(ocp_bootstrap_status.resources[0].data.status is defined) and
134+
(ocp_bootstrap_status.resources[0].data.status == 'complete')
135+
retries: 60
136+
delay: 15
123137
"""
124138

125139
RETURN = r"""

0 commit comments

Comments
 (0)