Enforce state='file' in copy module

This was causing wrong behaviour when `prev_state` was `hard`-link,
since the `file` module tried to apply the same `state` on the new
file, causing unexpected errors.

Particularly, both `overlay` and `devicemapper` storage drivers in
docker use hardlinks to share files between layers. This causes
most ansible playbooks to fail when working with files from layers
below.
This commit is contained in:
Mehran Kholdi 2016-01-17 21:43:09 +03:30 committed by Toshio Kuratomi
parent 78dfbed2a5
commit ecfa7f696d
3 changed files with 43 additions and 1 deletions

View file

@ -331,7 +331,8 @@ class ActionModule(ActionBase):
dict(
src=source_rel,
dest=dest,
original_basename=source_rel
original_basename=source_rel,
state='file',
)
)
if lmode: