mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Add STDOUT lines in response of "synchronize" module
This commit is contained in:
parent
f9ec53cdef
commit
c039dbe300
1 changed files with 5 additions and 2 deletions
|
@ -304,8 +304,11 @@ def main():
|
||||||
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
||||||
else:
|
else:
|
||||||
changed = changed_marker in out
|
changed = changed_marker in out
|
||||||
return module.exit_json(changed=changed, msg=out.replace(changed_marker,''),
|
out_clean=out.replace(changed_marker,'')
|
||||||
rc=rc, cmd=cmdstr)
|
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
|
# import module snippets
|
||||||
from ansible.module_utils.basic import *
|
from ansible.module_utils.basic import *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue