# using lineinfile module for modifying XML file issue

**URL:** <https://forum.ansible.com/t/using-lineinfile-module-for-modifying-xml-file-issue/14983>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 9, 2014, 7:41pm UTC](https://forum.ansible.com/t/using-lineinfile-module-for-modifying-xml-file-issue/14983 "2014-04-09T19:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack1](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jack1](https://forum.ansible.com/u/jack1)\
**Post date:** [April 9, 2014, 7:41pm UTC](https://forum.ansible.com/t/using-lineinfile-module-for-modifying-xml-file-issue/14983/1 "2014-04-09T19:41:19Z")

</div>

Hi,

We are using ansible 1.5.3, and trying to replace/add a line to a xml file. But after lineinfile task is executed, the file format got changed from the Linux to windows, we observed that the end of line for all the line (except the line added or replaced) has been changed (end of line with ^M). We double checked the xml file format before the liniinfile task executed was correct linux format. Any idea about this?

Thanks  
Jack

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 15, 2014, 8:43pm UTC](https://forum.ansible.com/t/using-lineinfile-module-for-modifying-xml-file-issue/14983/2 "2014-04-15T20:43:06Z")

</div>

Sorry for late response here – PyCON travel and such.

“except the line added or replaced) has been changed (end of line with ^M)”

Are you saying Windows files get changed to Linux format, instead of the opposite?

I’d expect this to be the case.
