dellemc.openmanage.ome_application_network_time 模块 – 更新 OpenManage Enterprise 上的网络时间

注意

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

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

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

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

dellemc.openmanage 2.1.0 中的新增功能

概要

  • 此模块允许在 OpenManage Enterprise 上配置网络时间。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

enable_ntp

布尔值 / 必需

启用或禁用网络时间协议 (NTP)。

如果 enable_ntp 为 false,则 NTP 地址将重置为其默认值。

选择

  • false

  • true

hostname

字符串 / 必需

OpenManage Enterprise 或 OpenManage Enterprise Modular IP 地址或主机名。

password

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。

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

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise 或 OpenManage Enterprise Modular HTTPS 端口。

默认: 443

primary_ntp_address

字符串

主 NTP 地址。

enable_ntp 为 true 时,此选项适用。

secondary_ntp_address1

字符串

第一个辅助 NTP 地址。

enable_ntp 为 true 时,此选项适用。

secondary_ntp_address2

字符串

第二个辅助 NTP 地址。

enable_ntp 为 true 时,此选项适用。

system_time

字符串

当前系统中的时间。

仅当 enable_ntp 为 false 时,此选项才适用。

此选项必须以以下格式提供:'yyyy-mm-dd hh:mm:ss'。

time_zone

字符串

要使用的有效时区 ID。

此选项适用于系统时间和 NTP 时间同步。

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

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

默认: 30

username

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 用户名。

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

示例:export OME_USERNAME=username

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

示例:export OME_X_AUTH_TOKEN=x_auth_token

注释

注意

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

  • 此模块支持 check_mode

示例

---
- name: Configure system time
  dellemc.openmanage.ome_application_network_time:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    enable_ntp: false
    system_time: "2020-03-31 21:35:18"
    time_zone: "TZ_ID_11"

- name: Configure NTP server for time synchronization
  dellemc.openmanage.ome_application_network_time:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    enable_ntp: true
    time_zone: "TZ_ID_66"
    primary_ntp_address: "192.168.0.2"
    secondary_ntp_address1: "192.168.0.2"
    secondary_ntp_address2: "192.168.0.4"

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

返回:在 HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "由于缺少 SystemTime 的输入值或输入的值无效,无法完成请求。", "MessageArgs": ["SystemTime"], "MessageId": "CGEN6002", "RelatedProperties": [], "Resolution": "输入有效值并重试操作。", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "发生了一般错误。有关更多信息,请参见ExtendedInfo。"}}

msg

字符串

网络时间配置更改的总体状态。

返回: 始终

示例: "已成功配置网络时间。"

proxy_configuration

字典

已更新的应用程序网络时间配置。

返回: 成功

示例: {"EnableNTP": false, "JobId": null, "PrimaryNTPAddress": null, "SecondaryNTPAddress1": null, "SecondaryNTPAddress2": null, "SystemTime": null, "TimeSource": "本地时钟", "TimeZone": "TZ_ID_1", "TimeZoneIdLinux": null, "TimeZoneIdWindows": null, "UtcTime": null}

作者

  • Sajna Shetty(@Sajna-Shetty)