You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/module_software_center_download.md
+85-5Lines changed: 85 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
## Description
4
4
The Ansible Module `software_center_download` automates downloading files from the SAP Software Center.
5
5
- It can find a file using a search query or download it directly using a specific download link and filename.
6
+
- Supports wildcard search to find and download specific versions (oldest/newest) from multiple available versions.
6
7
- If a file is not found via search, it can look for alternative versions.
7
8
- It supports checksum validation to ensure file integrity and avoid re-downloading valid files.
8
9
- The module can also perform a dry run to check for file availability without downloading.
@@ -18,6 +19,39 @@ This module requires the following Python modules to be installed on the target
18
19
19
20
## Execution
20
21
22
+
### Wildcard Search Format
23
+
The module supports wildcard search to find files across multiple versions. This is useful when you want to download the latest (or oldest) version of a software package without knowing the exact version number.
24
+
25
+
**Format:**`PREFIX*-ID.EXT`
26
+
27
+
Where:
28
+
29
+
-`PREFIX`: The software name prefix (e.g., `SAPEXE`, `SAPHOSTAGENT`).
30
+
-`*`: Single wildcard representing the version number.
31
+
-`-`: Dash separator (required).
32
+
-`ID`: File ID number (e.g., `80002630`).
33
+
-`.EXT`: File extension (e.g., `.SAR`, `.EXE`).
34
+
35
+
> **NOTE:** File ID is unique number that represents combination of component and platform version.
36
+
37
+
**Requirements:**
38
+
- The parameter `search_alternatives: true` must be enabled.
39
+
- Only one wildcard (`*`) is allowed per query.
40
+
- File format must include both dash and extension according to pattern above.
41
+
- Use `deduplicate` parameter to select oldest (`first`) or newest (`last`) version.
42
+
43
+
**Examples:**
44
+
-`SWPM20SP2*-80003424.SAR` - Matches all available SWPM20 versions starting with `2` (SWPM20SP23, SWPM20SP24, etc.) for `Linux on x86_64 64bit` (80003424).
45
+
-`SAPEXE_10*-80002630.SAR` - Matches all available SAPEXE_10 versions starting with `10` (SAPEXE_10, SAPEXE_100, SAPEXE_1000, etc.) for `Linux on Power LE 64bit` (80002630).
46
+
-`SAPHOSTAGENT*-80004822.SAR` - Matches all available SAPHOSTAGENT versions for `Linux on x86_64 64bit` (80004822).
47
+
48
+
**Special Files:**
49
+
Some SAP media files don't follow the standard naming pattern and require exact filenames:
50
+
51
+
-`S4CORE107_INST_EXPORT_1.zip`
52
+
-`KD75783.SAR`
53
+
-`19118000000000009032` (SAP Media downloaded with ID instead of Title).
54
+
21
55
### Execution Flow
22
56
The module follows a sophisticated logic flow to determine whether to download, skip, or fail. Here is a simplified breakdown of the decision-making process:
23
57
@@ -88,6 +122,31 @@ Download SAP Software file using download_link and download_filename
88
122
dest: "Enter download path (e.g. /software)"
89
123
```
90
124
125
+
Download latest version of SAP Software using wildcard search
126
+
```yaml
127
+
---
128
+
- name: Example play for Ansible Module software_center_download
129
+
hosts: all
130
+
tasks:
131
+
- name: Download latest SAPEXE version using wildcard
132
+
community.sap_launchpad.software_center_download:
133
+
suser_id: "Enter SAP S-User ID"
134
+
suser_password: "Enter SAP S-User Password"
135
+
search_query: "SAPEXE*-80002630.SAR"
136
+
dest: "Enter download path (e.g. /software)"
137
+
search_alternatives: true
138
+
deduplicate: "last"
139
+
140
+
- name: Download oldest SAPHOSTAGENT version using wildcard
141
+
community.sap_launchpad.software_center_download:
142
+
suser_id: "Enter SAP S-User ID"
143
+
suser_password: "Enter SAP S-User Password"
144
+
search_query: "SAPHOSTAGENT*-80004822.SAR"
145
+
dest: "Enter download path (e.g. /software)"
146
+
search_alternatives: true
147
+
deduplicate: "first"
148
+
```
149
+
91
150
Download list of SAP Software files, but search for alternatives if not found
92
151
```yaml
93
152
---
@@ -230,7 +289,15 @@ The password for the SAP S-User specified in `suser_id`.
230
289
### search_query
231
290
- _Type:_ `string`<br>
232
291
233
-
The SAP software file name to download.
292
+
The SAP software file name to download.<br>
293
+
Supports wildcard format for version matching when `search_alternatives` is enabled.<br>
294
+
295
+
**Wildcard Format:** `PREFIX*-ID.EXT`<br>
296
+
- Only one wildcard (`*`) is allowed per query<br>
297
+
- Example: `SAPEXE*-80002630.SAR`matches all SAPEXE versions<br>
298
+
299
+
**Exact Filename:** Use the complete filename without wildcards for specific files.<br>
300
+
- Example: `SAPCAR_1324-80000936.EXE`
234
301
235
302
### download_link
236
303
- _Type:_ `string`<br>
@@ -252,16 +319,29 @@ The directory where downloaded SAP software files will be stored.
252
319
253
320
### deduplicate
254
321
- _Type:_ `string`<br>
322
+
- _Choices:_ `first`, `last`, `` (empty)<br>
323
+
324
+
Specifies how to handle multiple search results when using wildcard queries.<br>
325
+
Only applies when `search_alternatives` is enabled and multiple versions are found.<br>
255
326
256
-
Specifies how to handle multiple search results for the same filename.<br>
257
-
If multiple files with the same name are found, this setting determines which one to download.<br>
258
-
- `first`: Download the first file found (oldest).<br>
259
-
- `last`: Download the last file found (newest).<br>
327
+
**Options:**<br>
328
+
- `first`: Download the oldest version<br>
329
+
- `last`: Download the newest version<br>
330
+
- `` (empty): If multiple results are found, display all available versions and fail with an error<br>
331
+
332
+
Files are sorted numerically by version number, ensuring correct ordering (e.g., version 7 < 10 < 100 < 1500).<br>
260
333
261
334
### search_alternatives
262
335
- _Type:_ `boolean`<br>
336
+
- _Default:_ `false`<br>
263
337
264
338
Enables searching for alternative files if the requested file is not found.<br>
339
+
**Required** when using wildcard queries in `search_query`.<br>
340
+
341
+
**Requirements:**<br>
342
+
- Only works for files following the format `PREFIX-ID.EXT` (with dash and extension)<br>
343
+
- Special media files without this pattern (e.g., `S4CORE107_INST_EXPORT_1.zip`) must use exact filenames<br>
344
+
- Wildcard searches are not supported for files without dashes or extensions<br>
0 commit comments