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
specifies to create a group if it does not exist, otherwise it changes the attributes of the specified group.
absent
deletes an existing group. Users who are group members are not removed.- group_attributes (optional, dict, None)
Specifies the attributes for the group to be created or modified.
Can be used when state=present .
- 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 nameCan be used when state=present.
- 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 groupCan be used when state=present.
- 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=present.
- remove_keystore (optional, bool, True)
Specifies to remove the group’s keystore information while removing the goup.
Can be used when state=absent.
- load_module (optional, str, files)
Specifies the location where the operations need to be performed on the user.
files
creates/updates/deletes the user present in the Local machine.
LDAP
creates/updates the user present in the LDAP server.
Notes
Note
You can refer to the IBM documentation for additional information on the commands used at https://www.ibm.com/support/knowledgecenter/ssw_aix_72/m_commands/mkgroup.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_72/c_commands/chgrpmem.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_72/r_commands/rmgroup.html.
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.