use stat module instead of checksum code

- added new function for action plugins this avoids the very fragile checksum code that is shell dependant.
- ported copy module to it
- converted assemble to new stat function
- some corrections and ported temlpate
- updated old checksum function to use new stat one under the hood
- documented revamped remote checksum method
This commit is contained in:
Brian Coca 2016-02-15 17:11:49 -05:00
parent 6ddea3e915
commit b9d0662faf
4 changed files with 62 additions and 39 deletions

View file

@ -89,6 +89,7 @@ class ActionModule(ActionBase):
delimiter = self._task.args.get('delimiter', None)
remote_src = self._task.args.get('remote_src', 'yes')
regexp = self._task.args.get('regexp', None)
follow = self._task.args.get('follow', False)
ignore_hidden = self._task.args.get('ignore_hidden', False)
if src is None or dest is None:
@ -119,10 +120,10 @@ class ActionModule(ActionBase):
path_checksum = checksum_s(path)
dest = self._remote_expand_user(dest)
remote_checksum = self._remote_checksum(dest, all_vars=task_vars)
dest_stat = self._execute_remote_stat(dest, all_vars=task_vars, follow=follow)
diff = {}
if path_checksum != remote_checksum:
if path_checksum != dest_stat['checksum']:
resultant = file(path).read()
if self._play_context.diff: