mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 21:42:38 +00:00
@@ -46,6 +46,7 @@ options:
|
||||
extends_documentation_fragment:
|
||||
- community.kubernetes.k8s_auth_options
|
||||
- community.kubernetes.k8s_name_options
|
||||
- community.kubernetes.k8s_wait_options
|
||||
|
||||
requirements:
|
||||
- "python >= 2.7"
|
||||
@@ -99,6 +100,15 @@ EXAMPLES = r'''
|
||||
community.kubernetes.k8s_info:
|
||||
kind: MyCustomObject
|
||||
api_version: "stable.example.com/v1"
|
||||
|
||||
- name: Wait till the Object is created
|
||||
community.kubernetes.k8s_info:
|
||||
kind: Pod
|
||||
wait: yes
|
||||
name: pod-not-yet-created
|
||||
namespace: default
|
||||
wait_sleep: 10
|
||||
wait_timeout: 360
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
@@ -134,7 +144,7 @@ import copy
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
|
||||
K8sAnsibleMixin, AUTH_ARG_SPEC)
|
||||
K8sAnsibleMixin, AUTH_ARG_SPEC, WAIT_ARG_SPEC)
|
||||
|
||||
|
||||
class KubernetesInfoModule(K8sAnsibleMixin):
|
||||
@@ -156,14 +166,19 @@ class KubernetesInfoModule(K8sAnsibleMixin):
|
||||
self.exit_json(changed=False,
|
||||
**self.kubernetes_facts(self.params['kind'],
|
||||
self.params['api_version'],
|
||||
self.params['name'],
|
||||
self.params['namespace'],
|
||||
self.params['label_selectors'],
|
||||
self.params['field_selectors']))
|
||||
name=self.params['name'],
|
||||
namespace=self.params['namespace'],
|
||||
label_selectors=self.params['label_selectors'],
|
||||
field_selectors=self.params['field_selectors'],
|
||||
wait=self.params['wait'],
|
||||
wait_sleep=self.params['wait_sleep'],
|
||||
wait_timeout=self.params['wait_timeout'],
|
||||
condition=self.params['wait_condition']))
|
||||
|
||||
@property
|
||||
def argspec(self):
|
||||
args = copy.deepcopy(AUTH_ARG_SPEC)
|
||||
args.update(WAIT_ARG_SPEC)
|
||||
args.update(
|
||||
dict(
|
||||
kind=dict(required=True),
|
||||
|
||||
Reference in New Issue
Block a user