Skip to content

Conversation

rainerleber
Copy link
Collaborator

This pull request includes several changes to improve the SAP control tasks and fact gathering in the sap_facts.sh, restart_sapstartsrv.yml, main.yml, and prepare.yml files. The most important changes include updating commands for better process checking, replacing pauses with more appropriate wait mechanisms, and refining variable usage.

Improvements to process checking and control tasks:

Enhancements to task execution and waiting mechanisms:

Refinements to variable usage:

crweller and others added 6 commits August 7, 2024 15:40
The output of "ps -ef" not also includes the command but also the
process age and process arguments. Both can have digits in its string
which may interfere when grepping for an instance number like 00 or 01.

To fix this, let ps print only the executable with its path.

Example: ps with default output - 2 lines match where only 1st line should match
/usr/sap/A22/D01/exe/sapstartsrv pf=/usr/sap/A22/SYS/profile/A22_D01_sapa22u01 -D -u a22adm
/usr/sap/A22/ASCS02/exe/sapstartsrv pf=/usr/sap/A22/SYS/profile/A22_ASCS02_sapa22u01 -D -u a22adm

Example: ps with custom layout, only one line matches as expected
/usr/sap/A22/D01/exe/sapstartsrv
This fixes an issue when running with strategy free:
> ERROR! The 'ansible.builtin.pause' module bypasses the host loop, which
> is currently not supported in the free strategy and would instead
> execute for every host in the inventory list.

Furthermore, the documentation for ansible.builtin.pause states:
To pause/wait/sleep per host, use the ansible.builtin.wait_for module.

See https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pause_module.html
sap_facts.sh - ps print only executable with path
Replace ansible.builtin.pause with ansible.builtin.wait_for


-- merged because all reviewers approved
@rainerleber rainerleber merged commit 1b6737b into main Jan 27, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants