Well, you just change state to absent and it will be uninstalled. You don't need two tasks for that. It's one task that describes state of a package. That state can be a number of things. You don't even need to create a task for each package, you can easily make a loop over a predefined key:value list with statuses of packages you want/don't want.
What I mean is that It's not an impossible goal with Ansible. Not even a tough one.