vmware.vmware_rest.appliance_vmon_service_info 模块 – 返回服务的运行状态。

注意

此模块是 vmware.vmware_rest 集合 (版本 4.3.0) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install vmware.vmware_rest。您需要其他要求才能使用此模块,请参阅 要求 了解更多详情。

要在 playbook 中使用它,请指定:vmware.vmware_rest.appliance_vmon_service_info

vmware.vmware_rest 2.0.0 中的新增功能

概要

  • 返回服务的运行状态。

要求

以下是执行此模块的主机所需的条件。

  • vSphere 7.0.3 或更高版本

  • python >= 3.6

  • aiohttp

参数

参数

注释

service

字符串

要查询其状态的服务标识符。

此参数必须是 vmware.vmware_rest.appliance_vmon_service 返回的资源 ID。 state=[‘get’] 时必填

session_timeout

浮点数

vmware.vmware_rest 2.1.0 中新增

客户端会话的超时设置。

整个操作(包括连接建立、请求发送和响应)的最大秒数。

默认值为 300 秒。

vcenter_hostname

字符串 / 必填

vSphere vCenter 的主机名或 IP 地址

如果任务中未指定此值,则将使用环境变量 VMWARE_HOST 的值。

vcenter_password

字符串 / 必填

vSphere vCenter 密码

如果任务中未指定此值,则将使用环境变量 VMWARE_PASSWORD 的值。

vcenter_rest_log_file

字符串

您可以使用此可选参数设置日志文件的位置。

此文件将用于记录 HTTP REST 交互。

该文件将存储在运行模块的主机上。

如果任务中未指定此值,则将使用

环境变量 VMWARE_REST_LOG_FILE 的值。

vcenter_username

字符串 / 必填

vSphere vCenter 用户名

如果任务中未指定此值,则将使用环境变量 VMWARE_USER 的值。

vcenter_validate_certs

布尔值

允许在 SSL 证书无效时连接。当证书不受信任时,将其设置为 false

如果任务中未指定此值,则将使用环境变量 VMWARE_VALIDATE_CERTS 的值。

选项

  • false

  • true ← (默认)

备注

注意

  • 在 vSphere 7.0.3 上测试

示例

- name: Get information about a VMON service
  vmware.vmware_rest.appliance_vmon_service_info:
    service: vpxd
  register: result

返回值

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

描述

列表 / 元素=字符串

获取有关 VMON 服务的信息

返回:成功时

