# blockinfile

**URL:** <https://forum.ansible.com/t/blockinfile/20503>\
**Category:** Ansible Project\
**Created:** [February 9, 2016, 8:12pm UTC](https://forum.ansible.com/t/blockinfile/20503 "2016-02-09T20:12:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erick\_K](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Erick\_K](https://forum.ansible.com/u/Erick_K)\
**Post date:** [February 9, 2016, 8:12pm UTC](https://forum.ansible.com/t/blockinfile/20503/1 "2016-02-09T20:12:51Z")

</div>

I want to add new hosts to an http configuration file. When I use blockinfile it’s replacing the last block and not appending to the end. What I’d like to do is keep adding to the file but blockfile doesn’t seem to be doing what I want.

\<VirtualHost _:_\>  
ServerAdmin someone  
DocumentRoot /var/www/html/prod/liver  
ServerName liver  
ServerAlias www.liver  
  
\<VirtualHost _:_\>  
ServerAdmin someone  
DocumentRoot /var/www/html/prod/liver  
ServerName liver  
ServerAlias www.liver

My code
