sap.sap_operations.service module – Manage SAP HANA services

Note

This module is part of the sap.sap_operations collection.

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 sap.sap_operations. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sap.sap_operations.service.

New in sap.sap_operations 1.0.0

Synopsis

  • Start and stop SAP HANA services

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.6

  • suds >= 1.1.2

Parameters

Parameter

Comments

ca_file

string

ca_file use CA certificate to secure the communication. By default system CA store is used.

hostname

string

hostname of the SAP system

instance_number

string / required

instance_number is the instance number to be managed.

password

string

password of the SAP system

secure

string

secure specify if secure communication should be enforced.

By default system CA store is used. User can pass custom CA by ca_file parameter.

Choices:

  • "strict" ← (default)

  • "insecure"

  • "none"

state

string

State of the managed service.

Choices:

  • "started" ← (default)

  • "stopped"

username

string

username of the SAP system

wait

boolean

Wait for the operation to complete before returning.

If set to true, module will wait for service to start/ or stop.

If set to false, module will schedule the right operation and return immediately.

Choices:

  • false

  • true ← (default)

wait_timeout

integer

Wait timeout for the operation to complete before returning.

Default: 600

Examples

- name: Start the service and wait for service to be available using unix socket
  sap.sap_operations.service:
    instance_number: "0"

- name: Start the service and wait for service to be available using username/password
  sap.sap_operations.service:
    username: "npladm"
    password: "secret123!"
    hostname: "sap.system.example.com"

- name: Start the service and do not wait for service to be up and running
  sap.sap_operations.service:
    username: "npladm"
    password: "secret123!"
    hostname: "sap.system.example.com"
    instance_number: "0"
    state: started
    wait: false

- name: Stop the service and wait for termination
  sap.sap_operations.service:
    username: "npladm"
    password: "secret123!"
    hostname: "sap.system.example.com"
    state: stopped

- name: Stop the service and do not wait
  sap.sap_operations.service:
    username: "npladm"
    password: "secret123!"
    hostname: "sap.system.example.com"
    state: stopped
    wait: false

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

instances

dictionary

Instance parameters

Returned: always

dispstatus

string

status of the instance

Returned: success

Sample: "SAPControl-GREEN"

features

string

features of the instance

Returned: success

Sample: "MESSAGESERVER|ENQUE"

hostname

string

hostname where SAP instance is running

Returned: success

Sample: "vhcalnplcs"

httpPort

string

http port of the instance

Returned: success

Sample: "50113"

httpsPort

string

https port of the instance

Returned: success

Sample: "50114"

instanceNr

string

instance number

Returned: success

Sample: "1"

startPriority

string

start priority of the instance

Returned: success

Sample: "1"

Authors

  • Ondra Machacek (@machacekondra)