win_lineinfile invalid Path argument

Hello everyone,

I am trying to change specific lines of an xml file which is located on J:\ on a windows machine.
Due to the fact that the win_xml module is only able to add but not override strings, I chose the win_linefile module to do so.
This is the task I am deploying:

  • name: overwrite xml
    win_lineinfile:
    path: J:\settings_test.xml
    regexp: ‘</url>\s*\s*true</enabled>\s*</snapshots>’
    line: ‘\n’

The error I get is: msg": “Get-AnsibleParam: Parameter ‘path’ has an invalid path ‘J:\settings_test.xml’ specified.”
I allready tried to use / instead of , use single quotes and also double quotes + escaping. But nothing worked for me.
Is there anything I am missing? Thanks in advance, I appreciate any help!

Kind Regards

Hello, did u check ur host?..
Also u can check if path is configured correctly but putting a txt or conf file in the same directory as ur xml one(since i worked with txt nd conf file only using lineinfile )and running the same task on that file.If that works fine it means its failing on xml…some people complained that lineinfile somehow changed the file format…U can try using template module…
hope that might help.
Regards