Subject: [ansible-project] Replace a string in multiple lines in a file not working


Hi all,
I'm written a play book to replace a string in multiple lines in a file but
it not reflected, It has changed  in last line of a file.
not replace in multiple places.

- name: updating driver letter as in config file
  win_lineinfile:
    path: "{{ item.path }}"
    backrefs: true
    regexp: '-fileOverwrite_D'
     line: '-fileOverwrite_{{  target_disk|upper }}'
    state: present
  with_items:
      - "{{ result.files }}"

The file of content is as below:

#Install
#-------
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\Uninstall_UCMDBServer.lax=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\resource\\iawin64_x64.dll=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\resource\\iawin32.dll=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\resource\\win64_32_x64.exe=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\resource\\remove.exe=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\UninstallerData\\resource\\invoker.exe=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\tools\\server\\custom-install.jar=Yes
-fileOverwrite_D\:\\UCMDB\\UCMDBServer\\content\\probe_patch\\probe-patch-11.4-windows.zip=Yes
-
fileOverwrite_E\:\\UCMDB\\UCMDBServer\\content\\probe_installer\\UCMDB_DataFlowProbe_11.4.exe=Yes

I run the playbook it reflecting only last line of a file.

Can you help me how to resolve this issue?

--
Thanks& Regards,
Venkat

--