Skip to content

Commit

Permalink
Addresses ansible#6591 Hide diff for lineinfile if file did not change.
Browse files Browse the repository at this point in the history
  • Loading branch information
8191 committed Mar 21, 2014
1 parent 991399e commit b8158f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/runner/action_plugins/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant))
else:
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args)
res.diff = dict(before=dest_contents, after=resultant)
if res.result['changed']:
res.diff = dict(before=dest_contents, after=resultant)
return res
else:
return self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject, complex_args=complex_args)
Expand Down

0 comments on commit b8158f5

Please sign in to comment.