community.general.sap_task_list_execute – Perform SAP Task list execution

Note

This plugin is part of the community.general collection (version 3.8.1).

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.general.

To use it in a playbook, specify: community.general.sap_task_list_execute.

New in version 3.5.0: of community.general

Synopsis

  • The sap_task_list_execute module depends on pyrfc Python library (version 2.4.0 and upwards). Depending on distribution you are using, you may need to install additional packages to have these available.
  • Tasks in the task list which requires manual activities will be confirmed automatically.
  • This module will use the RFC package STC_TM_API.

Requirements

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

  • pyrfc >= 2.4.0
  • xmltodict

Parameters

Parameter Choices/Defaults Comments
client
string
Default:
"000"
The client number to connect to.
You must quote the value to ensure retaining the leading zeros.
conn_password
string / required
The required password for the SAP system.
conn_username
string / required
The required username for the SAP system.
host
string / required
The required host for the SAP system. Can be either an FQDN or IP Address.
sysnr
string
Default:
"00"
The system number of the SAP system.
You must quote the value to ensure retaining the leading zeros.
task_parameters
list / elements=dictionary
The tasks and the parameters for execution.
If the task list do not need any parameters. This could be empty.
If only specific tasks from the task list should be executed. The tasks even when no parameter is needed must be provided. Alongside with the module parameter task_skip=true.
FIELDNAME
string
The name of the field of the task.
TASKNAME
string / required
The name of the task in the task list.
VALUE
raw
The value which have to be set.
task_settings
list / elements=string
Default:
["BATCH"]
Setting for the execution of the task list. This can be the following as in TCODE SE80 described. Check Mode CHECKRUN, Background Processing Active BATCH (this is the default value), Asynchronous Execution ASYNC, Trace Mode TRACE, Server Name BATCH_TARGET.
task_skip
boolean
    Choices:
  • no
  • yes
If this parameter is true not defined tasks in task_parameters are skipped.
This could be the case when only certain tasks should run from the task list.
task_to_execute
string / required
The task list which will be executed.

Notes

Note

  • Does not support check_mode.

Examples

# Pass in a message
- name: Test task execution
  community.general.sap_task_list_execute:
    conn_username: DDIC
    conn_password: Passwd1234
    host: 10.1.8.10
    sysnr: '01'
    client: '000'
    task_to_execute: SAP_BASIS_SSL_CHECK
    task_settings: batch

- name: Pass in input parameters
  community.general.sap_task_list_execute:
    conn_username: DDIC
    conn_password: Passwd1234
    host: 10.1.8.10
    sysnr: '00'
    client: '000'
    task_to_execute: SAP_BASIS_SSL_CHECK
    task_parameters :
      - { 'TASKNAME': 'CL_STCT_CHECK_SEC_CRYPTO', 'FIELDNAME': 'P_OPT2', 'VALUE': 'X' }
      - TASKNAME: CL_STCT_CHECK_SEC_CRYPTO
        FIELDNAME: P_OPT3
        VALUE: X
    task_settings: batch

# Exported environement variables.
- name: Hint if module will fail with error message like ImportError libsapnwrfc.so...
  community.general.sap_task_list_execute:
    conn_username: DDIC
    conn_password: Passwd1234
    host: 10.1.8.10
    sysnr: '00'
    client: '000'
    task_to_execute: SAP_BASIS_SSL_CHECK
    task_settings: batch
  environment:
    SAPNWRFC_HOME: /usr/local/sap/nwrfcsdk
    LD_LIBRARY_PATH: /usr/local/sap/nwrfcsdk/lib

Return Values

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

Key Returned Description
msg
string
always
A small execution description.

Sample:
Successful
out
list / elements=dictionary
on success
A complete description of the executed tasks. If this is available.

Sample:
['...', {'LOG': {'STCTM_S_LOG': [{'ACTIVITY': 'U_CONFIG', 'ACTIVITY_DESCR': 'Configuration changed', 'DETAILS': None, 'EXEC_ID': '20210728184903.815739', 'FIELD': None, 'ID': 'STC_TASK', 'LOG_MSG_NO': '000000', 'LOG_NO': None, 'MESSAGE': 'For radiobutton group ICM too many options are set; choose only one option', 'MESSAGE_V1': 'ICM', 'MESSAGE_V2': None, 'MESSAGE_V3': None, 'MESSAGE_V4': None, 'NUMBER': '048', 'PARAMETER': None, 'PERIOD': 'M', 'PERIOD_DESCR': 'Maintenance', 'ROW': '0', 'SRC_LINE': '170', 'SRC_OBJECT': 'CL_STCTM_REPORT_UI IF_STCTM_UI_TASK~SET_PARAMETERS', 'SYSTEM': None, 'TIMESTMP': '20210728184903', 'TSTPNM': 'DDIC', 'TYPE': 'E'}, '...']}}]


Authors

  • Rainer Leber (@rainerleber)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/sap_task_list_execute_module.html