From 7cd21a47efd923c33bf5dc506980c4220f97c6f0 Mon Sep 17 00:00:00 2001 From: "Andrea.Mandolo" Date: Mon, 10 Mar 2014 17:27:05 +0100 Subject: [PATCH] Add STDOUT lines in response of "synchronize" module --- files/synchronize | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/synchronize b/files/synchronize index d4b174f4259..29b169b870c 100644 --- a/files/synchronize +++ b/files/synchronize @@ -304,8 +304,11 @@ def main(): return module.fail_json(msg=err, rc=rc, cmd=cmdstr) else: changed = changed_marker in out - return module.exit_json(changed=changed, msg=out.replace(changed_marker,''), - rc=rc, cmd=cmdstr) + out_clean=out.replace(changed_marker,'') + out_lines=out_clean.split('\n') + while '' in out_lines: out_lines.remove('') + return module.exit_json(changed=changed, msg=out_clean, + rc=rc, cmd=cmdstr, stdout_lines=out_lines) # import module snippets from ansible.module_utils.basic import *