purestorage.flasharray.purefa_info 模块 – 从 Pure Storage FlashArray 收集信息

注意

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

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

要安装它,请使用:ansible-galaxy collection install purestorage.flasharray。您需要进一步的要求才能使用此模块,有关详细信息,请参阅要求

要在 playbook 中使用它,请指定:purestorage.flasharray.purefa_info

purestorage.flasharray 1.0.0 中的新增功能

概要

  • 从运行 Purity//FA 操作系统的 Pure Storage Flasharray 收集信息。默认情况下,该模块将收集基本信息,包括主机、主机组、保护组和卷计数。可以根据配置的参数集收集其他信息。

要求

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

  • python >= 3.3

  • purestorage >= 1.19

  • py-pure-client >= 1.26.0

  • netaddr

  • requests

  • pycountry

  • urllib3

参数

参数

注释

api_token

字符串

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

disable_warnings

布尔值

在 purestorage.flasharray 1.29.0 中添加

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

选项

  • false ← (默认)

  • true

fa_url

字符串

FlashArray 管理 IPv4 地址或主机名。

gather_subset

列表 / 元素=字符串

提供此参数时,它将定义要收集的信息。可能的值包括 all、minimum、config、performance、capacity、network、subnet、interfaces、hgroups、pgroups、hosts、admins、volumes、snapshots、pods、replication、vgroups、offload、apps、arrays、certs、kmip、clients、policies、dir_snaps、filesystems、alerts、virtual_machines 和 subscriptions。

默认值: ["minimum"]

注意

注意

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

  • 特定模块可能需要额外的 Python 库。

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

示例

- name: collect default set of information
  purestorage.flasharray.purefa_info:
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
  register: array_info
- name: show default information
  debug:
    msg: "{{ array_info['purefa_info']['default'] }}"

- name: collect configuration and capacity information
  purestorage.flasharray.purefa_info:
    gather_subset:
      - config
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
  register: array_info
- name: show configuration information
  debug:
    msg: "{{ array_info['purefa_info']['config'] }}"

- name: collect all information
  purestorage.flasharray.purefa_info:
    gather_subset:
      - all
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: show all information
  debug:
    msg: "{{ array_info['purefa_info'] }}"

返回值

常见的返回值在此处记录 here,以下是此模块特有的字段

描述

purefa_info

字典

返回从 FlashArray 收集的信息

返回:始终

作者

  • Pure Storage ansible 团队 (@sdodsley)