Skip to content

sap_software_download: New role for downloading software #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 4, 2025

Conversation

marcelmamula
Copy link
Contributor

@marcelmamula marcelmamula commented Mar 27, 2025

Description

Executing sap_launchpad modules require initial setup of environment, Python modules, etc.
This all can be moved into role, which will do this work so we can remove it from our other playbooks.
We also have need for additional handling and logic that would be unnecessary in modules themselves.

Additional logic on top of modules

  1. Create Python venv and destroy it after execution. This can be disabled with sap_software_download_use_venv: false
  2. Bulk loading of files (still downloaded one by one)
  3. Validation of files when executed with sap_software_download_find_alternatives: true
  4. Download both Maintenance Plan and list of files in sap_software_download_files at same time.
  5. Validation of package relations for known combinations (e.g. SAP HANA) sap_software_download_validate_relationships: true
  6. Few variables to control error handling so you can skip failures if you are handling files you know: sap_software_download_ignore_relationship_warning, sap_software_download_ignore_file_not_found, sap_software_download_ignore_plan_not_found

Testing

Testing is being done on localhost as well as managed node, with both Python venv and default Python.

Download latest files:

    - name: Test 1 - Include role sap_software_download
      ansible.builtin.include_role:
        name: community.sap_launchpad.sap_software_download
      vars:
        sap_software_download_suser_id: "{{ sap_id_user }}"
        sap_software_download_suser_password: "{{ sap_id_user_password }}"
        sap_software_download_directory: "/software/test1"
        sap_software_download_files:
          - 'SAPCAR_*-70006178.EXE'
          - 'SUM11SP01_1-80006800.SAR'
          - 'IMDB_AFL100_102P_01-10012328.SAR'

Download SAP HANA files and validate their versions: This will trigger warnings due to mismatch, but they will be ignored because of sap_software_download_ignore_relation_warning.
Note commented out files, which is way to trigger warning as they were not found.

    - name: Test 2 - Include role sap_software_download
      ansible.builtin.include_role:
        name: community.sap_launchpad.sap_software_download
      vars:
        sap_software_download_suser_id: "{{ sap_id_user }}"
        sap_software_download_suser_password: "{{ sap_id_user_password }}"
        sap_software_download_directory: "/software/test2"
        sap_software_download_ignore_file_not_found: true
        sap_software_download_ignore_relationship_warning: true
        sap_software_download_files:
          - IMDB_SERVER100_122_35-10009569.SAR  # 35
          - IMDB_LCAPPS_100_100-20010426.SAR
          # - IMDB_LCAPPS_122P_3500-20010426.SAR  # 35
          - IMDB_LCAPPS_122P_3200-20010426.SAR
          - IMDB_AFL100_122P_10-10012328.SAR
          # - IMDB_AFL100_122P_3500-10012328.SAR  # 35
          - IMDB_CLIENT100_120_140-10009663.SAR
          - IMDB_CLIENT20_024_21-80002082.SAR

    - name: Test 3 - Include role sap_software_download
      ansible.builtin.include_role:
        name: community.sap_launchpad.sap_software_download
      vars:
        sap_software_download_suser_id: "{{ sap_id_user }}"
        sap_software_download_suser_password: "{{ sap_id_user_password }}"
        sap_software_download_directory: "/software/test3"
        sap_software_download_ignore_file_not_found: true
        sap_software_download_ignore_relationship_warning: true
        sap_software_download_files:
          - IMDB_SERVER20_077_0-80002031.SAR  # 2.0 SPS07 revision 7, patch 0 - https://me.sap.com/notes/3426637
          # - IMDB_LCAPPS_2077_3-20010426.SAR # For 2.0 SPS07 rev 7, component at patch 3
          - IMDB_LCAPPS_2078_0-20010426.SAR   # For 2.0 SPS07 rev 8, component at patch 0
          - IMDB_AFL20_077_0-80001894.SAR     # For 2.0 SPS07 rev 7, component at patch 0

Download files but also transaction at same time

    - name: Test 4 - Include role sap_software_download
      ansible.builtin.include_role:
        name: community.sap_launchpad.sap_software_download
      vars:
        sap_software_download_suser_id: "{{ sap_id_user }}"
        sap_software_download_suser_password: "{{ sap_id_user_password }}"
        sap_software_download_directory: "/software/test4"
        sap_software_download_files:
          - IMDB_SERVER100_122_35-10009569.SAR  # 35
          - IMDB_LCAPPS_122P_3500-20010426.SAR  # 35
          - IMDB_AFL100_122P_3500-10012328.SAR  # 35
        sap_software_download_mp_transaction: "My-transaction-name"

@marcelmamula marcelmamula added the enhancement New feature or request label Mar 27, 2025
@marcelmamula marcelmamula self-assigned this Mar 27, 2025
@marcelmamula marcelmamula mentioned this pull request Mar 31, 2025
@marcelmamula marcelmamula requested a review from berndfinger April 3, 2025 13:17
Copy link
Member

@berndfinger berndfinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@sean-freeman sean-freeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍 tested and working great

@marcelmamula marcelmamula merged commit e5eab87 into sap-linuxlab:dev Apr 4, 2025
2 checks passed
@marcelmamula marcelmamula deleted the role branch April 7, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants