# Ansible playbook text/line insertion in file

**URL:** <https://forum.ansible.com/t/ansible-playbook-text-line-insertion-in-file/27077>\
**Category:** Ansible Project\
**Created:** [March 22, 2018, 12:09pm UTC](https://forum.ansible.com/t/ansible-playbook-text-line-insertion-in-file/27077 "2018-03-22T12:09:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhinav\_Agnihotri](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@Abhinav\_Agnihotri](https://forum.ansible.com/u/Abhinav_Agnihotri)\
**Post date:** [March 22, 2018, 12:09pm UTC](https://forum.ansible.com/t/ansible-playbook-text-line-insertion-in-file/27077/1 "2018-03-22T12:09:56Z")

</div>

Hi,

This is my file, in which i want to change some existing line.

Some random text: testing line  
Below are examples:  
Example 0  
Example 1  
Example 2  
path:this file path is /home/ansible/Test\_folder1/Test\_path.cgf

i need this:

Some random text: testing line  
Below are some examples:  
Example 0  
Example 1  
Example 2  
path:this file path is /home/ansible/Test\_folder1/Test\_path.cgf

But, actually i want this thing by using some regexp or insertbefore attribute.
