Merge pull request #2870 from towolf/add_diff_to_synchronize
Add custom diff field to synchronize module
This commit is contained in:
commit
3239691e9e
1 changed files with 8 additions and 2 deletions
|
@ -418,8 +418,14 @@ def main():
|
||||||
out_lines=out_clean.split('\n')
|
out_lines=out_clean.split('\n')
|
||||||
while '' in out_lines:
|
while '' in out_lines:
|
||||||
out_lines.remove('')
|
out_lines.remove('')
|
||||||
return module.exit_json(changed=changed, msg=out_clean,
|
if module._diff:
|
||||||
rc=rc, cmd=cmdstr, stdout_lines=out_lines)
|
diff = {'prepared': out_clean}
|
||||||
|
return module.exit_json(changed=changed, msg=out_clean,
|
||||||
|
rc=rc, cmd=cmdstr, stdout_lines=out_lines,
|
||||||
|
diff=diff)
|
||||||
|
else:
|
||||||
|
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…
Reference in a new issue