I am having a challenge removing a block of lines in a configuration file after an uninstall using Ansible module blockinfile. I have tried multiple variations(of indentation) after block: | but they’re all a miss. In the configuration file, the first line is preceded by 2 tabs(8spaces) and this appears to be what I’m not getting right in my code
Once you've set that up properly, it's way more robust and will do
exactly what you're looking for.
It does depend on the entire xml file though - if you can post that?
Visser, you are right, i truncated the file but i am including the complete file below this reply.
Using the solution you provided got me somewhere but i noticed that some changes in the file with respect to change from double to single quotes and character spacing. Here is a screenshot of the file after running the playbook compared to the original file on the right. I highlighted the few changes.
I am not experienced with xml and not sure what effect this would have.