Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_swpm: Remove the pids module #786

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions roles/sap_swpm/tasks/swpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,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 @@ -70,16 +54,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
Loading