Skip to content

Commit 4600fe3

Browse files
committed
sap_swpm: Further improvements in the course of the review
Relates to sap-linuxlab#1150. Signed-off-by: Bernd Finger <bfinger@redhat.com>
1 parent 35bec3b commit 4600fe3

6 files changed

Lines changed: 46 additions & 55 deletions

File tree

roles/sap_swpm/tasks/post_install.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919

2020
- name: SAP SWPM Deployment - Finished
2121
ansible.builtin.debug:
22-
msg:
23-
- " SAP SWPM deployment successfully completed "
24-
- " "
25-
- " SAP Product - {{ sap_swpm_product_catalog_id }} "
26-
- " SID - {{ sap_swpm_sid | d('') }} "
27-
- " Primary Instance - {{ sap_swpm_pas_instance_nr | d('') }} "
28-
- " Host - {{ ansible_facts['hostname'] }} "
29-
- " FQDN - {{ ansible_facts['fqdn'] }} "
30-
- " IP - {{ ansible_facts['default_ipv4'].address | d(ansible_facts['all_ipv4_addresses'][0]) }} "
31-
# - " Master Password - {{ sap_swpm_master_password }} "
32-
# - " DDIC 000 Password - {{ sap_swpm_ddic_000_password }} "
22+
msg: |
23+
" SAP SWPM deployment successfully completed "
24+
" "
25+
" SAP Product - {{ sap_swpm_product_catalog_id }} "
26+
" SID - {{ sap_swpm_sid | d('') }} "
27+
" Primary Instance - {{ sap_swpm_pas_instance_nr | d('') }} "
28+
" Host - {{ ansible_facts['hostname'] }} "
29+
" FQDN - {{ ansible_facts['fqdn'] }} "
30+
" IP - {{ ansible_facts['default_ipv4'].address | d(ansible_facts['all_ipv4_addresses'][0]) }} "
31+
# " Master Password - {{ sap_swpm_master_password }} "
32+
# " DDIC 000 Password - {{ sap_swpm_ddic_000_password }} "
3333

3434
# SAP HANA Client will not be installed for any installation with SAP AnyDB
3535
# and will only be installed alongside SAP NWAS PAS or AAS (not NWAS ASCS)

roles/sap_swpm/tasks/post_install/sum_push_to_finish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
- name: Print SUM monitoring and action URLs
1818
ansible.builtin.debug:
19-
msg:
20-
- "Check the following URLs for SAP Software Update Manager (SUM) monitoring or actions:"
21-
- "Note: If these URLs don't work, check the sapinst.log file for the correct URLs."
22-
- "SUM Monitor - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumobserver/{{ sap_swpm_sid | upper }}/monitor/index.html"
23-
- "SUM Admin - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumabap/{{ sap_swpm_sid | upper }}/slui/"
24-
- "SUM Admin Utilities - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumabap/{{ sap_swpm_sid | upper }}/slui_ext/"
19+
msg: |
20+
"Check the following URLs for SAP Software Update Manager (SUM) monitoring or actions:"
21+
"Note: If these URLs don't work, check the sapinst.log file for the correct URLs."
22+
"SUM Monitor - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumobserver/{{ sap_swpm_sid | upper }}/monitor/index.html"
23+
"SUM Admin - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumabap/{{ sap_swpm_sid | upper }}/slui/"
24+
"SUM Admin Utilities - https://{{ ansible_facts['fqdn'] }}:1129/lmsl/sumabap/{{ sap_swpm_sid | upper }}/slui_ext/"
2525
2626
# Check the SUM status via SUMOBSEVER.XML, wait for 60 minutes until we are in BIND_PATCH phase
2727
- name: Checking the status of SUM (BIND_PATCH)

roles/sap_swpm/tasks/pre_install/generate_inifile.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@
5454

5555
- name: SAP SWPM Pre Install - Display these variables
5656
ansible.builtin.debug:
57-
msg:
58-
- "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<"
59-
- "__sap_swpm_fact_software_path: >{{ __sap_swpm_fact_software_path }}<"
60-
- "sap_swpm_sid: >{{ sap_swpm_sid }}<"
61-
- "sap_swpm_fqdn: >{{ sap_swpm_fqdn }}<"
57+
msg: |
58+
"sap_swpm_product_catalog_id: '{{ sap_swpm_product_catalog_id }}'"
59+
"sap_swpm_sid: '{{ sap_swpm_sid }}'"
60+
"sap_swpm_fqdn: '{{ sap_swpm_fqdn }}'"
61+
" "
62+
"The SAP software is taken from directory: '{{ __sap_swpm_fact_software_path }}'"
6263
6364
# We are creating the inifile dynamically in one of the two cases:
6465
# 1 - The tag sap_swpm_generate_inifile is specified
@@ -138,11 +139,12 @@
138139

