group – Manage presence, attributes and member of AIX groups.

Synopsis

It allows to create new group, to change/remove attributes and administrators or members of a group, and to delete an existing group.

Requirements

The below requirements are needed on the host that executes this module.

  • AIX >= 7.1 TL3

  • Python >= 3.6

  • Privileged user with authorizations: aix.security.group.remove.admin,aix.security.group.remove.normal, aix.security.group.create.admin,aix.security.group.create.normal,aix.security.group.list

Parameters

name (True, str, None)

Specifies the name of the group to manage.

state (True, str, None)

Specifies the action to be performed.

present creates a new group. When the group already exists, use sate=modify to change its attributes.

absent deletes an existing group. Users who are group members are not removed.

modify changes specified value of attributes of an existing group. When the group does not exist, use state=present.

group_attributes (optional, dict, None)

Specifies the attributes for the group to be created or modified.

Can be used when state=present or state=modify.

user_list_action (optional, str, None)

Specifies to add or remove members/admins from the group.

add to add members or admins of the group with provided users_list in group name

remove to remove members or admins of the group with provided users_list from group name

Can be used when state=modify.

user_list_type (optional, str, None)

Specifies the type of user to add/remove.

members specifies the user_list_action is performed on members of the group

admins specifies the user_list_action is performed on admins of the group

Can be used when state=modify.

users_list (optional, list, None)

Specifies a list of user to be added/removed as members/admins of the group.

Should be used along with user_list_action and user_list_type parameters.

Can be used when state=modify.

remove_keystore (optional, bool, True)

Specifies to remove the group’s keystore information while removing the goup.

Can be used when state=absent.

Notes

Examples

- name: Add a member to a group
  ibm.power_aix.group:
    state: modify
    name: ansible
    user_list_action: 'add'
    user_list_type: 'members'
    users_list: 'test1'

- name: Remove a member from a group
  ibm.power_aix.group:
    state: modify
    name: ansible
    user_list_action: 'remove'
    user_list_type: 'members'
    users_list: 'test1'

- name: Create a group
  ibm.power_aix.group:
    state: present
    name: ansible

- name: Remove a group
  ibm.power_aix.group:
    state: absent
    name: ansible

- name: Modify group attributes
  ibm.power_aix.group:
    state: modify
    name: ansible
    group_attributes: "admin=true"

Return Values

msg (always, str, Group: foo SUCCESSFULLY created.)

The execution message.

cmd (always, str, )

The command executed.

rc (When the command is executed., int, )

The command return code.

stdout’ (If the command failed., str, )

The standard output.

stderr’ (If the command failed., str, )

The standard error.

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by community.

Authors

  • AIX development Team (@pbfinley1911)