[Best Practices] Deprovisioning Resources

Hey guys,

I was wondering how most people are handling deprovisioning resources like Virtual Machines, etc once they are no longer used/needed in your ansible playbooks.

I understand you can set the state=absent flag in the playbook, and then run it, to delete the VM, but for those who are tracking their playbooks in Git, are you then commiting the state=absent resource to your repository?

If so, are you leaving these resources in the playbook permanently, or coming back later and removing the lines entirely?

Or are you simply cleaning up the extra resources manually and removing the lines from your playbook altogether?

I hope this was clear,

Thanks

Playbooks should be idempotent so in this case “state” would be a variable set at runtime.
At least that’s what I strive to do in cases like this.