community.general.oneview_logical_interconnect_group 模块 – 管理 OneView 逻辑互连组资源

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

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

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

要在 playbook 中使用它,请指定:community.general.oneview_logical_interconnect_group

概要

  • 提供用于管理逻辑互连组资源的接口。可以创建、更新或删除。

要求

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

  • Python >= 2.7.9

  • hpOneView >= 4.0.0

参数

参数

注释

api_version

整数

OneView API 版本。

config

路径

包含 OneView 客户端配置的 JSON 配置文件的路径。配置文件是可选的,并且在使用时应存在于运行 ansible 命令的主机中。如果未提供文件路径,则配置将从环境变量加载。有关示例配置文件或如何使用环境变量的链接,请验证“备注”部分。

data

字典 / 必需

包含逻辑互连组属性的列表。

hostname

字符串

设备的 IP 地址或主机名。

image_streamer_hostname

字符串

HPE Image Streamer REST API 的 IP 地址或主机名。

password

字符串

用于 API 身份验证的密码。

state

字符串

指示逻辑互连组资源所需的预期状态。absent 将从 OneView 中删除该资源(如果存在)。present 将确保数据属性与 OneView 兼容。

选项

  • "absent"

  • "present" ← (默认)

username

字符串

用于 API 身份验证的用户名。

validate_etag

布尔值

启用 ETag 验证后,仅当资源的当前 ETag 与数据中提供的 ETag 匹配时,才会对请求进行有条件的处理。

选项

  • false

  • true ← (默认)

属性

属性

支持

描述

check_mode

支持:

可以在 check_mode 中运行,并返回更改状态预测,而无需修改目标。

diff_mode

支持:

当处于差异模式时,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息。

备注

注意

示例

- name: Ensure that the Logical Interconnect Group is present
  community.general.oneview_logical_interconnect_group:
    config: /etc/oneview/oneview_config.json
    state: present
    data:
      name: Test Logical Interconnect Group
      uplinkSets: []
      enclosureType: C7000
      interconnectMapTemplate:
        interconnectMapEntryTemplates:
          - logicalDownlinkUri: ~
            logicalLocation:
                locationEntries:
                    - relativeValue: 1
                      type: Bay
                    - relativeValue: 1
                      type: Enclosure
            permittedInterconnectTypeName: HP VC Flex-10/10D Module
            # Alternatively you can inform permittedInterconnectTypeUri
  delegate_to: localhost

- name: Ensure that the Logical Interconnect Group has the specified scopes
  community.general.oneview_logical_interconnect_group:
    config: /etc/oneview/oneview_config.json
    state: present
    data:
      name: Test Logical Interconnect Group
      scopeUris:
        - /rest/scopes/00SC123456
        - /rest/scopes/01SC123456
  delegate_to: localhost

- name: Ensure that the Logical Interconnect Group is present with name 'Test'
  community.general.oneview_logical_interconnect_group:
    config: /etc/oneview/oneview_config.json
    state: present
    data:
      name: New Logical Interconnect Group
      newName: Test
  delegate_to: localhost

- name: Ensure that the Logical Interconnect Group is absent
  community.general.oneview_logical_interconnect_group:
    config: /etc/oneview/oneview_config.json
    state: absent
    data:
      name: New Logical Interconnect Group
  delegate_to: localhost

返回值

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

描述

逻辑互连组

字典

包含有关 OneView 逻辑互连组的事实信息。

返回: 状态为“present”时返回。可以为空。

作者

  • Felipe Bulsoni (@fgbulsoni)

  • Thiago Miotto (@tmiotto)

  • Adriane Cardozo (@adriane-cardozo)