Working with Ansible – Cleanup tasks

My current project is heavily based on Ansible. We use Ansible to deploy into different environments and domains. The configuration has become quite complex. That is why we need to cleanup a server from time to time. Especially when one has to upgrade services on a server and requires to get rid of the old services first. In this post I would like to show you, how we define and run Ansible cleanup tasks in our project.