dellemc.openmanage.idrac_server_config_profile 模块 – 导出或导入 iDRAC 服务器配置配置文件 (SCP)

注意

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

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

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

要在剧本中使用它,请指定:dellemc.openmanage.idrac_server_config_profile

dellemc.openmanage 2.1.0 中的新增功能

概要

  • 从 iDRAC 导出服务器配置配置文件 (SCP),或从网络共享 (CIFS、NFS、HTTP、HTTPS) 或本地路径导入。

要求

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

  • python >= 3.9.14

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

command

字符串

如果为 import,则模块执行 SCP 导入操作。

如果为 export,则模块执行 SCP 导出操作。

如果为 preview,则模块执行 SCP 预览操作。

import_custom_defaults 允许您导入自定义的 iDRAC 默认设置。

export_custom_defaults 允许您导出自定义的 iDRAC 默认设置。

import_custom_defaultsexport_custom_defaults 仅在固件版本为 7.00.00.00 或更高版本的 iDRAC9 上受支持。

选项

  • "import"

  • "export" ← (默认)

  • "preview"

  • "import_custom_defaults"

  • "export_custom_defaults"

end_host_power_state

字符串

此选项适用于 import 命令。

如果为 On,则主机电源状态为开。

如果为 Off,则主机电源状态为关。

选项

  • "On" ← (默认)

  • "Off"

export_format

字符串

指定输出文件格式。此选项适用于 exportexport_custom_defaults 命令。

commandexport_custom_defaults 时,默认导出文件格式始终为 XML。

选项

  • "JSON"

  • "XML" ← (默认)

export_use

字符串

在 dellemc.openmanage 7.3.0 中添加

指定要导出的服务器配置配置文件 (SCP) 的类型。

commandexport 时,此选项适用。

Default 创建配置的非破坏性快照。

Replace 用另一个服务器替换服务器或将服务器设置恢复到已知的基线。

Clone 将设置从一个服务器克隆到另一个具有相同硬件设置的服务器。除 I/O 标识之外的所有设置都将更新(例如,将重置 RAID)。此导出中的设置在上传到其他系统时将具有破坏性。

选项

  • "Default" ← (默认)

  • "Clone"

  • "Replace"

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

ignore_certificate_warning

字符串

在 dellemc.openmanage 7.3.0 中添加

如果为ignore,则忽略证书警告。

如果为showerror,则显示证书警告。

仅当share_name为HTTPS类型时才考虑ignore_certificate_warning,并且仅在iDRAC9上受支持。

选项

  • "ignore" ← (默认)

  • "showerror"

import_buffer

字符串

在 dellemc.openmanage 7.3.0 中添加

用于将xml或json的缓冲区输入导入到iDRAC。

commandimport_custom_defaults时,仅支持XML文件格式。

commandimportpreviewimport_custom_defaults时,此选项适用。

import_buffershare_name互斥。

include_in_export

字符串

在 dellemc.openmanage 7.3.0 中添加

commandexport 时,此选项适用。

如果为default,则导出默认的服务器配置配置文件。

如果为readonly,则导出具有只读属性的SCP。

如果为passwordhashvalues,则导出具有密码哈希值的SCP。

如果为customtelemetry,则导出具有自定义遥测属性的SCP,仅在iDRAC9中受支持。

选项

  • "default" ← (默认)

  • "readonly"

  • "passwordhashvalues"

  • "customtelemetry"

job_wait

布尔值 / 必需

是否等待作业完成。

选项

  • false

  • true

proxy_password

字符串

在 dellemc.openmanage 7.3.0 中添加

用于身份验证的代理密码。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_password,并且仅在iDRAC9上受支持。

proxy_port

字符串

在 dellemc.openmanage 7.3.0 中添加

用于身份验证的代理端口。

share_name为HTTPS或HTTP类型且proxy_supporttrue时,proxy_port是必需的。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_port,并且仅在iDRAC9上受支持。

默认值: "80"

proxy_server

字符串

在 dellemc.openmanage 7.3.0 中添加

share_name为HTTPS或HTTP类型且proxy_supporttrue时,proxy_server是必需的。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_server,并且仅在iDRAC9上受支持。

proxy_support

布尔值

在 dellemc.openmanage 7.3.0 中添加

启用或禁用代理。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_support,并且仅在iDRAC9上受支持。

选项

  • false ← (默认)

  • true

proxy_type

字符串

在 dellemc.openmanage 7.3.0 中添加

http 选择HTTP类型代理。

socks4 选择SOCKS4类型代理。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_type,并且仅在iDRAC9上受支持。

选项

  • "http" ← (默认)

  • "socks4"

proxy_username

字符串

在 dellemc.openmanage 7.3.0 中添加

用于身份验证的代理用户名。

仅当share_name为HTTP或HTTPS类型时才考虑proxy_username,并且仅在iDRAC9上受支持。

scp_components

别名:target

列表 / 元素=字符串

如果为ALL,此选项从SCP文件中导出或导入所有组件配置。

