community.general.idrac_redfish_config 模块 – 使用 Dell Redfish API 通过 iDRAC 管理服务器
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.idrac_redfish_config。
概要
- 用于需要 Redfish OEM 扩展的 Dell iDRAC 操作 
- 在本地构建 Redfish URI 并将其发送到远程 iDRAC 控制器以设置或更新配置属性。 
参数
| 参数 | 注释 | 
|---|---|
| 用于向 iDRAC 进行身份验证的安全令牌。 | |
| iDRAC 的基本 URI。 | |
| 在 iDRAC 上执行的类别。 | |
| 要在 iDRAC 上执行的命令列表。 
 | |
| 要更新的 iDRAC 属性名称和值对字典。 默认值:  | |
| 用于向 iDRAC 进行身份验证的密码。 | |
| 要修改的系统、管理器或机箱的 ID。 | |
| 对 iDRAC 的 HTTP 请求的超时时间(秒)。 默认值:  | |
| 用于向 iDRAC 进行身份验证的用户名。 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:不支持 | 可以在  | |
| 支持:不支持 | 在差异模式下,将返回有关已更改内容(或可能需要在  | 
示例
- name: Enable NTP and set NTP server and Time zone attributes in iDRAC
  community.general.idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    resource_id: iDRAC.Embedded.1
    manager_attributes:
      NTPConfigGroup.1.NTPEnable: "Enabled"
      NTPConfigGroup.1.NTP1: "{{ ntpserver1 }}"
      Time.1.Timezone: "{{ timezone }}"
    baseuri: "{{ baseuri }}"
    username: "{{ username}}"
    password: "{{ password }}"
- name: Enable Syslog and set Syslog servers in iDRAC
  community.general.idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    resource_id: iDRAC.Embedded.1
    manager_attributes:
      SysLog.1.SysLogEnable: "Enabled"
      SysLog.1.Server1: "{{ syslog_server1 }}"
      SysLog.1.Server2: "{{ syslog_server2 }}"
    baseuri: "{{ baseuri }}"
    username: "{{ username}}"
    password: "{{ password }}"
- name: Configure SNMP community string, port, protocol and trap format
  community.general.idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    resource_id: iDRAC.Embedded.1
    manager_attributes:
      SNMP.1.AgentEnable: "Enabled"
      SNMP.1.AgentCommunity: "public_community_string"
      SNMP.1.TrapFormat: "SNMPv1"
      SNMP.1.SNMPProtocol: "All"
      SNMP.1.DiscoveryPort: 161
      SNMP.1.AlertPort: 162
    baseuri: "{{ baseuri }}"
    username: "{{ username}}"
    password: "{{ password }}"
- name: Enable CSIOR
  community.general.idrac_redfish_config:
    category: Manager
    command: SetLifecycleControllerAttributes
    resource_id: iDRAC.Embedded.1
    manager_attributes:
      LCAttributes.1.CollectSystemInventoryOnRestart: "Enabled"
    baseuri: "{{ baseuri }}"
    username: "{{ username}}"
    password: "{{ password }}"
- name: Set Power Supply Redundancy Policy to A/B Grid Redundant
  community.general.idrac_redfish_config:
    category: Manager
    command: SetSystemAttributes
    resource_id: iDRAC.Embedded.1
    manager_attributes:
      ServerPwr.1.PSRedPolicy: "A/B Grid Redundant"
    baseuri: "{{ baseuri }}"
    username: "{{ username}}"
    password: "{{ password }}"
返回值
常见的返回值已在 此处 记录,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 包含操作结果或错误描述的消息 返回值:始终 示例:  | 
