dellemc.openmanage.idrac_network_attributes 模块 – 配置 iDRAC 网络属性

注意

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

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

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

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

dellemc.openmanage 8.4.0 中的新增功能

概要

  • 此模块允许您配置网络接口卡上的端口和分区网络属性。

要求

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

  • python >= 3.9.6

参数

参数

注释

apply_time

字符串 / 必需

network_attributesoem_network_attributes 的应用时间。

这仅适用于 network_attributesoem_network_attributes

Immediate 允许用户立即重启主机并应用更改。job_wait 可用。这适用于 oem_network_attributesjob_wait

OnReset 允许用户在下一次主机服务器重启时应用更改。

AtMaintenanceWindowStart 允许用户在维护窗口开始时应用,如 maintenance_window 中指定。将安排重启作业。

InMaintenanceWindowOnReset 允许在手动重置后但在 maintenance_window 中指定的维护窗口内应用。

这对于 iDRAC8 不适用,该值将被忽略,并且对配置 oem_network_attributes 没有任何影响。

选项

  • "Immediate"

  • "OnReset"

  • "AtMaintenanceWindowStart"

  • "InMaintenanceWindowOnReset"

ca_path

路径

dellemc.openmanage 5.0.0 中新增

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

clear_pending

布尔值

此参数允许您清除所有待处理的 OEM 网络属性更改。

false 不执行任何操作。

true 丢弃对网络属性的任何待处理更改,或者如果作业处于计划状态,则删除该作业。

对于 clear_pending 操作,将忽略 apply_time 值,并且不会产生任何影响。

此操作不支持 iDRAC8。

选项

  • false ← (默认)

  • true

idrac_ip

字符串 / 必需

iDRAC IP 地址。

idrac_password

别名:idrac_pwd

字符串

iDRAC 用户密码。

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

示例:export IDRAC_PASSWORD=password

idrac_port

整数

iDRAC 端口。

默认: 443

idrac_user

字符串

iDRAC 用户名。

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

示例:export IDRAC_USERNAME=username

job_wait

布尔值

提供等待作业完成的选项。

apply_timeoem_network_attributesImmediate 时,此选项适用。

选项

  • false

  • true ← (默认)

job_wait_timeout

整数

job_wait 的最大等待时间(以秒为单位)。仅在此持续时间内跟踪作业。

job_waittrue 时,此选项适用。

默认: 1200

maintenance_window

字典

此选项允许您安排维护窗口。

apply_timeAtMaintenanceWindowStartInMaintenanceWindowOnReset 时,这是必需的。

duration

整数 / 必需

维护窗口的持续时间(以秒为单位)。

start_time

字符串 / 必需

要安排的维护窗口的开始时间。

格式为 YYYY-MM-DDThh:mm:ss<offset>

<offset> 是 iDRAC 中设置的当前时区相对于 UTC 的时间偏移量,格式为:IST 为 +05:30。

network_adapter_id

字符串 / 必需

网络适配器设备的 FQDD,表示能够连接到计算机网络的物理网络适配器。

网络适配器的 FQDD 示例为“NIC.Mezzanine.1A”

network_attributes

字典

网络属性和值的字典。要查看属性列表及其结构,请参见下面的 API https://I(idrac_ip/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/<network_adapter_id>/NetworkDeviceFunctions/ <network_device_function_id>/Settings) 和 https://<idrac_ip>/redfish/v1/Schemas/NetworkDeviceFunction.v1_8_0.json

network_attributesoem_network_attributes 互斥。

network_device_function_id

字符串 / 必需

表示网络适配器公开的逻辑接口的网络适配器设备功能的 FQDD。

网络适配器设备功能的 FQDD 示例为“NIC.Mezzanine.1A-1-1”

oem_network_attributes

字典

这些属性必须是 Dell 集成远程访问控制器属性注册表的一部分。要查看 iDRAC9 及更高版本中属性注册表中的属性列表,请参见 https://I(idrac_ip/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters/<network_adapter_id>/NetworkDeviceFunctions/ <network_device_function_id>/Oem/Dell/DellNetworkAttributes/<network_device_function_id>) 和 https://I(idrac_ip/redfish/v1/Registries/NetworkAttributesRegistry_<network_device_function_id>/ NetworkAttributesRegistry_network_port_id.json)。