如果为IDRAC,此选项从SCP文件中导出或导入iDRAC配置。

如果为BIOS,此选项从SCP文件中导出或导入BIOS配置。

如果为NIC,此选项从SCP文件中导出或导入网卡配置。

如果为RAID,此选项从SCP文件中导出或导入RAID配置。

如果为FC,此选项从SCP文件中导出或导入光纤通道配置。

如果为InfiniBand,此选项从SCP文件中导出或导入InfiniBand配置。

如果为SupportAssist,此选项从SCP文件中导出或导入SupportAssist配置。

如果为EventFilters,此选项从SCP文件中导出或导入事件过滤器配置。

如果为System,此选项从SCP文件中导出或导入系统配置。

如果为LifecycleController,此选项从SCP文件中导出或导入SupportAssist配置。

如果为AHCI,此选项从SCP文件中导出或导入事件过滤器配置。

如果为PCIeSSD,此选项从SCP文件中导出或导入PCIeSSD配置。

commandexportimport时,仅在具有6.10.00.00及以上固件的iDRAC9上支持具有多个组件的target

选项

  • "ALL" ← (默认)

  • "IDRAC"

  • "BIOS"

  • "NIC"

  • "RAID"

  • "FC"

  • "InfiniBand"

  • "SupportAssist"

  • "EventFilters"

  • "System"

  • "LifecycleController"

  • "AHCI"

  • "PCIeSSD"

默认值: ["ALL"]

scp_file

字符串

服务器配置配置文件(SCP)的名称。

commandimportimport_custom_defaultsexport_custom_defaults时,仅支持XML文件格式。

如果未为exportexport_custom_defaults指定此选项,则使用默认格式<idrac_ip>_YYmmdd_HHMMSS_scp。

如果未为export提供有效的扩展名文件,则使用export_format

share_name

字符串

网络共享或本地路径。

支持CIFS、NFS、HTTP和HTTPS网络共享类型。

share_nameimport_buffer互斥。

commandimport_custom_defaultsexport_custom_defaults时,仅支持“local”。

share_password

别名:share_pwd

字符串

网络共享用户密码。此选项对于CIFS网络共享是必需的。

share_user

字符串

网络共享用户,格式为‘user@domain’或‘domain\\user’(如果用户是域的一部分),否则为‘user’。此选项对于CIFS网络共享是必需的。

shutdown_type

字符串

此选项适用于 import 命令。

如果为Graceful,则作业将正常关闭操作系统并关闭服务器。

如果为Forced,则强制关闭服务器。

如果为NoReboot,则应用SCP的作业将暂停,直到手动重启服务器。

选项

  • "Graceful" ← (默认)

  • "Forced"

  • "NoReboot"

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

备注

注意

  • 此模块需要idrac_user的“管理员”权限。

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

  • 此模块支持check_mode

  • 要在基于iDRAC8的服务器上导入服务器配置配置文件(SCP),服务器必须具有iDRAC企业版许可证或更高版本。

  • 对于import操作,仅当targetALL时才支持check_mode

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

示例

---
- name: Export SCP with IDRAC components in JSON format to a local path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "/scp_folder"
    scp_components:
      - IDRAC
    scp_file: example_file
    export_format: JSON
    export_use: Clone
    job_wait: true

- name: Import SCP with IDRAC components in JSON format from a local path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "/scp_folder"
    command: import
    scp_components:
      - IDRAC
    scp_file: example_file.json
    shutdown_type: Graceful
    end_host_power_state: "On"
    job_wait: false

- name: Export SCP with BIOS components in XML format to a NFS share path with auto-generated file name
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "192.168.0.2:/share"
    scp_components:
      - BIOS
    export_format: XML
    export_use: Default
    job_wait: true

- name: Import SCP with BIOS components in XML format from a NFS share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "192.168.0.2:/share"
    command: import
    scp_components:
      - BIOS
    scp_file: 192.168.0.1_20210618_162856.xml
    shutdown_type: NoReboot
    end_host_power_state: "Off"
    job_wait: false

- name: Export SCP with RAID components in XML format to a CIFS share path with share user domain name
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "\\\\192.168.0.2\\share"
    share_user: share_username@domain
    share_password: share_password
    scp_file: example_file.xml
    scp_components:
      - RAID
    export_format: XML
    export_use: Default
    job_wait: true

- name: Import SCP with RAID components in XML format from a CIFS share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "\\\\192.168.0.2\\share"
    share_user: share_username
    share_password: share_password
    command: import
    scp_components:
      - RAID
    scp_file: example_file.xml
    shutdown_type: Forced
    end_host_power_state: "On"
    job_wait: true

- name: Export SCP with ALL components in JSON format to a HTTP share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "http://192.168.0.3/share"
    share_user: share_username
    share_password: share_password
    scp_file: example_file.json
    scp_components:
      - ALL
    export_format: JSON
    job_wait: false

