# blockinfile - learning pains

**URL:** <https://forum.ansible.com/t/blockinfile-learning-pains/23535>\
**Category:** Ansible Project\
**Created:** [January 23, 2017, 5:12pm UTC](https://forum.ansible.com/t/blockinfile-learning-pains/23535 "2017-01-23T17:12:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkD](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@MarkD](https://forum.ansible.com/u/MarkD)\
**Post date:** [January 23, 2017, 5:12pm UTC](https://forum.ansible.com/t/blockinfile-learning-pains/23535/1 "2017-01-23T17:12:10Z")

</div>

Hi,

I am trying to remove from a file a block of text defined by (start/end) the following line

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [January 24, 2017, 11:50am UTC](https://forum.ansible.com/t/blockinfile-learning-pains/23535/2 "2017-01-24T11:50:00Z")

</div>

As my crystal ball is in repair, why don't you show us the complete  
task and the actual error output? It's hard to guess otherwise...

Johannes
