community.sap_libs.sap_control_exec 模块 – 用于执行 SAPCONTROL 的 Ansible 模块

注意

此模块是 community.sap_libs 集合(版本 1.4.2)的一部分。

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

要安装它,请使用:ansible-galaxy collection install community.sap_libs

要在剧本中使用它,请指定:community.sap_libs.sap_control_exec

community.sap_libs 1.1.0 中的新增功能

概要

别名:sapcontrol

参数

参数

注释

force

布尔值

强制执行 Stop 函数。

选项

  • false ← (默认)

  • true

function

字符串 / 必需

要执行的函数。

选项

  • "Start"

  • "Stop"

  • "RestartInstance"

  • "Shutdown"

  • "InstanceStart"

  • "GetProcessList"

  • "Bootstrap"

  • "InstanceStop"

  • "StopService"

  • "StartService"

  • "RestartService"

  • "ParameterValue"

  • "GetStartProfile"

  • "GetTraceFile"

  • "GetAlertTree"

  • "GetAlerts"

  • "GetEnvironment"

  • "GetVersionInfo"

  • "GetQueueStatistic"

  • "GetInstanceProperties"

  • "ListDeveloperTraces"

  • "ReadDeveloperTrace"

  • "ListLogFiles"

  • "ReadLogFile"

  • "AnalyseLogFiles"

  • "ConfigureLogFileList"

  • "GetLogFileList"

  • "CreateSnapshot"

  • "ReadSnapshot"

  • "ListSnapshots"

  • "DeleteSnapshots"

  • "GetAccessPointList"

  • "GetProcessParameter"

  • "SetProcessParameter"

  • "SetProcessParameter2"

  • "CheckParameter"

  • "OSExecute"

  • "SendSignal"

  • "GetCallstack"

  • "GetSystemInstanceList"

  • "StartSystem"

  • "StopSystem"

  • "RestartSystem"

  • "GetSystemUpdateList"

  • "UpdateSystem"

  • "UpdateSCSInstance"

  • "CheckUpdateSystem"

  • "AccessCheck"

  • "GetSecNetworkId"

  • "GetNetworkId"

  • "RequestLogonFile"

  • "UpdateSystemPKI"

  • "UpdateInstancePSE"

  • "StorePSE"

  • "DeletePSE"

  • "CheckPSE"

  • "CreatePSECredential"

  • "HACheckConfig"

  • "HACheckFailoverConfig"

  • "HAGetFailoverConfig"

  • "HAFailoverToNode"

  • "HASetMaintenanceMode"

  • "HACheckMaintenanceMode"

  • "ABAPReadSyslog"

  • "ABAPReadRawSyslog"

  • "ABAPGetWPTable"

  • "ABAPGetComponentList"

  • "ABAPCheckRFCDestinations"

  • "ABAPGetSystemWPTable"

  • "J2EEControlProcess"

  • "J2EEControlCluster"

  • "J2EEEnableDbgSession"

  • "J2EEDisableDbgSession"

  • "J2EEGetProcessList"

  • "J2EEGetProcessList2"

  • "J2EEGetThreadList"

  • "J2EEGetThreadList2"

  • "J2EEGetThreadCallStack"

  • "J2EEGetThreadTaskStack"

  • "J2EEGetSessionList"

  • "J2EEGetCacheStatistic"

  • "J2EEGetCacheStatistic2"

  • "J2EEGetApplicationAliasList"

  • "J2EEGetComponentList"

  • "J2EEControlComponents"

  • "J2EEGetWebSessionList"

  • "J2EEGetWebSessionList2"

  • "J2EEGetEJBSessionList"

  • "J2EEGetRemoteObjectList"

  • "J2EEGetVMGCHistory"

  • "J2EEGetVMGCHistory2"

  • "J2EEGetVMHeapInfo"

  • "J2EEGetClusterMsgList"

  • "J2EEGetSharedTableInfo"

  • "ICMGetThreadList"

  • "ICMGetConnectionList"

  • "ICMGetProxyConnectionList"

  • "ICMGetCacheEntries"

  • "WebDispGetServerList"

  • "WebDispGetGroupList"

  • "WebDispGetVirtHostList"

  • "WebDispGetUrlPrefixList"

  • "EnqGetStatistic"

  • "EnqGetLockTable"

  • "EnqRemoveUserLocks"

  • "StartWait"

  • "StopWait"

  • "WaitforStarted"

  • "WaitforStopped"

  • "RestartServiceWait"

  • "WaitforServiceStarted"

  • "CheckHostAgent"

hostname

字符串

连接到 sapstartsrv 的主机名。

可以是 IP 地址、FQDN 或主机名。

默认值: "localhost"

parameter

字符串

传递给函数的参数。

password

字符串

连接到 sapstartsrv 的密码。

port

整数

sapstartsrv 的端口号。

sysnr

字符串

实例的系统编号。

username

字符串

连接到 sapstartsrv 的用户名。

备注

注意

  • 不支持 check_mode

示例

- name: GetProcessList with sysnr
  community.sap_libs.sap_control_exec:
    hostname: 192.168.8.15
    sysnr: "01"
    function: GetProcessList

- name: GetProcessList with custom port
  community.sap_libs.sap_control_exec:
    hostname: 192.168.8.15
    function: GetProcessList
    port: 50113

- name: ParameterValue
  community.sap_libs.sap_control_exec:
    hostname: 192.168.8.15
    sysnr: "01"
    username: hdbadm
    password: test1234#
    function: ParameterValue
    parameter: ztta

返回值

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

描述

msg

字符串

包含函数名的成功消息。

返回:始终

示例: "GetProcessList" 执行成功

输出

列表 / 元素=字典

所需函数的完整输出。

返回:始终

示例: [{"item": [{"description": "MessageServer", "dispstatus": "SAPControl-GREEN", "elapsedtime": "412:30:50", "name": "msg_server", "pid": 70643, "starttime": "2022 03 13 15:22:42", "textstatus": "Running"}, {"description": "EnqueueServer", "dispstatus": "SAPControl-GREEN", "elapsedtime": "412:30:50", "name": "enserver", "pid": 70644, "starttime": "2022 03 13 15:22:42", "textstatus": "Running"}, {"description": "Gateway", "dispstatus": "SAPControl-GREEN", "elapsedtime": "412:30:50", "name": "gwrd", "pid": 70645, "starttime": "2022 03 13 15:22:42", "textstatus": "Running"}]}]

作者

  • Rainer Leber (@RainerLeber)

  • Robert Kraemer (@rkpobe)