Skip to content

Commit

Permalink
Merge pull request #786 from berndfinger/issue-719-after-v141
Browse files Browse the repository at this point in the history
sap_swpm: Remove the pids module
  • Loading branch information
berndfinger authored Jul 5, 2024
2 parents eb43711 + 58b2974 commit c8762a9
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions roles/sap_swpm/tasks/swpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,9 @@

### Async method

# Required for Ansible Module pids
- name: Install Python devel, Python pip and gcc to system Python
ansible.builtin.package:
name:
- python3-devel
- python3-pip
- gcc
state: present

# Required for Ansible Module pids
- name: Install Python dependency psutil to system Python
ansible.builtin.pip:
name:
- psutil
# executable: pip3.6

- name: Set fact for the sapinst command line
ansible.builtin.set_fact:
__sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | default('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }}
__sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }}
{{ sap_swpm_swpm_command_product_id }}
{{ sap_swpm_swpm_command_extra_args }}"
tags: sap_swpm_sapinst_commandline
Expand Down Expand Up @@ -71,16 +55,14 @@
async: 86400 # Seconds for maximum runtime, set to 24 hours
poll: 0 # Seconds between polls, use 0 to run Ansible Tasks concurrently

# Monitor sapinst process (i.e. ps aux | grep sapinst) and wait for exit
# Monitor sapinst process and wait for exit
- name: SAP SWPM - Wait for sapinst process to exit, poll every 60 seconds
community.general.pids:
name: sapinst
# shell: ps -ef | awk '/sapinst/&&!/awk/&&!/ansible/{print}'
register: pids_sapinst
until: "pids_sapinst.pids | length == 0"
# until: "pids_sapinst.stdout | length == 0"
ansible.builtin.shell: set -o pipefail && ps -ef | awk '/\.\/sapinst /&&!/umask/&&!/ awk /{print}'
register: __sap_swpm_register_pids_sapinst
until: "__sap_swpm_register_pids_sapinst.stdout | length == 0"
retries: 1440
delay: 60
changed_when: false

- name: SAP SWPM - Verify if sapinst process finished successfully
ansible.builtin.async_status:
Expand Down

0 comments on commit c8762a9

Please sign in to comment.