# Ansible module with Python replace string in multiple files

**URL:** <https://forum.ansible.com/t/ansible-module-with-python-replace-string-in-multiple-files/32184>\
**Category:** Ansible Project\
**Created:** [February 10, 2020, 9:08am UTC](https://forum.ansible.com/t/ansible-module-with-python-replace-string-in-multiple-files/32184 "2020-02-10T09:08:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uppara\_venkat](https://avatars.discourse-cdn.com/v4/letter/u/6a8cbe/32.png) [@Uppara\_venkat](https://forum.ansible.com/u/Uppara_venkat)\
**Post date:** [February 10, 2020, 9:08am UTC](https://forum.ansible.com/t/ansible-module-with-python-replace-string-in-multiple-files/32184/1 "2020-02-10T09:08:24Z")

</div>

Hi all,  
I’m new to Ansible module with Python needed some help for below scenario;

we have windows\_config.yml defined all variable in this file, like target\_disk: 'D:'have to find all \*ResponseFile.txt in folder in that we need change replace drive latter as in windows\_config.yml.

In all \*ResponseFile.txt files we need replace in multiple files and places like USER\_INSTCLL\_CIR= C and -fileOverwrite\_C

Red color letter should be replaced with target\_disk.

If any have idea please share examples or code.