对于基于 iDRAC8 的服务器,请从服务器配置配置文件中派生网络属性名称。

oem_network_attributesnetwork_attributes 互斥。

resource_id

字符串

资源的 ID。

如果未提供资源 ID 的值,则模块将从 iDRAC 返回的系统资源列表中选择第一个可用的资源 ID。

timeout

整数

dellemc.openmanage 5.0.0 中新增

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

默认值: 30

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,则使用环境变量 IDRAC_X_AUTH_TOKEN

示例:export IDRAC_X_AUTH_TOKEN=x_auth_token

备注

注意

  • 从此模块能够直接访问 Dell iDRAC 的系统运行此模块。

  • 此模块支持 IPv4 和 IPv6 地址。

  • 此模块支持 check_mode

示例

---
- name: Configure OEM network attributes
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: "NIC.Integrated.1"
    network_device_function_id: "NIC.Integrated.1-1-1"
    apply_time: "Immediate"
    oem_network_attributes:
      BannerMessageTimeout: "4"

- name: Configure OEM network attributes to apply on reset
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    oem_network_attributes:
      BannerMessageTimeout: "4"
    apply_time: OnReset

- name: Configure OEM network attributes to apply at maintainance window
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    oem_network_attributes:
      BannerMessageTimeout: "4"
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 600

- name: Clearing the pending attributes
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    apply_time: "Immediate"
    clear_pending: true

- name: Clearing the OEM pending attributes and apply the OEM network attributes
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    apply_time: "Immediate"
    clear_pending: true
    oem_network_attributes:
      BannerMessageTimeout: "4"

- name: Configure OEM network attributes and wait for the job
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    apply_time: "Immediate"
    oem_network_attributes:
      LnkSpeed: "10MbpsHalf"
      WakeOnLan: "Enabled"
      VLanMode: "Enabled"
    job_wait: true
    job_wait_timeout: 2000

- name: Configure redfish network attributes to update fiber channel on reset
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    apply_time: OnReset
    network_attributes:
      Ethernet:
        VLAN:
          VLANEnable: true

- name: Configure redfish network attributes to apply on reset
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    network_attributes:
      Ethernet:
        VLAN:
          VLANEnable: true
    apply_time: OnReset

- name: Configure redfish network attributes of iscsi to apply at maintainance window start
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    network_attributes:
      iSCSIBoot:
        InitiatorIPAddress: 1.0.0.1
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 600

- name: Configure redfish network attributes to apply at maintainance window on reset
  dellemc.openmanage.idrac_network_attributes:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    network_adapter_id: NIC.Integrated.1
    network_device_function_id: "NIC.Integrated.1-1-1"
    network_attributes:
      Ethernet:
        VLAN:
          VLANEnable: false
          VLANId: 1
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 600

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

返回: HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "Unable to process the request because an error occurred.", "MessageArgs": [], "MessageId": "GEN1234", "RelatedProperties": [], "Resolution": "Retry the operation. If the issue persists, contact your system administrator.", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information."}}

invalid_attributes

字典

无法应用的无效属性字典。

返回: 属性或值无效时

示例: {"IscsiInitiatorIpAddr": "Attribute is not valid.", "IscsiInitiatorSubnet": "Attribute is not valid."}

job_status

字典

返回作业状态的输出。

返回: 始终返回

示例: {"ActualRunningStartTime": null, "ActualRunningStopTime": null, "CompletionTime": null, "Description": "Job Instance", "EndTime": "TIME_NA", "Id": "JID_XXXXXXXXX", "JobState": "Scheduled", "JobType": "NICConfiguration", "Message": "Task successfully scheduled.", "MessageArgs": [], "MessageId": "JCP001", "Name": "Configure: NIC.Integrated.1-1-1", "PercentComplete": 0, "StartTime": "2023-08-07T06:21:24", "TargetSettingsURI": null}

msg

字符串

属性更新操作的状态。

返回: 应用网络属性时

示例: "Successfully updated the network attributes."

作者

  • Abhishek Sinha(@ABHISHEK-SINHA10)