Detach a deployed machine from MaaS and make it independent.

I had a similar use case. I created an Ansible playbook to cleanup the artifacts. There are artifacts in many places depending on how MAAS deployed the host. Here are a few items:

dns entries
/etc/cloud/cloud.cfg.d (several files)
chrony/ntp conf
the package manager may have proxy entries
repositories
ssh password authentication