---

- shell: dd if=/dev/urandom of=/tmp/{{file_name}} bs=1024 count={{file_size}}
  args:
    creates: /tmp/{{file_name}}
  delegate_to: localhost

- copy:
    dest: /tmp/{{file_name}}.out
    src: /tmp/{{file_name}}

- stat: path=/tmp/{{file_name}}
  register: original
  delegate_to: localhost

- stat: path=/tmp/{{file_name}}.out
  register: copied

- assert:
    that:
    - original.stat.checksum == copied.stat.checksum
    # Upstream does not preserve timestamps at al.
    #- (not is_mitogen) or (original.stat.mtime|int == copied.stat.mtime|int)
