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
。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定: dellemc.openmanage.idrac_server_config_profile
。
dellemc.openmanage 2.1.0 中的新增功能
概要
从 iDRAC 导出服务器配置配置文件 (SCP),或从网络共享 (CIFS、NFS、HTTP、HTTPS) 或本地路径导入。
要求
执行此模块的主机需要以下要求。
python >= 3.9.14
参数
参数 |
注释 |
---|---|
包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。 |
|
如果为 如果为 如果为
选项
|
|
此选项适用于 如果为 如果为 选项
|
|
指定输出文件格式。此选项适用于 当command 为 选项
|
|
指定要导出的服务器配置配置文件 (SCP) 的类型。 此选项适用于command 为
选项
|
|
iDRAC IP 地址。 |
|
iDRAC 用户密码。 如果未提供密码,则使用环境变量 示例:export IDRAC_PASSWORD=password |
|
iDRAC 端口。 默认值: |
|
iDRAC 用户名。 如果未提供用户名,则使用环境变量 示例:export IDRAC_USERNAME=username |
|
如果为 如果为 ignore_certificate_warning 仅在share_name 为 HTTPS 类型时才被考虑,并且仅在 iDRAC9 上受支持。 选项
|
|
用于将 xml 或 json 的缓冲区输入导入 iDRAC。 当command 为 此选项适用于command 为 import_buffer 与share_name 互斥。 |
|
此选项适用于command 为 如果为 如果为 如果为 如果为 选项
|
|
是否等待作业完成。 选项
|
|
用于身份验证的代理密码。 仅当share_name类型为HTTP或HTTPS时才考虑proxy_password,并且仅在iDRAC9上支持。 |
|
用于身份验证的代理端口。 当share_name类型为HTTPS或HTTP且proxy_support为 仅当share_name类型为HTTP或HTTPS时才考虑proxy_port,并且仅在iDRAC9上支持。 默认值: |
|
当share_name类型为HTTPS或HTTP且proxy_support为 仅当share_name类型为HTTP或HTTPS时才考虑proxy_server,并且仅在iDRAC9上支持。 |
|
启用或禁用代理。 仅当share_name类型为HTTP或HTTPS时才考虑proxy_support,并且仅在iDRAC9上支持。 选项
|
|
选择HTTP类型代理使用 选择SOCKS4类型代理使用 仅当share_name类型为HTTP或HTTPS时才考虑proxy_type,并且仅在iDRAC9上支持。 选项
|
|
用于身份验证的代理用户名。 仅当share_name类型为HTTP或HTTPS时才考虑proxy_username,并且仅在iDRAC9上支持。 |
|
如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 如果为 当command为 选项
默认值: |
|
服务器配置配置文件(SCP)的名称。 当command为 如果未为此选项指定 如果未为 |
|
网络共享或本地路径。 支持CIFS、NFS、HTTP和HTTPS网络共享类型。 share_name与import_buffer互斥。 当command为 |
|
网络共享用户密码。此选项对于CIFS网络共享是必需的。 |
|
网络共享用户,格式为‘user@domain’或‘domain\\user’(如果用户属于域),否则为‘user’。此选项对于CIFS网络共享是必需的。 |
|
此选项适用于 如果为 如果为 如果为 选项
|
|
以秒为单位的套接字级别超时。 默认值: |
|
如果为 仅在使用自签名证书的个人控制站点上配置 在集合版本 选项
|
|
身份验证令牌。 如果没有提供x_auth_token,则使用环境变量 示例:export IDRAC_X_AUTH_TOKEN=x_auth_token |
备注
注意
此模块需要idrac_user具有“管理员”权限。
从可以直接访问Dell iDRAC的系统运行此模块。
此模块支持
check_mode
。要在基于iDRAC8的服务器上导入服务器配置配置文件(SCP),服务器必须具有iDRAC企业版许可证或更高版本。
对于
import
操作,仅当target为ALL
时才支持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>"
返回值
常见返回值已在此处记录,以下是此模块独有的字段
键 |
描述 |
---|---|
HTTP错误的详细信息。 返回:HTTP错误时 示例: |
|
导入或导出SCP作业的状态。 返回:始终 示例: |
|
来自iDRAC的SCP操作作业和进度详细信息。 返回:成功 示例: |