dellemc.openmanage.idrac_license 模块 – 配置 iDRAC 许可证

注意

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

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

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

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

dellemc.openmanage 8.7.0 中的新增功能

概要

  • 此模块允许在 iDRAC 上导入、导出和删除许可证。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

删除

布尔值

从 iDRAC 删除许可证。

当 *delete* 为 true 时,则需要 *license_id*。

*delete* 与 *export* 和 *import* 互斥。

选择

  • false ←(默认)

  • true

导出

布尔值

从 iDRAC 导出许可证。

当 *export* 为 true 时,需要 *license_id* 和 *share_parameters*。

*export* 与 *delete* 和 *import* 互斥。

选择

  • 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

导入

布尔值

从 iDRAC 导入许可证。

当 *import* 为 true 时,需要 *share_parameters*。

*import* 与 *delete* 和 *export* 互斥。

选择

  • false ←(默认)

  • true

license_id

别名:entitlement_id

字符串

要导入、导出或删除的许可证的授权 ID。

当 *delete* 为 true 或 *export* 为 true 时,需要 *license_id*。

resource_id

字符串

资源的 ID。

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

share_parameters

字典

许可证导入和导出操作所需的参数。

当 *export* 或 *import* 为 true 时,需要 *share_parameters*。

file_name

字符串

用于 *import* 和 *export* 操作的许可证文件名。

当 *import* 为 true 时,需要 *file_name*。

对于 *import* 操作,当 *share_type* 为 local 时,*file_name* 支持的扩展名为“.txt”和“.xml”。对于其他共享类型,支持的扩展名为“.xml”

ignore_certificate_warning

字符串

忽略连接到共享时的证书警告,仅当 *share_type* 为 https 时适用。

on 忽略证书警告。

off 不忽略证书警告。

选择

  • "off" ←(默认)

  • "on"

ip_address

字符串

网络共享的 IP 地址。

share_typenfscifshttphttps 时,ip_address 是必需的。

password

字符串

网络共享的密码。

share_typecifs 时,password 是必需的。

proxy_password

字符串

代理服务器的密码。

share_typehttpshttpsproxy_supportparameters_proxy 时,proxy_password 仅适用。

proxy_port

整数

代理服务器的端口。

share_typehttpshttpsproxy_supportparameters_proxy 时,proxy_port 仅适用。

默认值: 80

proxy_server

字符串

代理服务器的 IP 地址。

proxy_supportparameters_proxy 时,proxy_server 是必需的。

share_typehttpshttpsproxy_supportparameters_proxy 时,proxy_server 仅适用。

proxy_support

字符串

指定是否使用代理。

off 不使用代理设置。

default_proxy 使用默认代理设置。

parameters_proxy 使用指定的代理设置。当 proxy_supportparameters_proxy 时,proxy_server 是必需的。

proxy_support 仅在 share_typehttpshttps 时适用。

选择

  • "off" ←(默认)

  • "default_proxy"

  • "parameters_proxy"

proxy_type

字符串

代理服务器的代理类型。

http 选择 HTTP 代理。

socks 选择 SOCKS 代理。

share_typehttpshttpsproxy_supportparameters_proxy 时,proxy_type 仅适用。

选择

  • "http" ← (默认)

  • "socks"

proxy_username

字符串

代理服务器的用户名。

share_typehttpshttpsproxy_supportparameters_proxy 时,proxy_username 仅适用。

share_name

字符串

许可证文件的网络共享或本地路径。

share_type

字符串

网络共享的共享类型。

local 使用本地路径进行导入导出操作。

nfs 使用 NFS 共享进行导入导出操作。

cifs 使用 CIFS 共享进行导入导出操作。

http 使用 HTTP 共享进行导入导出操作。

https 使用 HTTPS 共享进行导入导出操作。

选择

  • "local" ← (默认)

  • "nfs"

  • "cifs"

  • "http"

  • "https"

username

字符串

网络共享的用户名。

share_typecifs 时,username 是必需的。

workgroup

字符串

网络共享的工作组。

share_typecifs 时,workgroup 仅适用。

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 的系统运行此模块。

  • 此模块仅支持 iDRAC9 及以上版本。

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

  • 此模块不支持 check_mode

  • share_typelocal 进行导入导出操作时,不显示 job_details。

示例

---
- name: Export a license from iDRAC to local
  dellemc.openmanage.idrac_license:
    idrac_ip: "192.168.0.1"
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENSE_123"
    export: true
    share_parameters:
      share_type: "local"
      share_name: "/path/to/share"
      file_name: "license_file"

