dellemc.openmanage.ome_template_network_vlan_info 模块 – 获取模板的网络配置。

注意

此模块是 dellemc.openmanage 集合(版本 9.9.0)的一部分。

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

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

要在 playbook 中使用它,请指定: dellemc.openmanage.ome_template_network_vlan_info

dellemc.openmanage 7.2.0 中的新增功能

概要

  • 此模块检索 OpenManage Enterprise 或 OpenManage Enterprise Modular 上模板的网络配置。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。

hostname

字符串 / 必需

OpenManage Enterprise 或 OpenManage Enterprise Modular IP 地址或主机名。

password

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。

如果未提供密码,则使用环境变量 OME_PASSWORD

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise 或 OpenManage Enterprise Modular HTTPS 端口。

默认值: 443

template_id

整数

模板的 ID。

这与 *template_name* 互斥。

template_name

字符串

模板的名称。

这与 *template_id* 互斥。

注意 如果未提供 *template_id* 或 *template_name* 选项,则模块将检索所有模板的网络 VLAN 信息。

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

套接字级别超时(以秒为单位)。

默认值: 30

username

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 用户名。

如果未提供用户名,则使用环境变量 OME_USERNAME

示例:export OME_USERNAME=username

validate_certs

布尔值

在 dellemc.openmanage 5.0.0 中添加

如果为 false,则不会验证 SSL 证书。

仅在个人控制的站点上使用自签名证书时才配置 false

在集合版本 5.0.0 之前,*validate_certs* 默认为 false

选择

  • false

  • true ← (默认)

x_auth_token

字符串

在 dellemc.openmanage 9.3.0 中添加

身份验证令牌。

如果未提供 x_auth_token,则使用环境变量 OME_X_AUTH_TOKEN

示例:export OME_X_AUTH_TOKEN=x_auth_token

注释

注意

  • 在可以直接访问 Dell OpenManage Enterprise 的系统上运行此模块。

  • 此模块支持 check_mode

示例

---
- name: Retrieve network details of all templates.
  dellemc.openmanage.ome_template_network_vlan_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"

- name: Retrieve network details using template ID
  dellemc.openmanage.ome_template_network_vlan_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    template_id: 1234

- name: Retrieve network details using template name
  dellemc.openmanage.ome_template_network_vlan_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    template_name: template1

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

已返回:在 HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "由于发生错误,无法处理该请求。", "MessageArgs": [], "MessageId": "GEN1234", "RelatedProperties": [], "Resolution": "请重试此操作。如果问题仍然存在,请联系您的系统管理员。", "Severity": "严重"}], "code": "Base.1.0.GeneralError", "message": "发生一般性错误。有关更多信息,请参阅 ExtendedInfo。"}}

msg

字符串

模板 VLAN 信息检索的状态。

返回: 总是

示例: "已成功检索模板网络 VLAN 信息。"

vlan_info

列表 / 元素=字典

关于模板网络 VLAN 的信息。

返回: 成功

示例: [{"NicBondingTechnology": "LACP", "NicModel": {"Mezzanine 1A 中的 NIC": {"1": {"NIC 绑定已启用": "true", "端口": 1, "Vlan 已标记": ["32656", "32658"], "Vlan 未标记": "25367"}, "2": {"NIC 绑定已启用": "false", "端口": 2, "Vlan 已标记": ["21474"], "Vlan 未标记": "32656"}}, "Mezzanine 1B 中的 NIC": {"1": {"NIC绑定已启用": "false", "端口": 1, "Vlan 已标记": ["25367", "32656", "32658", "26898"], "Vlan 未标记": "21474"}, "2": {"NIC 绑定已启用": "true", "端口": 2, "Vlan 已标记": [], "Vlan 未标记": "32658"}}}, "TemplateId": 58, "TemplateName": "t2"}]

作者

  • Jagadeesh N V(@jagadeeshnv)