When I use the sapcontrol (or even the sap_control_exec) module to stop or start the SAP instance or the sapstartsrv service (Stop, Start, RestartService, ...) I get the error mentioned in the title. Other functions such as GetProcessList or ParameterValue work fine, just stopping, starting, restarting are erroneous.
$ ansible-galaxy collection list community.sap_libs
Collection Version
------------------ -------
community.sap_libs 1.2.0
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
---
- hosts: all
become: true
tasks:
- name: Test SAPControl
community.sap_libs.sapcontrol:
function: RestartService
sysnr: 20
username: <sid>adm
password: <password>
Expected Results
The sapstartsrv service should be restarted.
Actual Results
TASK [Test SAPControl] *****************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'NoneType' object is not iterable
fatal: [<hostname>]: FAILED! => {"changed": false, "module_stderr": "Shared connection to <ip_address> closed.
", "module_stdout": "Traceback (most recent call last):
File \"/home/<ansible_user>/.ansible/tmp/ansible-tmp-1663326779.0265872-1126214-128689101340854/AnsiballZ_sapcontrol.py\", line 107, in <module>
_ansiballz_main()
File \"/home/<ansible_user>/.ansible/tmp/ansible-tmp-1663326779.0265872-1126214-128689101340854/AnsiballZ_sapcontrol.py\", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File \"/home/<ansible_user>/.ansible/tmp/ansible-tmp-1663326779.0265872-1126214-128689101340854/AnsiballZ_sapcontrol.py\", line 48, in invoke_module
run_name='__main__', alter_sys=True)
File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code
exec(code, run_globals)
File \"/tmp/ansible_community.sap_libs.sapcontrol_payload_ccrn_dns/ansible_community.sap_libs.sapcontrol_payload.zip/ansible_collections/community/sap_libs/plugins/modules/sapcontrol.py\", line 389, in <module>
File \"/tmp/ansible_community.sap_libs.sapcontrol_payload_ccrn_dns/ansible_community.sap_libs.sapcontrol_payload.zip/ansible_collections/community/sap_libs/plugins/modules/sapcontrol.py\", line 379, in main
File \"/tmp/ansible_community.sap_libs.sapcontrol_payload_ccrn_dns/ansible_community.sap_libs.sapcontrol_payload.zip/ansible_collections/community/sap_libs/plugins/modules/sapcontrol.py\", line 297, in recursive_dict
File \"/usr/lib/python3.6/site-packages/suds/sudsobject.py\", line 51, in asdict
return dict(items(sobject))
File \"/usr/lib/python3.6/site-packages/suds/sudsobject.py\", line 38, in items
for item in sobject:
TypeError: 'NoneType' object is not iterable
", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Summary
When I use the sapcontrol (or even the sap_control_exec) module to stop or start the SAP instance or the sapstartsrv service (Stop, Start, RestartService, ...) I get the error mentioned in the title. Other functions such as GetProcessList or ParameterValue work fine, just stopping, starting, restarting are erroneous.
Issue Type
Bug Report
Component Name
sapcontrol.py
Ansible Version
community.sap_libs Version
Configuration
OS / Environment
No response
Steps to Reproduce
Expected Results
The sapstartsrv service should be restarted.
Actual Results
Code of Conduct