theforeman.foreman.auth_source_ldap 模块 – 管理 LDAP 身份验证源
注意
此模块是 theforeman.foreman 集合 (版本 4.2.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。
要在 playbook 中使用它,请指定:theforeman.foreman.auth_source_ldap。
theforeman.foreman 1.0.0 中的新增功能
概要
- 创建、更新和删除 LDAP 身份验证源 
别名:foreman_auth_source_ldap
要求
以下是执行此模块的主机所需的条件。
- requests 
参数
| 参数 | 注释 | 
|---|---|
| 访问 LDAP 服务器时使用的帐户名称。 | |
| 访问 LDAP 服务器时使用的帐户密码。 使用 *onthefly_register* 时需要。 设置此参数后,模块将不是幂等的。 | |
| 包含名字的属性。 使用 *onthefly_register* 时需要。 | |
| 包含姓氏的属性。 使用 *onthefly_register* 时需要。 | |
| 包含登录 ID 的属性。 使用 *onthefly_register* 时需要。 | |
| 包含电子邮件地址的属性。 使用 *onthefly_register* 时需要。 | |
| 包含用户照片的属性 | |
| 搜索时使用的基本 DN。 | |
| 组所在的基 DN。 | |
| LDAP 服务器的主机名 | |
| 应用于 LDAP 搜索的过滤器 | |
| 应为其分配实体的位置列表 | |
| LDAP 身份验证源的名称 | |
| 是否动态注册用户。 选项 
 | |
| 应为其分配实体的组织列表 | |
| 访问 Foreman 服务器的用户密码。 如果任务中未指定值,则将使用环境变量  | |
| LDAP 服务器的端口号 默认值:  | |
| LDAP 服务器的类型 选项 
 | |
| Foreman 服务器的 URL。 如果任务中未指定值,则将使用环境变量  | |
| 实体的状态 选项 
 | |
| 是否在联系 LDAP 服务器时使用 TLS。 选项 
 | |
| 是否使用 NIS netgroups 代替 posix 组,对 *server_type=active_directory* 无效 选项 
 | |
| 是否在登录时同步外部用户组 选项 
 | |
| 访问 Foreman 服务器的用户名。 如果任务中未指定值,则将使用环境变量  | |
| 是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定值,则将使用环境变量  选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在 check_mode 下运行并返回更改状态预测,而无需修改实体 | |
| 支持:完全支持 | 在差异模式下,将返回有关已更改内容(或在 check_mode 下可能需要更改的内容)的详细信息 | 
示例
- name: Simple FreeIPA authentication source
  theforeman.foreman.auth_source_ldap:
    name: "Example LDAP"
    host: "ldap.example.org"
    server_url: "https://foreman.example.com"
    locations:
      - "Uppsala"
    organizations:
      - "Sweden"
    username: "admin"
    password: "changeme"
    state: present
- name: FreeIPA with automatic registration
  theforeman.foreman.auth_source_ldap:
    name: "Example LDAP"
    host: "ldap.example.org"
    onthefly_register: true
    account: uid=ansible,cn=sysaccounts,cn=etc,dc=example,dc=com
    account_password: secret
    base_dn: dc=example,dc=com
    groups_base: cn=groups,cn=accounts, dc=example,dc=com
    server_type: free_ipa
    attr_login: uid
    attr_firstname: givenName
    attr_lastname: sn
    attr_mail: mail
    attr_photo: jpegPhoto
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
- name: Active Directory with automatic registration
  theforeman.foreman.auth_source_ldap:
    name: "Example AD"
    host: "ad.example.org"
    onthefly_register: true
    account: EXAMPLE\ansible
    account_password: secret
    base_dn: cn=Users,dc=example,dc=com
    groups_base: cn=Users,dc=example,dc=com
    server_type: active_directory
    attr_login: sAMAccountName
    attr_firstname: givenName
    attr_lastname: sn
    attr_mail: mail
    ldap_filter: (memberOf=CN=Domain Users,CN=Users,DC=example,DC=com)
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
返回值
常用返回值已在 此处 记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 受影响实体的最终状态,按其类型分组。 返回:成功 | |
| LDAP 的身份验证源列表。 返回:成功 | 
