purestorage.flasharray.purefa_user 模块 – 创建、修改或删除 FlashArray 本地用户帐户
注意
此模块是 purestorage.flasharray 集合 (版本 1.32.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install purestorage.flasharray
。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定: purestorage.flasharray.purefa_user
。
purestorage.flasharray 1.0.0 中的新增功能
概要
在 Pure Storage FlashArray 上创建、修改或删除本地用户。
要求
在执行此模块的主机上需要以下要求。
python >= 3.3
purestorage >= 1.19
py-pure-client >= 1.26.0
netaddr
requests
pycountry
urllib3
参数
参数 |
注释 |
---|---|
定义是否为该用户创建 API 令牌 可以使用 *debug* 模块公开令牌 选项
|
|
具有管理员权限用户的 FlashArray API 令牌。 |
|
禁用调试日志中的不安全证书警告 选项
|
|
FlashArray 管理 IPv4 地址或主机名。 |
|
本地用户帐户的名称 |
|
如果更改现有密码,则出于安全原因必须提供旧密码 |
|
本地用户的密码。 |
|
将本地用户的访问级别设置为阵列 选项
|
|
创建、删除或更新本地用户帐户 选项
|
备注
注意
此模块需要
purestorage
和py-pure-client
Python 库特定模块可能需要其他 Python 库。
如果 *fa_url* 和 *api_token* 参数未直接传递到模块,则必须设置
PUREFA_URL
和PUREFA_API
环境变量
示例
- name: Create new user ansible with API token
purestorage.flasharray.purefa_user:
name: ansible
password: apassword
role: storage_admin
api: true
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
register: result
debug:
msg: "API Token: {{ result['user_info']['user_api'] }}"
- name: Change role type for existing user
purestorage.flasharray.purefa_user:
name: ansible
role: array_admin
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Change password type for existing user (NOT IDEMPOTENT)
purestorage.flasharray.purefa_user:
name: ansible
password: anewpassword
old_password: apassword
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Change API token for existing user
purestorage.flasharray.purefa_user:
name: ansible
api: true
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
register: result
debug:
msg: "API Token: {{ result['user_info']['user_api'] }}"