This is a reverse of the previous post.
--- - hosts: linux become: true become_user: root tasks: - name: Delete user, same as userdel -r user: name: unixadm remove: yes state: absent ...
The execution is
ansible-playbook lab3.yaml -K where
-K is to prompt for the sudo password.