mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-29 19:04:39 +00:00
Also provide log_lines
This commit is contained in:
@@ -115,6 +115,11 @@ log:
|
|||||||
description:
|
description:
|
||||||
- The text log of the object
|
- The text log of the object
|
||||||
returned: success
|
returned: success
|
||||||
|
log_lines:
|
||||||
|
type: list
|
||||||
|
description:
|
||||||
|
- The log of the object, split on newlines
|
||||||
|
returned: success
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@@ -173,11 +178,13 @@ class KubernetesLogModule(KubernetesAnsibleModule):
|
|||||||
if self.params.get('container'):
|
if self.params.get('container'):
|
||||||
kwargs['query_params'] = dict(container=self.params['container'])
|
kwargs['query_params'] = dict(container=self.params['container'])
|
||||||
|
|
||||||
self.exit_json(changed=False, log=resource.log.get(
|
log = resource.log.get(
|
||||||
name=name,
|
name=name,
|
||||||
namespace=self.params.get('namespace'),
|
namespace=self.params.get('namespace'),
|
||||||
**kwargs
|
**kwargs
|
||||||
))
|
)
|
||||||
|
|
||||||
|
self.exit_json(changed=False, log=log, log_lines=log.split('\n'))
|
||||||
|
|
||||||
def extract_selectors(self, instance):
|
def extract_selectors(self, instance):
|
||||||
# Parses selectors on an object based on the specifications documented here:
|
# Parses selectors on an object based on the specifications documented here:
|
||||||
|
|||||||
Reference in New Issue
Block a user