We had a standard user on many Linux systems across the estate that was used for a certain purpose.
Now the project was over we needed to remove them all, the easiest way I thought was a simple ansible playbook, put all the hosts in the hosts file and leave it to run.
Below is the code should you ever need to use it, I have changed the username from the real one to protect the innocent.
---
- name: Drop THE user
hosts: droptheuser
user: root
vars:
tasks:
- name: Drop the User
user:
name: username
state: absent
remove: yes
tags:
drop_user
I am always interested in feedback so please feel free to add any comments, or you can mail me here. If you would like to submit a quick tip with full credit and links back to your site then also feel free to contact me.

![fatal: []: FAILED! => {"changed": false, "failed": true, "msg": "Could not find or access '/tmp/filename'"}](https://images.squarespace-cdn.com/content/v1/57068a2507eaa0b8239710c0/1522833314665-G9Z1PCR4KQGZ9ZLK5MIH/image-ansible.png)
