sap-linuxlab / community.sap_libs

Automation for SAP - Collection of Ansible Modules for SAP for low-level activities which are highly reusable
Apache License 2.0
16 stars 7 forks source link

Something went wrong connecting to the SAPCONTROL SOAP API #35

Closed Banane6077 closed 9 months ago

Banane6077 commented 9 months ago

Summary

I am sorry in advance, cuz this might be not a Bug. I don't know.

I wanted to make an simple Playbook which is tryin' to get the Status of the SAP Process but on this particular Server i get following.

On some other Server i get an successful output.

I would appreciate to get some help.

Playbook:

- name: GetProcessList with sysnr
  hosts: all
  become: false

  collections:
    - community.sap_libs

  tasks:
    - name: Execute SAP Control Command
      community.sap_libs.sap_control_exec:
        sysnr: "01"
        function: "GetProcessList"

Issue Type

Bug Report

Component Name

apt

Ansible Version

ansible [core 2.15.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/my_modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/edv/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

community.sap_libs Version

# /home/edv/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
community.sap_libs 1.4.1

# /usr/lib/python3/dist-packages/ansible_collections
Collection         Version
------------------ -------

Configuration

COLOR_CHANGED(/etc/ansible/ansible.cfg) = yellow
COLOR_DEBUG(/etc/ansible/ansible.cfg) = dark gray
COLOR_DEPRECATE(/etc/ansible/ansible.cfg) = purple
COLOR_DIFF_ADD(/etc/ansible/ansible.cfg) = green
COLOR_DIFF_LINES(/etc/ansible/ansible.cfg) = cyan
COLOR_DIFF_REMOVE(/etc/ansible/ansible.cfg) = red
COLOR_ERROR(/etc/ansible/ansible.cfg) = red
COLOR_HIGHLIGHT(/etc/ansible/ansible.cfg) = white
COLOR_OK(/etc/ansible/ansible.cfg) = green
COLOR_SKIP(/etc/ansible/ansible.cfg) = cyan
COLOR_UNREACHABLE(/etc/ansible/ansible.cfg) = red
COLOR_VERBOSE(/etc/ansible/ansible.cfg) = blue
COLOR_WARN(/etc/ansible/ansible.cfg) = bright purple
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_ASK_PASS(/etc/ansible/ansible.cfg) = False
DEFAULT_BECOME(/etc/ansible/ansible.cfg) = True
DEFAULT_BECOME_ASK_PASS(/etc/ansible/ansible.cfg) = True
DEFAULT_BECOME_METHOD(/etc/ansible/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/etc/ansible/ansible.cfg) = edv
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 5
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_LOCAL_TMP(/etc/ansible/ansible.cfg) = /home/edv/.ansible/tmp/ansible-local-209302ppkadpem
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/my_modules']
DEFAULT_MODULE_UTILS_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/my_module_utils']
DEFAULT_POLL_INTERVAL(/etc/ansible/ansible.cfg) = 15
DEFAULT_REMOTE_PORT(/etc/ansible/ansible.cfg) = 22
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 10
DEFAULT_TRANSPORT(/etc/ansible/ansible.cfg) = smart
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False

OS / Environment

Ansible Controller: Ubuntu Server
Target host: SUSE Linux Enterprise Server 15 SP4

Steps to Reproduce

Expected Results

I should get an Response if the process is running or not.

Actual Results

Error:

{
    "changed": false,
    "out": {},
    "error": "",
    "failed": true,
    "msg": "Something went wrong connecting to the SAPCONTROL SOAP API.",
    "invocation": {
        "module_args": {
            "sysnr": "01",
            "function": "GetProcessList",
            "hostname": "localhost",
            "force": false,
            "port": null,
            "username": null,
            "password": null,
            "parameter": null
        }
    }
}

Full Error log file:

TEST2.txt

Code of Conduct

sean-freeman commented 9 months ago

@Banane6077 at a guess without using this Ansible Module, I would not use hostname as localhost given how SAP handles connections and resolves using /etc/hosts, put in the hostname or IP Address and show the result?

rainerleber commented 9 months ago

Hi, the hostname in the module call is missing. Execution from local host would be ok because it utilizes the hostagents soap api. But at the moment the module try to connect to 127.0.0.1

rainerleber commented 9 months ago

- name: GetProcessList with sysnr
  community.sap_libs.sap_control_exec:
    hostname: 192.168.8.15
    sysnr: "01"
    function: GetProcessList
Banane6077 commented 9 months ago

Hello, thanks for your input! I get still the same error:

Unbenannt

rainerleber commented 9 months ago

Could you share your module call again.

Here are a few reasons and maybe solutions:

Maybe a firewall blocks the call? Do you provide the right sysnr? As an alternative provide the port instead.

Banane6077 commented 9 months ago

Hello and thank you for your help.

I figured that not every SAP Server has the Process Number "01" some of them has the number "0" so that was probably it! Sorry for wasting your guys time and asking this but i am complete newbie in Ansible and SAP and tryin' my way into SAP Base Administration.

Thanks anyway!