community.general.udm_group 模块 – 管理 posix 用户组

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在 playbook 中使用它,请指定:community.general.udm_group

概要

  • 此模块允许在 Univention Corporate Server (UCS) 上管理用户组。 它使用 UCS 的 python API 来创建新对象或编辑它。

参数

参数

注释

description

字符串

用户组描述。

name

字符串 / 必需

posix 用户组的名称。

ou

字符串

LDAP OU,例如 LDAP OU ou=school,dc=example,dc=com 的 school。

默认值: ""

position

字符串

定义组的整个 ldap 位置,例如 cn=g123m-1A,cn=classes,cn=schueler,cn=groups,ou=schule,dc=example,dc=com

默认值: ""

state

字符串

组是否存在。

选项

  • "present" ← (默认)

  • "absent"

subpath

字符串

OU 内的子路径,例如 cn=classes,cn=students,cn=groups

默认值: "cn=groups"

属性

属性

支持

描述

check_mode

支持: 完整

可以在 check_mode 中运行并返回已更改的状态预测,而无需修改目标。

diff_mode

支持: 部分

在 diff 模式下,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息。

示例

- name: Create a POSIX group
  community.general.udm_group:
    name: g123m-1A

# Create a POSIX group with the exact DN
# C(cn=g123m-1A,cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com)
- name: Create a POSIX group with a DN
  community.general.udm_group:
    name: g123m-1A
    subpath: 'cn=classes,cn=students,cn=groups'
    ou: school

# or
- name: Create a POSIX group with a DN
  community.general.udm_group:
    name: g123m-1A
    position: 'cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com'

作者

  • Tobias Rüetschi (@keachi)