sap-linuxlab / community.sap_launchpad Goto Github PK
View Code? Open in Web Editor NEWAutomation for SAP - Collection of Ansible Modules for various tasks using SAP Launchpad APIs
License: Apache License 2.0
Automation for SAP - Collection of Ansible Modules for various tasks using SAP Launchpad APIs
License: Apache License 2.0
I'm trying to use the software_center_download module as part of my playbook. But it fails with the following message:
"An exception has occurred - You do not have proper authorization to download software, please check: https://launchpad.support.sap.com/#/user/authorizations"
First of all I've checked the permissions, my S-User has. They are correctly set and I'm able to download software from SAP using a browser. As suggested when using an Universal ID I also reset my Account Password without any difference. So I tried it again with an S-User of my colleague which has super admin rights and the module worked as expected. His S-User uses a Universal ID, too. The only difference are those super admin rights, which shouldn't prevent me from downloading.
Any ideas how to fix this?
Inside sap_id_sso.py
is the following code:
community.sap_launchpad/plugins/module_utils/sap_id_sso.py
Lines 200 to 203 in 59ffb67
This seems to imply caching, however GIGYA_SDK_BUILD_NUMBER
is never assigned to and always remains None
.
Is there a reason for this? The only argument in that function is the API key, but as of now, for all three invocations it is the same.
Considering the gigya.js
is over 500 KB in size and the regex takes fairly long, caching would make sense.
Perhaps that was the plan all along, but assigning to the global was forgotten?
Hi folks
First of all, many thanks for providing this library! It is an incredibly valuable tool when it comes to automating our SAP Basis deployment pipeline.
I think we found a minor bug in community.sap_launchpad.maintenance_planner_files
- it returns files for a download that were deselected in the maintenance planner.
How to reproduce
Now, when listing the files to download with this module, it will not only tell us to download the language packs DE & EN, but all available language packs, even though they were not selected in the MP. I think this is a bug:
...
- name: Execute Ansible Module 'maintenance_planner_files' to get files from MP
community.sap_launchpad.maintenance_planner_files:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
transaction_name: "{{ transaction_name }}"
register: sap_maintenance_planner_basket_register
- name: Debug
ansible.builtin.debug:
var: sap_maintenance_planner_basket_register
verbosity: 2
...
This will output all language files, even though deselected:
...
"sap_maintenance_planner_basket_register": {
"changed": true,
"download_basket": [
...
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312922022",
"Filename": "S4HANAOP107_ERP_LANG_SL.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312932022",
"Filename": "S4HANAOP107_ERP_LANG_SV.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312942022",
"Filename": "S4HANAOP107_ERP_LANG_TH.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312962022",
"Filename": "S4HANAOP107_ERP_LANG_TR.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312972022",
"Filename": "S4HANAOP107_ERP_LANG_UK.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312982022",
"Filename": "S4HANAOP107_ERP_LANG_VI.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001312992022",
"Filename": "S4HANAOP107_ERP_LANG_ZF.SAR"
},
{
"DirectLink": "https://softwaredownloads.sap.com/file/0030000001313002022",
"Filename": "S4HANAOP107_ERP_LANG_ZH.SAR"
...
To summarize, it appears that the module returns all software packages from the stack, even deselected ones.
I dug a bit deeper into the code and saw that the API call that return the files above returns an XML which also contains the deselected files:
<?xml version="1.0" encoding="utf-16"?>
<mnp:response xmlns:mnp="http://xml.sap.com/2012/01/mnp">
...
<mnp:entities>
<mnp:entity id="selectFiles" step="downloadFiles" label="Download Files">
<mnp:entity id="downloadStackFiles" label="Download Stack Files">
<mnp:entity label="List of files selected for download" id="stack_files"
type="Download Stack Independent Files" enable="false">
<mnp:entity id="0010000000033172015" label="GBX01HR5605.SAR" type="REG" size="5"
selection_type="multiple" selected="true"
description="Attribute Change Package 28 for GBX01HR5 605" enable="false"/>
....
<mnp:entity id="0030000001312572022" label="S4HANAOP107_ERP_LANG_CS.SAR" type="STL" size="687978"
selection_type="multiple" selected="true" description="File on DVD" enable="false"/>
<mnp:entity id="0030000001312582022" label="S4HANAOP107_ERP_LANG_DA.SAR" type="STL" size="475621"
selection_type="multiple" selected="true" description="File on DVD" enable="false"/>
<mnp:entity id="0030000001312472022" label="S4HANAOP107_ERP_LANG_DE.SAR" type="STL" size="292015"
selection_type="multiple" selected="true" description="File on DVD" enable="false"/>
...
As you can see, both S4HANAOP107_ERP_LANG_DE
(which was selected in the MP GUI) as well as S4HANAOP107_ERP_LANG_DA.SAR
(which was unselected in the MP planner) have selected=true
. If the clients are supposed to respect this field, then it might even be a bug in the SAP backend. I am not sure this can easily be fixed, but maybe you folks have a good internal contact working on this part that can take a look?
FWIW, I also checked out the SAP Download Manager (which I assume is the official client for the MP) and it correctly returns only the selected files, but I think it uses a slightly different API than the XML above.
Hi folks
As you probably know, whenever a new SAP system is set up or the underlying VM is recreated, one has to access the launchpad on https://me.sap.com/licensekey, register the new system (or update an existing one) and generate a new license file.
Since we are moving to the cloud, where VMs might be changing more often than traditionally, we'd like to automate the following tasks:
Would you accept a PR that extends this module with the functionality above?
I quickly checked what API is used for managing Systems/License Keys and it appears to be a quite nice ODATA API on https://launchpad.support.sap.com/services/odata/i7p/odata/bkey, which should be rather easy to write a client for.
This API is also protected by the same authorization methods (cookies etc.) as the other APIs compatible in this Ansible Collection, so I thought the new API would fit nicely in your already existing Ansible Modules; I could reuse your foundation and just add a new module that talks to an additional API.
I am not sure how stable the i7p
API above is and whether it would break in the future, but I think you have the similar issue with the currently compatible APIs (software download etc.) anyway.
What do you think?
Hi, would it be possible to add the ability to download SNOTES from the Support Portal? I have an ansible playbook that needs to get the latest compatible OS-release for the respective HANA version (Note 2235581)
failed: [localhost] (item=SAPCAR_1324-80000936.EXE) => {"ansible_loop_var": "item", "changed": false, "item": "SAPCAR_1324-80000936.EXE", "msg": "SAP SSO authentication failed - 401 Client Error: for url: https://core-api.account.sap.com/uid-core/authenticate?reqId=https%3A%2F%2Fhana.ondemand.com%2Fsupportportal"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.