diff --git a/plugins/modules/sap_facts.sh b/plugins/modules/sap_facts.sh index 8706585..389e345 100755 --- a/plugins/modules/sap_facts.sh +++ b/plugins/modules/sap_facts.sh @@ -286,7 +286,7 @@ function check_sapstartsrv(){ # $3 - NR ## Count the number of sapstartsrv processes - SAPSTARTSRV=$(ps -ef | grep $2 | grep $3 | grep sapstartsrv | wc -l) + SAPSTARTSRV=$(ps -eo exe | grep $2 | grep $3 | grep sapstartsrv | wc -l) if [[ $SAPSTARTSRV = 0 ]]; then ## No sapstartsrv process running - attempt to start diff --git a/roles/sap_control/tasks/functions/restart_sapstartsrv.yml b/roles/sap_control/tasks/functions/restart_sapstartsrv.yml index 8ea6558..73165c1 100644 --- a/roles/sap_control/tasks/functions/restart_sapstartsrv.yml +++ b/roles/sap_control/tasks/functions/restart_sapstartsrv.yml @@ -33,5 +33,5 @@ register: sap_start_sapstartsrv - name: SAPstartsrv - Wait for 10 seconds for sapstartsrv to initialize - ansible.builtin.pause: - seconds: 10 + ansible.builtin.wait_for: + timeout: 10 diff --git a/roles/sap_control/tasks/main.yml b/roles/sap_control/tasks/main.yml index 81a3a68..880eec9 100644 --- a/roles/sap_control/tasks/main.yml +++ b/roles/sap_control/tasks/main.yml @@ -87,16 +87,17 @@ # Get SAP Facts - name: Run sap_facts module to gather SAP facts community.sap_libs.sap_system_facts: - param: "{{ sap_facts_param }}" + # param: "{{ sap_facts_param }}" register: sap_facts_register -- name: Debug facts +- name: Debug result from sap_libs.sap_system_facts ansible.builtin.debug: - msg: "{{ sap_facts_register.sap_facts }}" + msg: "{{ sap_facts_register.ansible_facts.sap }}" + verbosity: 1 - name: pause for 10 Seconds - ansible.builtin.pause: - seconds: 10 + ansible.builtin.wait_for: + timeout: 10 # Debugging stuff - name: Display parameters for runtime diff --git a/roles/sap_control/tasks/prepare.yml b/roles/sap_control/tasks/prepare.yml index 64f8f40..a15777f 100644 --- a/roles/sap_control/tasks/prepare.yml +++ b/roles/sap_control/tasks/prepare.yml @@ -13,9 +13,9 @@ vars: sap_control_execute_sid: "{{ item.SID }}" sap_control_execute_type: "{{ item.Type }}" - sap_control_execute_instance_nr: "{{ item.InstanceNumber }}" + sap_control_execute_instance_nr: "{{ item.NR }}" sap_control_execute_instance_type: "{{ item.InstanceType }}" ansible.builtin.include_tasks: "sapcontrol.yml" - loop: "{{ sap_facts_register.sap_facts }}" + loop: "{{ sap_facts_register.ansible_facts.sap }}" when: - - "item.Type == sap_type" + - "item.InstanceType | lower == sap_type | lower"