- name: Import SCP with ALL components in JSON format from a HTTP share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: import
    share_name: "http://192.168.0.3/share"
    share_user: share_username
    share_password: share_password
    scp_file: example_file.json
    shutdown_type: Graceful
    end_host_power_state: "On"
    job_wait: true

- name: Export SCP with ALL components in XML format to a HTTPS share path without SCP file name
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "https://192.168.0.4/share"
    share_user: share_username
    share_password: share_password
    scp_components:
      - ALL
    export_format: XML
    export_use: Replace
    job_wait: true

- name: Import SCP with ALL components in XML format from a HTTPS share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: import
    share_name: "https://192.168.0.4/share"
    share_user: share_username
    share_password: share_password
    scp_file: 192.168.0.1_20160618_164647.xml
    shutdown_type: Graceful
    end_host_power_state: "On"
    job_wait: false

- name: Preview SCP with IDRAC components in XML format from a CIFS share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "\\\\192.168.0.2\\share"
    share_user: share_username
    share_password: share_password
    command: preview
    scp_components:
      - ALL
    scp_file: example_file.xml
    job_wait: true

- name: Preview SCP with IDRAC components in JSON format from a NFS share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "192.168.0.2:/share"
    command: preview
    scp_components:
      - IDRAC
    scp_file: example_file.xml
    job_wait: true

- name: Preview SCP with IDRAC components in XML format from a HTTP share path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "http://192.168.0.1/http-share"
    share_user: share_username
    share_password: share_password
    command: preview
    scp_components:
      - ALL
    scp_file: example_file.xml
    job_wait: true

- name: Preview SCP with IDRAC components in XML format from a local path
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    share_name: "/scp_folder"
    command: preview
    scp_components:
      - IDRAC
    scp_file: example_file.json
    job_wait: false

- name: Import SCP with IDRAC components in XML format from the XML content.
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: import
    scp_components:
      - IDRAC
    job_wait: true
    import_buffer: "<SystemConfiguration><Component FQDD='iDRAC.Embedded.1'><Attribute Name='IPMILan.1#Enable'>
      Disabled</Attribute></Component></SystemConfiguration>"

- name: Export SCP with ALL components in XML format using HTTP proxy.
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    scp_components:
      - ALL
    share_name: "http://192.168.0.1/http-share"
    proxy_support: true
    proxy_server: 192.168.0.5
    proxy_port: 8080
    proxy_username: proxy_username
    proxy_password: proxy_password
    proxy_type: http
    include_in_export: passwordhashvalues
    job_wait: true

- name: Import SCP with IDRAC and BIOS components in XML format using SOCKS4 proxy
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: import
    scp_components:
      - IDRAC
      - BIOS
    share_name: "https://192.168.0.1/http-share"
    proxy_support: true
    proxy_server: 192.168.0.6
    proxy_port: 8080
    proxy_type: socks4
    scp_file: filename.xml
    job_wait: true

- name: Import SCP with IDRAC components in JSON format from the JSON content.
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "{{ idrac_ip }}"
    idrac_user: "{{ idrac_user }}"
    idrac_password: "{{ idrac_password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: import
    scp_components:
      - IDRAC
    job_wait: true
    import_buffer: "{\"SystemConfiguration\": {\"Components\": [{\"FQDD\": \"iDRAC.Embedded.1\",\"Attributes\":
      [{\"Name\": \"SNMP.1#AgentCommunity\",\"Value\": \"public1\"}]}]}}"

- name: Export custom default
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    job_wait: true
    share_name: "/scp_folder"
    command: export_custom_defaults
    scp_file: example_file

- name: Import custom default
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    job_wait: true
    share_name: "/scp_folder"
    command: import_custom_defaults
    scp_file: example_file.xml

- name: Import custom default using buffer
  dellemc.openmanage.idrac_server_config_profile:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    job_wait: true
    command: import_custom_defaults
    import_buffer: "<SystemConfiguration><Component FQDD='iDRAC.Embedded.1'><Attribute Name='IPMILan.1#Enable'>Disabled</Attribute>
                  </Component></SystemConfiguration>"

返回值

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

描述

error_info

字典

HTTP错误的详细信息。

返回: HTTP错误时

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

msg

字符串

导入或导出 SCP 作业的状态。

返回值: 始终

示例: "已成功导入服务器配置配置文件"

scp_status

字典

来自 iDRAC 的 SCP 操作作业和进度详细信息。

返回值: 成功

示例: {"Id": "JID_XXXXXXXXX", "JobState": "已完成", "JobType": "ImportConfiguration", "Message": "已成功导入并应用服务器配置配置文件。", "MessageArgs": [], "MessageId": "XXX123", "Name": "导入配置", "PercentComplete": 100, "StartTime": "TIME_NOW", "Status": "成功", "TargetSettingsURI": null, "retval": true}

作者

  • Jagadeesh N V(@jagadeeshnv)

  • Felix Stephen (@felixs88)

  • Jennifer John (@Jennifer-John)

  • Shivam Sharma (@ShivamSh3)

  • Lovepreet Singh (@singh-lovepreet1)