purestorage.flasharray.purefa_ds 模块 – 配置 FlashArray 目录服务

注意

此模块是 purestorage.flasharray 集合 (版本 1.32.0) 的一部分。

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

要安装它,请使用: ansible-galaxy collection install purestorage.flasharray。您需要其他要求才能使用此模块,请参阅 需求 获取详细信息。

要在剧本中使用它,请指定: purestorage.flasharray.purefa_ds

purestorage.flasharray 1.0.0 中的新增功能

摘要

  • 设置或清除目录服务的配置。目前没有 SSL 证书的功能。请使用 FlashArray GUI 进行此附加配置工作。

  • 要修改现有的目录服务配置,必须先删除现有配置,然后使用新设置重新创建。

需求

执行此模块的主机需要以下要求。

  • python >= 3.3

  • purestorage >= 1.19

  • py-pure-client >= 1.26.0

  • netaddr

  • requests

  • pycountry

  • urllib3

参数

参数

注释

api_token

字符串

具有管理员权限用户的 FlashArray API 令牌。

base_dn

字符串

设置目录服务组的可分辨名称 (DN) 的基础。基础应仅包含域组件 (DC)。输入 URI 时,base_dn 将通过解析 URI 中的域组件来填充默认值。base DN 应为每个域组件指定 DC=,多个 DC 应以逗号分隔。

bind_password

字符串

设置 bind_user 用户名帐户的密码。

bind_user

字符串

设置可用于绑定到目录并查询目录的用户名。

对于 Active Directory,请输入用于执行目录查找的帐户的用户名 - 通常称为 sAMAccountName 或用户登录名。

对于 OpenLDAP,请输入用户的完整 DN。

certificate

字符串

在 purestorage.flasharray 1.24.0 中添加

签署目录服务器证书的证书颁发机构 (CA) 的证书,用于验证已配置服务器的真实性

PEM 格式(Base64 编码)的有效签名证书

包含“—–BEGIN CERTIFICATE—–”和“—–END CERTIFICATE—–”行

长度不超过 3000 个字符

check_peer

布尔值

在 purestorage.flasharray 1.24.0 中添加

提供证书时是否强制执行服务器真实性

选项

  • false ← (默认)

  • true

disable_warnings

布尔值

在 purestorage.flasharray 1.29.0 中添加

禁用调试日志中的不安全证书警告

选项

  • false ← (默认)

  • true

dstype

字符串

要处理的目录服务的类型

选项

  • "management" ← (默认)

  • "data"

enable

布尔值

是否启用或禁用目录服务支持。

选项

  • false ← (默认)

  • true

fa_url

字符串

FlashArray 管理 IPv4 地址或主机名。

force_bind_password

布尔值

在 purestorage.flasharray 1.14.0 中添加

即使 bind 用户密码不变,也会强制重置 bind 密码。

如果设置为 *false* 且 *bind_user* 未更改,则不会重置密码。

选项

  • false

  • true ← (默认)

state

字符串

创建、删除或测试目录服务配置

选项

  • "absent"

  • "present" ← (默认)

  • "test"

uri

列表 / 元素=字符串

最多 30 个目录服务器 URI 的列表。每个 URI 必须包含方案 ldap:// 或 ldaps://(用于基于 SSL 的 LDAP)、主机名和域名或 IP 地址。例如,ldap://ad.company.com 使用域名“company.com”中的主机名“ad”配置目录服务,同时指定未加密的 LDAP 协议。

user_login

字符串

已配置 LDAP 服务器结构中的用户登录属性。通常是保存用户唯一登录名的属性字段。对于 Active Directory,默认值为 *sAMAccountName*;对于所有其他目录服务,默认值为 *uid*。

user_object

字符串

管理 LDAP 用户的对象类的值。对于 Active Directory 服务器,默认为 *User*;对于 OpenLDAP 服务器,默认为 *posixAccount* 或 *shadowAccount*(取决于服务器的组类型);对于所有其他目录服务器,默认为 person。

注释

注意

  • 此模块需要 purestoragepy-pure-client Python 库

  • 特定模块可能需要其他 Python 库。

  • 如果未直接将fa_urlapi_token 参数传递给模块,则必须设置环境变量PUREFA_URLPUREFA_API

示例

- name: Delete existing directory service
  purestorage.flasharray.purefa_ds:
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Update empty directory service (disabled)
  purestorage.flasharray.purefa_ds:
    dstype: management
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Enable existing directory service
  purestorage.flasharray.purefa_ds:
    enable: true
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Disable existing directory service
  purestorage.flasharray.purefa_ds:
    enable: false
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Update empty directory service (enabled)
  purestorage.flasharray.purefa_ds:
    enable: true
    dstype: management
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Upload CA certificate for management DNS and check peer
  purestorage.flasharray.purefa_ds:
    enable: true
    dstype: management
    certificate: "{{lookup('file', 'ca_cert.pem') }}"
    check_peer: true
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

作者

  • Pure Storage Ansible 团队 (@sdodsley)