group-exists

Example:

# Create a group called 'freckles' with gid 1111.
- group-exists:
    group: freckles
    gid: 1111

Description

Create a group on a system if it doesn't exist yet.

If the group argument is not present or empty, this task will be skipped.

If the group exists, and the optional gid argument is specified, it'll be changed if necessary. Optionally, the group can be marked as a 'system' group.

Resources

Variables

Name Type Default Description

group

string --

The name of the group. Required

gid

integer --

The gid of the group.

system_group

boolean --

Whether the group should be created as 'system' group.

Examples

Example 1

Create a group called 'freckles' with gid 1111.

Code
- group-exists:
    group: freckles
    gid: 1111

Example 2

Create a group called 'freckles' with a random gid.

Code
- group-exists:
    group: freckles

Command-line

frecklecute group-exists --help

Usage: frecklecute group-exists [OPTIONS] GROUP_NAME

  Create a group on a system if it doesn't exist yet.

  If the ``group`` argument is not present or empty, this task will be
  skipped.

  If the group exists, and the optional ``gid`` argument is specified, it'll
  be changed if necessary. Optionally, the group can be marked as a 'system'
  group.

Options:
  --gid GID                       The gid of the group.
  --system-group / --no-system-group
                                  Whether the group should be created as
                                  'system' group.
  --help                          Show this message and exit.