answer to the problem is the two last lines on the ansible code:
- name: Run SAPStopStart.py script
shell: |-
python /opt/osit/sap/bin/SAPStopStart.py -a Check -s "all" --hrep "yes" --hsql "yes"
become: true
become_user: root
register: sap_stop_start_out
ignore_errors: yes
timeout: 300
environment:
TERM: xterm