purestorage.flasharray.purefa_hg 模块 – 管理 Pure Storage FlashArrays 上的主机组
注意
此模块是 purestorage.flasharray 集合(版本 1.32.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install purestorage.flasharray。您需要更多要求才能使用此模块,请参阅 要求 了解详细信息。
要在剧本中使用它,请指定:purestorage.flasharray.purefa_hg。
purestorage.flasharray 1.0.0 中的新增功能
概要
- 在 Pure Storage FlashArrays 上创建、删除或修改主机组。 
要求
执行此模块的主机上需要以下要求。
- python >= 3.3 
- purestorage >= 1.19 
- py-pure-client >= 1.26.0 
- netaddr 
- requests 
- pycountry 
- urllib3 
参数
| 参数 | 注释 | 
|---|---|
| 具有管理员权限用户的 FlashArray API 令牌。 | |
| 禁用调试日志中的不安全证书警告 选项 
 | |
| 是否彻底删除已删除的主机组 选项 
 | |
| FlashArray 管理 IPv4 地址或主机名。 | |
| 要添加到主机组的现有主机列表。 请注意,主机名区分大小写,但 FlashArray 主机名是唯一的并且忽略大小写 - 您不能同时拥有 *hosta* 和 *hostA* | |
| 要分配给主机组卷的 LUN ID。必须是唯一的。 仅当为一个连接指定一个卷时适用。 如果未提供,将自动分配 ID。 LUN ID 的范围是 1 到 4095。 | |
| 主机组的名称。 | |
| 主机组的新名称 | |
| 定义主机组是否应该存在。 选项 
 | |
| 要添加到主机组的现有卷列表。 请注意,卷区分大小写,但 FlashArray 卷名称是唯一的并且忽略大小写 - 您不能同时拥有 *volumea* 和 *volumeA* | 
注意
注意
- 此模块需要 - purestorage和- py-pure-clientPython 库
- 特定模块可能需要其他 Python 库。 
- 如果未直接将 *fa_url* 和 *api_token* 参数传递给模块,则必须设置 - PUREFA_URL和- PUREFA_API环境变量
示例
- name: Create empty hostgroup
  purestorage.flasharray.purefa_hg:
    name: foo
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Add hosts and volumes to existing or new hostgroup
  purestorage.flasharray.purefa_hg:
    name: foo
    host:
      - host1
      - host2
    volume:
      - vol1
      - vol2
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete hosts and volumes from hostgroup
  purestorage.flasharray.purefa_hg:
    name: foo
    host:
      - host1
      - host2
    volume:
      - vol1
      - vol2
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent
# This will disconnect all hosts and volumes in the hostgroup
- name: Delete hostgroup
  purestorage.flasharray.purefa_hg:
    name: foo
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent
- name: Rename hostgroup
  purestorage.flasharray.purefa_hg:
    name: foo
    rename: bar
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Create host group with hosts and volumes
  purestorage.flasharray.purefa_hg:
    name: bar
    host:
      - host1
      - host2
    volume:
      - vol1
      - vol2
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
