|
3 | 3 |
|
4 | 4 | ### Deprecated standard method, can fail to detect process exit (e.g. hang errors with SAP SWPM 2.0 SP11) |
5 | 5 | ### Detect changed when using 'SAPinst build information' from beginning of stdout |
6 | | -### Or detect changed when using instslana.xml at end of stdout (this is the Process XML file aka. SAPInst Software Logistics Toolset Analytics XML file, which records the installation information) |
| 6 | +### Or detect changed when using instslana.xml at end of stdout (this is the Process XML file aka. |
| 7 | +### SAPInst Software Logistics Toolset Analytics XML file, which records the installation information) |
7 | 8 | ### Execute SAP SWPM, instead of command module use the shell module to allow use of umask according to SAP SWPM recommendations |
8 | | -### Use of umask will enforce permissions 755 in /usr/sap etc (thereby resolving any shared NFS mount points initially attached with permissions 777) |
| 9 | +### Use of umask will enforce permissions 755 in /usr/sap etc (thereby resolving any shared NFS mount points |
| 10 | +### initially attached with permissions 777) |
9 | 11 | #- name: SAP SWPM - {{ __sap_swpm_fact_installation_header }} |
10 | 12 | # ansible.builtin.shell: >- |
11 | 13 | # umask {{ sap_swpm_umask | default('022') }}; |
12 | 14 | # ./sapinst \ |
13 | | -# {{ sap_swpm_command_inifile }} \ |
14 | | -# {{ sap_swpm_command_product_id }} \ |
15 | | -# {{ sap_swpm_command_extra_args }} |
| 15 | +# {{ __sap_swpm_fact_command_inifile }} \ |
| 16 | +# {{ __sap_swpm_fact_command_product_id }} \ |
| 17 | +# {{ __sap_swpm_fact_command_extra_args }} |
16 | 18 | # register: __sap_swpm_register_sapinst |
17 | 19 | # args: |
18 | 20 | # chdir: "{{ __sap_swpm_fact_sapinst_path }}" |
19 | 21 | # failed_when: __sap_swpm_register_sapinst is failed |
20 | 22 | # changed_when: "'SAPinst build information' in __sap_swpm_register_sapinst.stdout" |
21 | 23 | ## changed_when: "'instslana' in __sap_swpm_register_sapinst.stdout" |
22 | | - |
23 | | - |
24 | | -### Async method |
25 | | - |
26 | | -# now in file pre_install.yml: |
27 | | -#- name: Set fact for the sapinst command line |
28 | | -# ansible.builtin.set_fact: |
29 | | -# __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_command_inifile }} |
30 | | -# {{ sap_swpm_command_product_id }} |
31 | | -# {{ sap_swpm_command_extra_args }}" |
32 | | -# tags: sap_swpm_sapinst_commandline |
33 | | - |
34 | | -# now in file pre_install.yml: |
35 | | -#- name: Display the sapinst command line |
36 | | -# ansible.builtin.debug: |
37 | | -# msg: "SAP SWPM install command: '{{ __sap_swpm_sapinst_command }}'" |
38 | | -# tags: sap_swpm_sapinst_commandline |
39 | | - |
| 24 | +# |
40 | 25 | # Call sapinst synchronously |
41 | 26 | # Reason for noqa: This command installs software, so it will change things |
42 | 27 | # - name: SAP SWPM - {{ __sap_swpm_fact_installation_header }} # noqa no-changed-when |
|
45 | 30 | # args: |
46 | 31 | # chdir: "{{ __sap_swpm_fact_sapinst_path }}" |
47 | 32 |
|
| 33 | +### Async method |
| 34 | +# Note: The sapinst command is being assembled in file pre_install.yml, which is called from main.yml right before calling swpm.yml. |
| 35 | + |
48 | 36 | # Execute SAP SWPM, instead of command module use the shell module to allow use of umask according to SAP SWPM recommendations |
49 | | -# Use of umask will enforce permissions 755 in /usr/sap etc (thereby resolving any shared NFS mount points initially attached with permissions 777) |
| 37 | +# Use of umask will enforce permissions 755 in /usr/sap etc (thereby resolving any shared NFS mount points |
| 38 | +# initially attached with permissions 777) |
50 | 39 | # Reason for noqa: This command installs software, so it will change things |
51 | 40 | - name: SAP SWPM - {{ __sap_swpm_fact_installation_header }} # noqa no-changed-when |
52 | 41 | ansible.builtin.shell: | |
|
58 | 47 | poll: 0 # Seconds between polls, use 0 to run Ansible Tasks concurrently |
59 | 48 | environment: "{{ sap_swpm_env_vars }}" |
60 | 49 |
|
61 | | -# Monitor sapinst process and wait for exit |
| 50 | +# Monitor the sapinst process and wait for exit |
62 | 51 | - name: SAP SWPM - Wait for sapinst process to exit, poll every 60 seconds |
63 | 52 | ansible.builtin.shell: set -o pipefail && ps -ef | awk '/\.\/sapinst /&&!/umask/&&!/ awk /{print}' |
64 | 53 | register: __sap_swpm_register_pids_sapinst |
|
0 commit comments