Member-only story
Delete a group — Ansible module group
How to delete the “example” group or verify that is not present on your target Linux system or macOS.
How to delete a group in Linux with Ansible?
I’m going to show you a live demo with some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot
Ansible deletes a group account
- `ansible.builtin.group`
- Add or remove groups
Today we’re talking about the Ansible module group.
The full name is ansible.builtin.group, which means that is part of the collection of modules “builtin” with ansible and shipped with it.
It’s a module pretty stable and out for years.
It adds or removes groups.
It supports a huge variety of Linux distributions and macOS.
It relies on three Linux commands: `groupadd`, `groupdel` and `groupmod`.
For Windows, use the `ansible.windows.win_group` module instead.
Parameters
- name string — group name
- state string — present/absent