Add custom or 'prepared' diff field to synchronize module
This PR depends on pull requeest ansible/ansible#14105 rsync has a custom diff output that cannot easily be expressed as `/usr/bin/diff before after`
This commit is contained in:
parent
12be401c11
commit
25ccb98d49
1 changed files with 8 additions and 2 deletions
|
@ -418,6 +418,12 @@ 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('')
|
||||||
|
if module._diff:
|
||||||
|
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,
|
return module.exit_json(changed=changed, msg=out_clean,
|
||||||
rc=rc, cmd=cmdstr, stdout_lines=out_lines)
|
rc=rc, cmd=cmdstr, stdout_lines=out_lines)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue