community.general.ipa_group 模块 – 管理 FreeIPA 组
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.ipa_group。
摘要
- 在 IPA 服务器中添加、修改和删除组 
参数
| 参数 | 注释 | 
|---|---|
| 规范名称。 不能更改,因为它是唯一的标识符。 | |
| 组的描述。 | |
| 允许从受信任的域添加外部非 IPA 成员。 选项 
 | |
| 分配给此组的外部用户列表。 列表项可以为  除非提供 SID,否则即使组已拥有所有用户,模块也会始终尝试进行更改。这是因为 IPA 查询只返回 SID。 
 | |
| GID(使用此选项手动设置)。 | |
| 分配给此组的组名列表。 如果  已分配但未传递的组将被删除。 如果  如果省略此选项,则不会检查或更改已分配的组。 | |
| IPA 服务器的 IP 或主机名。 如果任务中未指定此值,则将改用环境变量  如果任务中既未指定环境变量  FreeIPA 中需要的相关条目是  如果任务中 DNS 条目、环境变量  默认值:  | |
| 管理员用户的密码。 如果任务中未指定此值,则将改用环境变量  请注意,如果  如果环境变量 如果环境变量 如果GSSAPI不可用,则需要使用 | |
| FreeIPA/IPA服务器的端口。 如果任务中未指定此值,则将使用环境变量 如果任务中既未指定环境变量 默认值:  | |
| IPA服务器使用的协议。 如果任务中未指定此值,则将使用环境变量 如果任务中既未指定环境变量 选项 
 | |
| 指定连接的空闲超时时间(以秒为单位)。 对于批量操作,您可能需要增加此值以避免IPA服务器超时。 如果任务中未指定此值,则将使用环境变量 如果任务中既未指定环境变量 默认值:  | |
| 在IPA服务器上使用的管理帐户。 如果任务中未指定此值,则将使用环境变量 如果任务中既未指定环境变量 默认值:  | |
| 创建为非POSIX组。 选项 
 | |
| 要确保的状态 选项 
 | |
| 分配给此组的用户名称列表。 如果 已分配但未传递的用户将被删除。 如果 如果省略此选项,则不会检查或更改已分配的用户。 | |
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在 | |
| 支持:不支持 | 处于差异模式时,将返回有关已更改内容(或可能需要在 | 
示例
- name: Ensure group is present
  community.general.ipa_group:
    name: oinstall
    gidnumber: '54321'
    state: present
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
- name: Ensure that groups sysops and appops are assigned to ops but no other group
  community.general.ipa_group:
    name: ops
    group:
    - sysops
    - appops
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
- name: Ensure that users linus and larry are assign to the group, but no other user
  community.general.ipa_group:
    name: sysops
    user:
    - linus
    - larry
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
- name: Ensure that new starter named john is member of the group, without removing other members
  community.general.ipa_group:
    name: developers
    user:
    - john
    append: true
    state: present
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
- name: Add external user to a group
  community.general.ipa_group:
   name: developers
   external: true
   append: true
   external_user:
   - S-1-5-21-123-1234-12345-63421
   ipa_host: ipa.example.com
   ipa_user: admin
   ipa_pass: topsecret
- name: Add a user from MYDOMAIN
  community.general.ipa_group:
   name: developers
   external: true
   append: true
   external_user:
   - MYDOMAIN\\john
   ipa_host: ipa.example.com
   ipa_user: admin
   ipa_pass: topsecret
- name: Ensure group is absent
  community.general.ipa_group:
    name: sysops
    state: absent
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
返回值
常见的返回值已在此处记录,以下是此模块独有的字段
| Key | 描述 | 
|---|---|
| IPA API返回的组 返回值:始终返回 | 
