How difficult would it be to add an "insertafter_regex" in the lineinfile module?
Reasoning:
For system files, I often much prefer use something like lineifile rather than template, so that I benefit of the changes brought by new versions when deploying to newer system. Unfortunately, often, *where* I insert a file makes a big difference, and it cannot always be at the beginning or at the end, often, it has to be somewhere precise in the middle. One good example is server.xml for tomcat. I only need to change very few lines somewhere in the middle, but I don't want to template the whole file, because from one version to the next, they add useful modifications.