Also provide log_lines

This commit is contained in:
Fabian von Feilitzsch
2020-02-06 17:07:30 -05:00
parent b69e783b21
commit 373b0fc93c

View File

@@ -115,6 +115,11 @@ log:
description:
- The text log of the object
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'):
kwargs['query_params'] = dict(container=self.params['container'])
self.exit_json(changed=False, log=resource.log.get(
log = resource.log.get(
name=name,
namespace=self.params.get('namespace'),
**kwargs
))
)
self.exit_json(changed=False, log=log, log_lines=log.split('\n'))
def extract_selectors(self, instance):
# Parses selectors on an object based on the specifications documented here: