@@ -14,8 +14,6 @@ This module requires the following Python modules to be installed on the target
1414- beautifulsoup4
1515- lxml
1616
17- Installation instructions are available at [ Installation of prerequisites] ( #installation-of-prerequisites )
18-
1917## Execution
2018
2119### Execution Flow
@@ -40,57 +38,77 @@ The module follows a clear logic flow to retrieve the file list from a Maintenan
4038 * The module returns the final list of files as the ` download_basket ` , with each item containing a ` DirectLink ` and a ` Filename ` .
4139
4240### Example
43- Obtain list of SAP Software files
41+ > ** NOTE:** The Python versions in these examples vary by operating system. Always use the version that is compatible with your specific system or managed node.</br >
42+ > To simplify this process, the Ansible Role ` sap_launchpad.sap_software_download ` will install the correct Python version and required modules for you.</br >
43+
44+ Obtain list of SAP Software files using existing System Python.
4445``` yaml
45- - name : Obtain list of SAP Software files
46- community.sap_launchpad.maintenance_planner_files :
47- suser_id : " Enter SAP S-User ID"
48- suser_password : " Enter SAP S-User Password"
49- transaction_name : " Transaction Name or Display ID from Maintenance Planner"
50- register : __module_results
46+ - name : Example play for Ansible Module maintenance_planner_files
47+ hosts : all
48+ tasks :
49+ - name : Obtain list of SAP Software files
50+ community.sap_launchpad.maintenance_planner_files :
51+ suser_id : " Enter SAP S-User ID"
52+ suser_password : " Enter SAP S-User Password"
53+ transaction_name : " Transaction Name or Display ID from Maintenance Planner"
54+ register : __module_results
5155` ` `
5256
53- Obtain list of SAP Software files using Python Virtual Environment ` /tmp/python_venv`
57+ Obtain list of SAP Software files using existing Python Virtual Environment ` /tmp/python_venv`.
5458` ` ` yaml
55- - name: Obtain list of SAP Software files using Python Virtual Environment
56- community.sap_launchpad.maintenance_planner_files:
57- suser_id: "Enter SAP S-User ID"
58- suser_password: "Enter SAP S-User Password"
59- transaction_name: "Transaction Name or Display ID from Maintenance Planner"
60- register: __module_results
61- environment:
62- PATH: "/tmp/python_venv:{{ ansible_env.PATH }}"
63- PYTHONPATH: "/tmp/python_venv/lib/python3.11/site-packages"
64- VIRTUAL_ENV: "/tmp/python_venv"
65- vars:
66- ansible_python_interpreter: "/tmp/python_venv/bin/python3.11 }}"
59+ - name: Example play for Ansible Module maintenance_planner_files
60+ hosts: all
61+ tasks:
62+ - name: Obtain list of SAP Software files using Python Virtual Environment
63+ community.sap_launchpad.maintenance_planner_files:
64+ suser_id: "Enter SAP S-User ID"
65+ suser_password: "Enter SAP S-User Password"
66+ transaction_name: "Transaction Name or Display ID from Maintenance Planner"
67+ register: __module_results
68+ environment:
69+ PATH: "/tmp/python_venv:{{ ansible_env.PATH }}"
70+ PYTHONPATH: "/tmp/python_venv/lib/python3.11/site-packages"
71+ VIRTUAL_ENV: "/tmp/python_venv"
72+ vars:
73+ ansible_python_interpreter: "/tmp/python_venv/bin/python3.11 }}"
6774` ` `
6875
69- # ## Output format
70- # ### msg
71- - _Type:_ `string`<br>
72-
73- The status of execution.
76+ Install prerequisites and obtain list of SAP Software files using existing System Python.</br>
77+ **NOTE:** Python modules are installed as packages to avoid `externally-managed-environment` error.
78+ ` ` ` yaml
79+ ---
80+ - name: Example play for Ansible Module maintenance_planner_files
81+ hosts: all
82+ tasks:
83+ - name: Install Python and Python package manager pip
84+ ansible.builtin.package:
85+ name:
86+ - python311
87+ - python311-pip
88+ state: present
7489
75- # ### download_basket
76- - _Type:_ `list` with elements of type `dictionary`<br>
90+ - name: Install Python module packages
91+ ansible.builtin.package:
92+ name:
93+ - python311-wheel
94+ - python311-urllib3
95+ - python311-requests
96+ - python311-beautifulsoup4
97+ - python311-lxml
98+ state: present
7799
78- A Json list of software download links and filenames.<br>
79- ` ` ` yml
80- - DirectLink: https://softwaredownloads.sap.com/file/0020000001739942021
81- Filename: IMDB_SERVER20_060_0-80002031.SAR
82- - DirectLink: https://softwaredownloads.sap.com/file/0010000001440232021
83- Filename: KD75379.SAR
100+ - name: Obtain list of SAP Software files
101+ community.sap_launchpad.maintenance_planner_files:
102+ suser_id: "Enter SAP S-User ID"
103+ suser_password: "Enter SAP S-User Password"
104+ transaction_name: "Transaction Name or Display ID from Maintenance Planner"
105+ register: __module_results
84106` ` `
85107
86- # # Further Information
87- # ## Installation of prerequisites
88- **All preparation steps are included in role `sap_launchpad.sap_software_download`.**</br>
89-
90- Prerequisite preparation using Python 3.11 Virtual Environment `/tmp/python_venv` (Recommended)
108+ Install prerequisites and obtain list of SAP Software files using existing Python Virtual Environment `/tmp/python_venv`.
91109` ` ` yaml
92110---
93- - name: Example play to install prerequisites for sap_launchpad
111+ - name: Example play for Ansible Module maintenance_planner_files
94112 hosts: all
95113 tasks:
96114 - name: Install Python and Python package manager pip
@@ -100,7 +118,7 @@ Prerequisite preparation using Python 3.11 Virtual Environment `/tmp/python_venv
100118 - python311-pip
101119 state: present
102120
103- - name: Pre-Steps - Install Python modules to Python venv
121+ - name: Install Python modules to Python venv
104122 ansible.builtin.pip:
105123 name:
106124 - wheel
@@ -110,32 +128,37 @@ Prerequisite preparation using Python 3.11 Virtual Environment `/tmp/python_venv
110128 - lxml
111129 virtualenv: "/tmp/python_venv"
112130 virtualenv_command: "python3.11 -m venv"
131+
132+ - name: Obtain list of SAP Software files using Python Virtual Environment
133+ community.sap_launchpad.maintenance_planner_files:
134+ suser_id: "Enter SAP S-User ID"
135+ suser_password: "Enter SAP S-User Password"
136+ transaction_name: "Transaction Name or Display ID from Maintenance Planner"
137+ register: __module_results
138+ environment:
139+ PATH: "/tmp/python_venv:{{ ansible_env.PATH }}"
140+ PYTHONPATH: "/tmp/python_venv/lib/python3.11/site-packages"
141+ VIRTUAL_ENV: "/tmp/python_venv"
142+ vars:
143+ ansible_python_interpreter: "/tmp/python_venv/bin/python3.11 }}"
113144` ` `
114145
115- Prerequisite preparation using Python 3.11 system default</br>
116- ` ` ` yaml
117- ---
118- - name: Example play to install prerequisites for sap_launchpad
119- hosts: all
120- tasks:
121- - name: Install Python and Python package manager pip
122- ansible.builtin.package:
123- name:
124- - python311
125- - python311-pip
126- state: present
146+ # ## Output format
147+ # ### msg
148+ - _Type:_ `string`<br>
127149
128- - name: Install Python module packages
129- ansible.builtin.package:
130- name:
131- - python311-wheel
132- - python311-urllib3
133- - python311-requests
134- - python311-beautifulsoup4
135- - python311-lxml
136- state: present
150+ The status of execution.
151+
152+ # ### download_basket
153+ - _Type:_ `list` with elements of type `dictionary`<br>
154+
155+ A Json list of software download links and filenames.<br>
156+ ` ` ` yml
157+ - DirectLink: https://softwaredownloads.sap.com/file/0020000001739942021
158+ Filename: IMDB_SERVER20_060_0-80002031.SAR
159+ - DirectLink: https://softwaredownloads.sap.com/file/0010000001440232021
160+ Filename: KD75379.SAR
137161` ` `
138- **NOTE:** Python modules are installed as packages to avoid `externally-managed-environment` error.
139162
140163# # License
141164Apache 2.0
0 commit comments