| Server IP : 157.22.201.140 / Your IP : 216.73.216.74 Web Server : nginx/1.30.1 System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/ansible/modules/__pycache__/ |
Upload File : |
�
1<�e�Q � �n � d dl mZmZmZ eZdZdZdZd dl Z d dl
Z
d dlmZ d dl
mZ d dlmZ G d � d
e� Z G d� de� Z G d
� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Zd� Zed k( r e� yy)!� )�absolute_import�division�print_functiona�
---
module: group
version_added: "0.0.2"
short_description: Add or remove groups
requirements:
- groupadd
- groupdel
- groupmod
description:
- Manage presence of groups on a host.
- For Windows targets, use the M(ansible.windows.win_group) module instead.
options:
name:
description:
- Name of the group to manage.
type: str
required: true
gid:
description:
- Optional I(GID) to set for the group.
type: int
state:
description:
- Whether the group should be present or not on the remote host.
type: str
choices: [ absent, present ]
default: present
force:
description:
- Whether to delete a group even if it is the primary group of a user.
- Only applicable on platforms which implement a --force flag on the group deletion command.
type: bool
default: false
version_added: "2.15"
system:
description:
- If V(yes), indicates that the group created is a system group.
type: bool
default: no
local:
description:
- Forces the use of "local" command alternatives on platforms that implement it.
- This is useful in environments that use centralized authentication when you want to manipulate the local groups.
(for example, it uses C(lgroupadd) instead of C(groupadd)).
- This requires that these commands exist on the targeted host, otherwise it will be a fatal error.
type: bool
default: no
version_added: "2.6"
non_unique:
description:
- This option allows to change the group ID to a non-unique value. Requires O(gid).
- Not supported on macOS or BusyBox distributions.
type: bool
default: no
version_added: "2.8"
extends_documentation_fragment: action_common_attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
platform:
platforms: posix
seealso:
- module: ansible.builtin.user
- module: ansible.windows.win_group
author:
- Stephen Fromm (@sfromm)
z�
- name: Ensure group "somegroup" exists
ansible.builtin.group:
name: somegroup
state: present
- name: Ensure group "docker" exists with correct gid
ansible.builtin.group:
name: docker
state: present
gid: 1750
a�
gid:
description: Group ID of the group.
returned: When O(state) is C(present)
type: int
sample: 1001
name:
description: Group name.
returned: always
type: str
sample: users
state:
description: Whether the group is present or not.
returned: always
type: str
sample: 'absent'
system:
description: Whether the group is a system group or not.
returned: When O(state) is C(present)
type: bool
sample: False
N)�to_bytes)�
AnsibleModule)�get_platform_subclassc �^ � � e Zd ZdZdZdZdZ� fd�Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Z� xZS )�Groupa-
This is a generic Group manipulation class that is subclassed
based on platform.
A subclass may wish to override the following action methods:-
- group_del()
- group_add()
- group_mod()
All subclasses MUST define platform and distribution (which may be None).
�GenericN�
/etc/groupc �@ �� t t � }t | |� |� S �N)r r
�super�__new__)�cls�args�kwargs�new_cls� __class__s ��7/usr/lib/python3/dist-packages/ansible/modules/group.pyr z
Group.__new__� s �� �'��.���S�'�*�7�3�3� c �* � || _ |j d | _ |j d | _ |j d | _ |j d | _ |j d | _ |j d | _ |j d | _ y )N�state�name�force�gid�system�local�
non_unique) �module�paramsr r r r r r r )�selfr s r �__init__zGroup.__init__� sy � �����]�]�7�+��
��M�M�&�)�� ��]�]�7�+��
��=�=��'����m�m�H�-����]�]�7�+��
� �-�-��5��r c �8 � | j j |� S r )r �run_command�r"