replacing mutliple files using lineinfile

Hi all,

I’m trying to make modifications in tomcat config file server.xml using lineinfile. I have a whole valve tag to comment. I have things like that :

And whould like to insert after.

Problème is that the tag may be on multiple lines :

How to match this, and replace it ? Maybe lineinfile is not the solution…

Regards

n0vember

I use the template module to create our tomcat server.xml files. This is probably a bit of overkill for the lineinfile module.