Member-only story
Create a group in Linux — Ansible module group
How to create the “example” group or verify that is present on your target Linux system or macOS.
How to create 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 creates a group
- 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