My guess is you are hitting the difference between what linux and windows 
considers a line ending.

linux is happy with \n 

windows wants \r\n

if you run 

od -cx yourfile

you will probably only see \n

if the file was originally created on a windows machine, in say, Notepad, 
then it will get the \r\n line endings.

I suggest you do the following:

edit the file in Notepad on a windows machine.
use the fetch module to copy it from the windows machine to your ansible 
controller
use od -cx to check it has windows line endings
the file from windows should now copy across unmodified when using win_copy

Hope this helps,

Jon

On Thursday, 3 March 2016 11:33:17 UTC, ishan jain wrote:
>
> I am copying some text files located on a linux file system to windows 
> file system using the win_copy module of Ansible. The final copied file do 
> not have line breaks in it.
>
> So the file which is like this on linux:
>
> line1
> line2
> line3
>
>
> Becomes this on windows:
> line1line2line3
>
> How can i make sure win_copy just copy the file exactly as it is ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/225d377f-ce6d-4af4-910d-3d06dda134fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to