Ansible - Create and remove groups using the group module
by
Jeremy Canfield |
Updated: August 18 2022
| Ansible articles
If you are not familiar with modules, check out Ansible - Getting Started with Modules.
The group module is similar to the groupadd and groupdel commands. The user module is used to create or delete a group on a managed node (e.g. target system). In this example, group001 will be created.
- name: create group001
group:
name: group001
state: present
In this example, group001 will be deleted.
- name: delete group001
group:
name: group001
state: absent
Did you find this article helpful?
If so, consider buying me a coffee over at