- name: Export a license from iDRAC to NFS share
  dellemc.openmanage.idrac_license:
    idrac_ip: "192.168.0.1"
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENSE_123"
    export: true
    share_parameters:
      share_type: "nfs"
      share_name: "/path/to/share"
      file_name: "license_file"
      ip_address: "192.168.0.1"

- name: Export a license from iDRAC to CIFS share
  dellemc.openmanage.idrac_license:
    idrac_ip: "192.168.0.1"
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENSE_123"
    export: true
    share_parameters:
      share_type: "cifs"
      share_name: "/path/to/share"
      file_name: "license_file"
      ip_address: "192.168.0.1"
      username: "username"
      password: "password"
      workgroup: "workgroup"

- name: Export a license from iDRAC to HTTP share via proxy
  dellemc.openmanage.idrac_license:
    idrac_ip: "192.168.0.1"
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENSE_123"
    export: true
    share_parameters:
      share_type: "http"
      share_name: "/path/to/share"
      file_name: "license_file"
      ip_address: "192.168.0.1"
      username: "username"
      password: "password"
      proxy_support: "parameters_proxy"
      proxy_type: socks
      proxy_server: "192.168.0.2"
      proxy_port: 1080
      proxy_username: "proxy_username"
      proxy_password: "proxy_password"

- name: Export a license from iDRAC to HTTPS share
  dellemc.openmanage.idrac_license:
    idrac_ip: "192.168.0.1"
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENSE_123"
    export: true
    share_parameters:
      share_type: "https"
      share_name: "/path/to/share"
      file_name: "license_file"
      ip_address: "192.168.0.1"
      username: "username"
      password: "password"
      ignore_certificate_warning: "on"

- name: Import a license to iDRAC from local
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    import: true
    share_parameters:
      file_name: "license_file_name.xml"
      share_type: local
      share_name: "/path/to/share"

- name: Import a license to iDRAC from NFS share
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    import: true
    share_parameters:
      file_name: "license_file_name.xml"
      share_type: nfs
      ip_address: "192.168.0.1"
      share_name: "/path/to/share"

- name: Import a license to iDRAC from CIFS share
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    import: true
    share_parameters:
      file_name: "license_file_name.xml"
      share_type: cifs
      ip_address: "192.168.0.1"
      share_name: "/path/to/share"
      username: "username"
      password: "password"

- name: Import a license to iDRAC from HTTP share
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    import: true
    share_parameters:
      file_name: "license_file_name.xml"
      share_type: http
      ip_address: "192.168.0.1"
      share_name: "/path/to/share"
      username: "username"
      password: "password"

- name: Import a license to iDRAC from HTTPS share via proxy
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    import: true
    share_parameters:
      file_name: "license_file_name.xml"
      share_type: https
      ip_address: "192.168.0.1"
      share_name: "/path/to/share"
      username: "username"
      password: "password"
      proxy_support: "parameters_proxy"
      proxy_server: "192.168.0.2"
      proxy_port: 808
      proxy_username: "proxy_username"
      proxy_password: "proxy_password"

- name: Delete a License from iDRAC
  dellemc.openmanage.idrac_license:
    idrac_ip: 198.162.0.1
    idrac_user: "username"
    idrac_password: "password"
    ca_path: "/path/to/ca_cert.pem"
    license_id: "LICENCE_123"
    delete: true

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

返回:当发生 HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "此请求中包含的身份验证凭据缺失或无效。", "MessageArgs": [], "MessageId": "Base.1.8.AccessDenied", "RelatedProperties": [], "Resolution": "尝试确保 URI 正确,并且服务具有适当的凭据。", "Severity": "Critical"}], "code": "Base.1.8.GeneralError", "message": "发生了一般错误。有关更多信息,请参阅 ExtendedInfo。"}}

job_details

字典

返回作业状态的输出。

返回:用于导入和导出操作

示例: {"ActualRunningStartTime": "2024-01-09T05:16:19", "ActualRunningStopTime": "2024-01-09T05:16:19", "CompletionTime": "2024-01-09T05:16:19", "Description": "作业实例", "EndTime": null, "Id": "JID_XXXXXXXXX", "JobState": "Completed", "JobType": "LicenseExport", "Message": "命令成功。", "MessageArgs": [], "MessageId": "LIC900", "Name": "导出:许可证", "PercentComplete": 100, "StartTime": "2024-01-09T05:16:19", "TargetSettingsURI": null}

msg

字符串

许可证操作的状态。

返回:始终

示例: "已成功导出许可证。"

作者

  • Rajshekar P(@rajshekarp87)