[ansible] userdel -r unixadm

This is a reverse of the previous post.

Reference: https://docs.ansible.com/ansible/latest/modules/user_module.html

YAML file

---
  - hosts: linux
    become: true
    become_user: root
    tasks:
     - name: Delete user, same as userdel -r 
       user:
         name: unixadm
         remove: yes
         state: absent
...

Execution
The execution is ansible-playbook lab3.yaml -K where -K is to prompt for the sudo password.

an1

Result

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s