community.sap_libs.sap_control_exec module – Ansible Module to execute SAPCONTROL
Note
This module is part of the community.sap_libs collection (version 1.6.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.sap_libs.
To use it in a playbook, specify: community.sap_libs.sap_control_exec.
New in community.sap_libs 1.1.0
Synopsis
Provides support for sapstartsrv formaly known as sapcontrol
A complete information of all functions and the parameters can be found here https://www.sap.com/documents/2016/09/0a40e60d-8b7c-0010-82c7-eda71af511fa.html
When hostname is ‘localhost’, sysnr is set and no username/password are provided, the module will attempt to use local Unix socket authentication (which works with ‘become’ privilege escalation).
Aliases: sapcontrol
Parameters
Parameter |
Comments |
|---|---|
Forces the execution of the function Choices:
|
|
The function to execute. Choices:
|
|
The hostname to connect to the sapstartsrv. Could be an IP address, FQDN or hostname. Default: |
|
The parameter to pass to the function. |
|
The password to connect to the sapstartsrv. |
|
The port number of the sapstartsrv. If provided, the module will use always use http connection instead of local socket. |
|
The system number of the instance. |
|
The username to connect to the sapstartsrv. |
Notes
Note
Does not support
check_mode.
Examples
- 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 with authentication
community.sap_libs.sap_control_exec:
hostname: 192.168.8.15
sysnr: "01"
username: hdbadm
password: test1234
function: ParameterValue
parameter: ztta
- name: GetVersionInfo using local Unix socket (requires become)
community.sap_libs.sap_control_exec:
sysnr: "00"
function: GetVersionInfo
become: true
- name: GetProcessList using local Unix socket as SAP admin user
community.sap_libs.sap_control_exec:
sysnr: "00"
function: GetProcessList
become: true
become_user: "{{ sap_sid | lower }}adm"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Success-message with functionname. Returned: always Sample: |
|
The full output of the required function. Returned: always Sample: |