139140
- name: SAP SWPM Pre Install, create inifile - Display these variables again if 'sap_swpm_inifile_parameters_dict' had been used
140141
ansible.builtin.debug:
141-
msg:
142-
- "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<"
143-
- "__sap_swpm_fact_software_path: >{{ __sap_swpm_fact_software_path }}<"
144-
- "sap_swpm_sid: >{{ sap_swpm_sid }}<"
145-
- "sap_swpm_fqdn: >{{ sap_swpm_fqdn }}<"
142+
msg: |
143+
"sap_swpm_product_catalog_id: '{{ sap_swpm_product_catalog_id }}'"
144+
"sap_swpm_sid: '{{ sap_swpm_sid }}'"
145+
"sap_swpm_fqdn: '{{ sap_swpm_fqdn }}'"
146+
" "
147+
"The SAP software is taken from directory: '{{ __sap_swpm_fact_software_path }}'"
146148
147149
148150
- name: SAP SWPM Pre Install - Display the path name of the inifile

roles/sap_swpm/tasks/pre_install/software/igsexe.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Auto-detection checks:
55
# 1. Check if there is one or more files present.
6-
# NOTE: This is SAR file and it could be extracted to check for 'ansible_architecture',
6+
# NOTE: This is SAR file and it could be extracted to check for ansible_facts['architecture'],
77
# but it is not mandatory and it will be handled by 'sapinst'.
88

99
- name: SAP SWPM Pre Install - Find all IGS files in {{ __sap_swpm_fact_software_path }}
@@ -19,6 +19,6 @@
1919
success_msg: |
2020
SUCCESS: IGS 'igsexe' files were found in '{{ __sap_swpm_fact_software_path }}'.
2121
Files: {{ __sap_swpm_register_igs_exe_files.files | map(attribute='path') | map('basename') | join(', ') }}
22-
They are not validated for compatibility with OS architecture '{{ ansible_architecture }}'.
22+
They are not validated for compatibility with OS architecture '{{ ansible_facts['architecture'] }}'.
2323
fail_msg: |
2424
FAIL: No IGS 'igsexe' files were found in '{{ __sap_swpm_fact_software_path }}'!

roles/sap_swpm/tasks/pre_install/software/swpm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Auto-detection checks:
55
# 1. Extract 'sapinst' executable from SAR file into temporary directory.
6-
# 2. Check against 'ansible_architecture' using 'file' on 'sapinst' and delete temporary directory.
6+
# 2. Check against ansible_facts['architecture'] using 'file' on 'sapinst' and delete temporary directory.
77
# 3. Parse filename info version dictionary.
88
# 4. Select latest based on version.
99
# NOTE: '--version' cannot be used because 'sapinst' executable is not always updated.

roles/sap_swpm/tasks/swpm.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,25 @@
33

44
### Deprecated standard method, can fail to detect process exit (e.g. hang errors with SAP SWPM 2.0 SP11)
55
### 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)
78
### 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)
911
#- name: SAP SWPM - {{ __sap_swpm_fact_installation_header }}
1012
# ansible.builtin.shell: >-
1113
# umask {{ sap_swpm_umask | default('022') }};
1214
# ./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 }}
1618
# register: __sap_swpm_register_sapinst
1719
# args:
1820
# chdir: "{{ __sap_swpm_fact_sapinst_path }}"
1921
# failed_when: __sap_swpm_register_sapinst is failed
2022
# changed_when: "'SAPinst build information' in __sap_swpm_register_sapinst.stdout"
2123
## 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+
#
4025
# Call sapinst synchronously
4126
# Reason for noqa: This command installs software, so it will change things
4227
# - name: SAP SWPM - {{ __sap_swpm_fact_installation_header }} # noqa no-changed-when
@@ -45,8 +30,12 @@
4530
# args:
4631
# chdir: "{{ __sap_swpm_fact_sapinst_path }}"
4732

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+
4836
# 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)
5039
# Reason for noqa: This command installs software, so it will change things
5140
- name: SAP SWPM - {{ __sap_swpm_fact_installation_header }} # noqa no-changed-when
5241
ansible.builtin.shell: |
@@ -58,7 +47,7 @@
5847
poll: 0 # Seconds between polls, use 0 to run Ansible Tasks concurrently
5948
environment: "{{ sap_swpm_env_vars }}"
6049

61-
# Monitor sapinst process and wait for exit
50+
# Monitor the sapinst process and wait for exit
6251
- name: SAP SWPM - Wait for sapinst process to exit, poll every 60 seconds
6352
ansible.builtin.shell: set -o pipefail && ps -ef | awk '/\.\/sapinst /&&!/umask/&&!/ awk /{print}'
6453
register: __sap_swpm_register_pids_sapinst

0 commit comments

Comments
 (0)