|
12 | 12 | # - IMDB_LCAPPS2 - HANA 2.0 identifier |
13 | 13 | # - 2089 - Revision 89 (contains SPS level, e.g. SPS08) |
14 | 14 | # - 300 - Patch level 3 |
15 | | - |
| 15 | +# |
| 16 | +# NOTE: IMDB_LCAPPS does share FILE_ID between HANA 1.0 and 2.0 so upgrade search is possible! |
| 17 | +# |
16 | 18 | ### Relationship validation workflow for IMDB_LCAPPS: |
17 | 19 | # 1. Parse file name to extract version details. |
18 | 20 | # 2. Attempt search in dry_run mode if 'sap_software_download_find_alternatives' is true and fail if file is not found. |
|
23 | 25 | # 7. Show summary message and inform about validation result. |
24 | 26 |
|
25 | 27 |
|
| 28 | +# Validate wildcard format if wildcard is present in filename. |
| 29 | +# This is validated inside of module, but we do it here to fail faster and avoid unnecessary API calls. |
| 30 | +- name: SAP Software Download - Relationship Validation - Validate wildcard format in IMDB_LCAPPS filename |
| 31 | + ansible.builtin.fail: |
| 32 | + msg: | |
| 33 | + FAIL: Invalid wildcard format in IMDB_LCAPPS filename. |
| 34 | +
|
| 35 | + Filename: {{ __sap_software_download_fact_hana_component_names['lcapps'] }} |
| 36 | +
|
| 37 | + Wildcard queries must follow specific format: |
| 38 | + Format: "PREFIX*-ID.EXT" where: |
| 39 | + - PREFIX must have at least one character before wildcard |
| 40 | + - Wildcard (*) must be in PREFIX position only |
| 41 | + - Single dash (-) separates prefix and ID |
| 42 | + - ID must be exactly 8 digits |
| 43 | + - Extension must be letters only |
| 44 | +
|
| 45 | + Valid examples: |
| 46 | + - "IMDB_LCAPPS*-20010426.SAR" |
| 47 | + - "IMDB_LCAPPS_2*-20010426.SAR" |
| 48 | +
|
| 49 | + Invalid examples: |
| 50 | + - "*-20010426.SAR" (no prefix - too broad) |
| 51 | + - "IMDB_LCAPPS-*.SAR" (wildcard in ID position) |
| 52 | + - "IMDB_LCAPPS*X-20010426.SAR" (extra characters after wildcard) |
| 53 | + - "IMDB_LCAPPS*-7000.SAR" (ID must be 8 digits, not 4) |
| 54 | + when: |
| 55 | + - "'*' in __sap_software_download_fact_hana_component_names['lcapps']" |
| 56 | + - __sap_software_download_fact_hana_component_names['lcapps'] is not match('^[^-]+\\*-\\d{8}\\.[a-zA-Z]+$') |
| 57 | + |
26 | 58 | # Update existing fact dictionary with component details appending to 'server' details. |
27 | 59 | # '__sap_software_download_fact_hana_lcapps_original' is set for later reuse, when we update this dictionary. |
28 | 60 | - name: SAP Software Download - Relationship Validation - Set fact with parsed IMDB_LCAPPS file version details |
|
55 | 87 | # Defines search type. Updated if alternative or update search is successful. |
56 | 88 | source: exact |
57 | 89 |
|
58 | | -# Validate wildcard format if wildcard is present in filename. |
59 | | -# This is validated inside of module, but we do it here to fail faster and avoid unnecessary API calls. |
60 | | -- name: SAP Software Download - Relationship Validation - Validate wildcard format in IMDB_LCAPPS filename |
61 | | - ansible.builtin.fail: |
62 | | - msg: | |
63 | | - FAIL: Invalid wildcard format in IMDB_LCAPPS filename. |
64 | | -
|
65 | | - Filename: {{ __sap_software_download_fact_hana_component_names['lcapps'] }} |
66 | | -
|
67 | | - Wildcard queries must follow specific format: |
68 | | - Format: "PREFIX*-ID.EXT" where: |
69 | | - - PREFIX must have at least one character before wildcard |
70 | | - - Wildcard (*) must be in PREFIX position only |
71 | | - - Single dash (-) separates prefix and ID |
72 | | - - ID must be exactly 8 digits |
73 | | - - Extension must be letters only |
74 | | -
|
75 | | - Valid examples: |
76 | | - - "IMDB_LCAPPS*-20010426.SAR" |
77 | | - - "IMDB_LCAPPS_2*-20010426.SAR" |
78 | | -
|
79 | | - Invalid examples: |
80 | | - - "*-20010426.SAR" (no prefix - too broad) |
81 | | - - "IMDB_LCAPPS-*.SAR" (wildcard in ID position) |
82 | | - - "IMDB_LCAPPS*X-20010426.SAR" (extra characters after wildcard) |
83 | | - - "IMDB_LCAPPS*-7000.SAR" (ID must be 8 digits, not 4) |
84 | | - when: |
85 | | - - "'*' in __sap_software_download_fact_hana_component_names['lcapps']" |
86 | | - - __sap_software_download_fact_hana_component_names['lcapps'] is not match('^[^-]+\\*-\\d{8}\\.[a-zA-Z]+$') |
87 | | - |
88 | | -# NOTE: IMDB_LCAPPS does share FILE_ID between HANA 1.0 and 2.0 so upgrade search is possible! |
89 | 90 | - name: SAP Software Download - Relationship Validation - Fail if IMDB_LCAPPS is for wrong HANA version |
90 | 91 | ansible.builtin.fail: |
91 | 92 | msg: | |
|
97 | 98 | {{ __sap_software_download_fact_hana_component_names['lcapps'] }} details: |
98 | 99 | Version: {{ __sap_software_download_fact_hana_components['lcapps']['version'] }} |
99 | 100 |
|
100 | | - Please provide correct IMDB_LCAPPS file for the detected IMDB_SERVER version, |
101 | | - or set the variable 'sap_software_download_upgrade_relationships' to 'true' to allow searching for upgrade candidate. |
102 | | - when: |
103 | | - - __sap_software_download_fact_hana_components['server']['version'] |
104 | | - != __sap_software_download_fact_hana_components['lcapps']['version'] |
105 | | - - not sap_software_download_upgrade_relationships | d(false) |
| 101 | + Please provide correct IMDB_LCAPPS file for the detected IMDB_SERVER version. |
| 102 | + {% if '*' in __sap_software_download_fact_hana_component_names['lcapps'] %} |
| 103 | + Wildcard prefixes must contain identifier for HANA version to avoid mismatch. Examples: |
| 104 | + - HANA 1.0: 'IMDB_LCAPPS_1*-{{ __file_id_ext }}', 'IMDB_LCAPPS_122*-{{ __file_id_ext }}' |
| 105 | + - HANA 2.0: 'IMDB_LCAPPS_2*-{{ __file_id_ext }}', 'IMDB_LCAPPS_2089*-{{ __file_id_ext }}' |
| 106 | + {% else %} |
| 107 | + Expected prefixes: |
| 108 | + - HANA 1.0: 'IMDB_LCAPPS_1' |
| 109 | + - HANA 2.0: 'IMDB_LCAPPS_2' |
| 110 | + {% endif %} |
| 111 | + vars: |
| 112 | + __file_id_ext: "{{ __sap_software_download_fact_hana_components['lcapps']['file_id'] ~ '.SAR' }}" |
| 113 | + when: __sap_software_download_fact_hana_components['server']['version'] |
| 114 | + != __sap_software_download_fact_hana_components['lcapps']['version'] |
106 | 115 |
|
107 | 116 |
|
108 | 117 | - name: SAP Software Download - Relationship Validation - Check availability of IMDB_LCAPPS file using dry run |
|
0 commit comments