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 -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFMhZ_JAk8h%3DXR3tX4njK%3DQ%3DzOM-FRqWvMtoby6K8WXA3%2BMnkw%40mail.gmail.com.