Sample: [{"key": "analytics", "value": {"description_key": "cis.analytics.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.analytics.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "applmgmt", "value": {"description_key": "cis.applmgmt.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.applmgmt.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "certificateauthority", "value": {"description_key": "cis.certificateauthority.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "certificateathority.health.statuscode"}], "name_key": "cis.certificateauthority.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "certificatemanagement", "value": {"description_key": "cis.certificatemanagement.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "certificatemanagement.health.statuscode"}], "name_key": "cis.certificatemanagement.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "cis-license", "value": {"description_key": "cis.cis-license.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "The License Service is operational.", "id": "cis.license.health.ok"}], "name_key": "cis.cis-license.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "content-library", "value": {"description_key": "cis.content-library.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "Database server connection is GREEN.", "id": "com.vmware.vdcs.vsphere-cs-lib.db_health_green"}], "name_key": "cis.content-library.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "eam", "value": {"description_key": "cis.eam.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "", "id": "cis.eam.statusOK"}], "name_key": "cis.eam.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "envoy", "value": {"description_key": "cis.envoy.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.envoy.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "hvc", "value": {"description_key": "cis.hvc.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "hvc.health.statuscode"}], "name_key": "cis.hvc.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "imagebuilder", "value": {"description_key": "cis.imagebuilder.ServiceDescription", "name_key": "cis.imagebuilder.ServiceName", "startup_type": "MANUAL", "state": "STOPPED"}}, {"key": "infraprofile", "value": {"description_key": "cis.infraprofile.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "infraprofile.health.statuscode"}], "name_key": "cis.infraprofile.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "lookupsvc", "value": {"description_key": "cis.lookupsvc.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.lookupsvc.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "netdumper", "value": {"description_key": "cis.netdumper.ServiceDescription", "name_key": "cis.netdumper.ServiceName", "startup_type": "MANUAL", "state": "STOPPED"}}, {"key": "observability-vapi", "value": {"description_key": "cis.observability-vapi.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "observability.health.statuscode"}], "name_key": "cis.observability-vapi.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "perfcharts", "value": {"description_key": "cis.perfcharts.ServiceDescription", "health": "HEALTHY_WITH_WARNINGS", "health_messages": [{"args": [], "default_message": "health.statsReoptInitalizer.illegalStateEx", "id": "health.statsReoptInitalizer.illegalStateEx"}], "name_key": "cis.perfcharts.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "pschealth", "value": {"description_key": "cis.pschealth.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.pschealth.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "rbd", "value": {"description_key": "cis.rbd.ServiceDescription", "name_key": "cis.rbd.ServiceName", "startup_type": "MANUAL", "state": "STOPPED"}}, {"key": "rhttpproxy", "value": {"description_key": "cis.rhttpproxy.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.rhttpproxy.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "sca", "value": {"description_key": "cis.sca.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.sca.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "sps", "value": {"description_key": "cis.sps.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.sps.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "statsmonitor", "value": {"description_key": "cis.statsmonitor.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "Appliance monitoring service is healthy.", "id": "com.vmware.applmgmt.mon.health.healthy"}], "name_key": "cis.statsmonitor.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "sts", "value": {"description_key": "cis.sts.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.sts.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "topologysvc", "value": {"description_key": "cis.topologysvc.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "topologysvc.health.statuscode"}], "name_key": "cis.topologysvc.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "trustmanagement", "value": {"description_key": "cis.trustmanagement.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["GREEN"], "default_message": "Health is GREEN", "id": "trustmanagement.health.statuscode"}], "name_key": "cis.trustmanagement.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "updatemgr", "value": {"description_key": "cis.updatemgr.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.updatemgr.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vapi-endpoint", "value": {"description_key": "cis.vapi-endpoint.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["2022-11-23T20:10:44UTC", "2022-11-23T20:10:46UTC"], "default_message": "Configuration health status is created between 2022-11-23T20:10:44UTC and 2022-11-23T20:10:46UTC.", "id": "com.vmware.vapi.endpoint.healthStatusProducedTimes"}], "name_key": "cis.vapi-endpoint.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vcha", "value": {"description_key": "cis.vcha.ServiceDescription", "name_key": "cis.vcha.ServiceName", "startup_type": "DISABLED", "state": "STOPPED"}}, {"key": "vlcm", "value": {"description_key": "cis.vlcm.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.vlcm.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vmcam", "value": {"description_key": "cis.vmcam.ServiceDescription", "name_key": "cis.vmcam.ServiceName", "startup_type": "MANUAL", "state": "STOPPED"}}, {"key": "vmonapi", "value": {"description_key": "cis.vmonapi.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.vmonapi.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vmware-postgres-archiver", "value": {"description_key": "cis.vmware-postgres-archiver.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "VMware Archiver service is healthy.", "id": "cis.vmware-postgres-archiver.health.healthy"}], "name_key": "cis.vmware-postgres-archiver.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vmware-vpostgres", "value": {"description_key": "cis.vmware-vpostgres.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "Service vmware-vpostgres is healthy.", "id": "cis.vmware-vpostgres.health.healthy"}], "name_key": "cis.vmware-vpostgres.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vpxd", "value": {"description_key": "cis.vpxd.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": ["vCenter Server", "GREEN"], "default_message": "{0} health is {1}", "id": "vc.health.statuscode"}, {"args": ["VirtualCenter Database", "GREEN"], "default_message": "{0} health is {1}", "id": "vc.health.statuscode"}], "name_key": "cis.vpxd.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vpxd-svcs", "value": {"description_key": "cis.vpxd-svcs.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "Tagging service is in a healthy state", "id": "cis.tagging.health.status"}], "name_key": "cis.vpxd-svcs.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vsan-health", "value": {"description_key": "cis.vsan-health.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.vsan-health.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vsm", "value": {"description_key": "cis.vsm.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.vsm.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vsphere-ui", "value": {"description_key": "cis.vsphere-ui.ServiceDescription", "name_key": "cis.vsphere-ui.ServiceName", "startup_type": "AUTOMATIC", "state": "STOPPED"}}, {"key": "vstats", "value": {"description_key": "cis.vstats.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.vstats.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "vtsdb", "value": {"description_key": "cis.vtsdb.ServiceDescription", "health": "HEALTHY", "health_messages": [{"args": [], "default_message": "Service vtsdb is healthy.", "id": "cis.vtsdb.health.healthy"}], "name_key": "cis.vtsdb.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}, {"key": "wcp", "value": {"description_key": "cis.wcp.ServiceDescription", "health": "HEALTHY", "health_messages": [], "name_key": "cis.wcp.ServiceName", "startup_type": "AUTOMATIC", "state": "STARTED"}}]

作者

  • Ansible 云团队 (@ansible-collections)