Skip to content

Commit

Permalink
Merge pull request #460 from berndfinger/issue-385-new-detection-meth…
Browse files Browse the repository at this point in the history
…od-bugs

Issue 385 new detection method - bug fixes
  • Loading branch information
sean-freeman authored Sep 20, 2023
2 parents 88d3868 + a153398 commit fe07ff6
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sap_swpm_cd_export_pt1_path: /software/download_basket/SOLMAN/51054655_1_DIR
sap_swpm_cd_export_pt2_path: /software/download_basket/SOLMAN/51054655_2_DIR
sap_swpm_cd_language_path: /software/download_basket/SOLMAN/51054655_3_DIR
sap_swpm_cd_java_path: /software/download_basket/SOLMAN/51054655_4_DIR
sap_swpm_cd_rdms_path: /software/download_basket/SAPINST/SAP_HANA/51054623
sap_swpm_cd_rdbms_path: /software/download_basket/SAPINST/SAP_HANA/51054623

# NW Passwords
sap_swpm_master_password: "NewPass$321"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sap_swpm_cd_export_pt1_path: /software/download_basket/SOLMAN/51054655_1_DIR
sap_swpm_cd_export_pt2_path: /software/download_basket/SOLMAN/51054655_2_DIR
sap_swpm_cd_language_path: /software/download_basket/SOLMAN/51054655_3_DIR
sap_swpm_cd_java_path: /software/download_basket/SOLMAN/51054655_4_DIR
sap_swpm_cd_rdms_path: /software/download_basket/SAPINST/SAP_HANA/51054623
sap_swpm_cd_rdbms_path: /software/download_basket/SAPINST/SAP_HANA/51054623

# NW Passwords
sap_swpm_master_password: "NewPass$321"
Expand Down
33 changes: 22 additions & 11 deletions roles/sap_install_media_detect/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sap_install_media_detect_rar_extract: '/usr/bin/unrar x'
# Fully qualified path to an additional argument to the program for extracting RAR files, for specifying the directory into
# which the archive is to be extracted. Needs to be empty or start with a space character.
# If sap_install_media_detect_rar_package is set to 'EPEL', this variable is not used.
#sap_install_media_detect_rar_extract_argument: ' -o'
#sap_install_media_detect_rar_extract_directory_argument: ' -o'
sap_install_media_detect_rar_extract_directory_argument: ''

# Directory where the SAP software is located
Expand All @@ -63,22 +63,33 @@ sap_install_media_detect_move_or_copy_archives: true

# By default, the presence of at least one file for each file type according to the configured role parameters is asserted. Set the
# following parameter to 'false' to skip this step.
#sap_install_media_detect_assert_after_sapfile: false

# saphana, sapase, sapmaxdb, oracledb, ibmdb2
#sap_install_media_detect_db: 'saphana'
sap_install_media_detect_db: ''
sap_install_media_detect_assert_after_sapfile: true

# Typical parameter settings for SAP S/4HANA:
sap_install_media_detect_db: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
sap_install_media_detect_db_client: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
sap_install_media_detect_swpm: true
sap_install_media_detect_hostagent: true
sap_install_media_detect_igs: true
sap_install_media_detect_kernel: true
# saphana, sapase, sapmaxdb, oracledb, ibmdb2
#sap_install_media_detect_kernel_db: 'sapmaxdb'
#sap_install_media_detect_kernel_db: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
# (only necessary if there is more than one SAPEXEDB file in the source directory)
sap_install_media_detect_webdisp: false

# saps4hana, sapbw4hana, sapecc, sapecc_ides, sapnwas_abap, sapnwas_java, sapsolman_abap, sapsolman_java
sap_install_media_detect_export:
sap_install_media_detect_export: 'saps4hana' # saps4hana, sapbw4hana, sapecc, sapecc_ides,
# sapnwas_abap, sapnwas_java, sapsolman_abap, sapsolman_java

# Typical parameter settings for SAP ERP 6.0 EHP8 with SAP HANA database:
#sap_install_media_detect_db: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
#sap_install_media_detect_db_client: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
#sap_install_media_detect_swpm: true
#sap_install_media_detect_hostagent: true
#sap_install_media_detect_igs: true
#sap_install_media_detect_kernel: true
#sap_install_media_detect_kernel_db: 'saphana' # saphana, sapase, sapmaxdb, oracledb, ibmdb2
# (only necessary if there is more than one SAPEXEDB file in the source directory)
#sap_install_media_detect_webdisp: false
#sap_install_media_detect_export: 'sapecc' # saps4hana, sapbw4hana, sapecc, sapecc_ides,
# sapnwas_abap, sapnwas_java, sapsolman_abap, sapsolman_java

# e.g. /db_backup
sap_install_media_detect_backup_directory:
Expand Down
35 changes: 20 additions & 15 deletions roles/sap_install_media_detect/tasks/organize_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,26 @@
- line_item.archive_type == 'rarexe'
- line_item.extract_archive == 'y'

- name: SAP Install Media Detect - Organize all files - Create temp dir for sapcar archive files - {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
ansible.builtin.file:
path: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
state: directory
owner: root
group: root
mode: '0755'

- name: SAP Install Media Detect - Organize all files - Extract sapcar archive files
ansible.builtin.command: >-
ansible.builtin.shell: >-
{{ __sap_install_media_detect_fact_sapcar_path }}
-R {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}
-xvf {{ line_item.file }}
-R {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
-xvf {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.file }}
-manifest SIGNATURE.SMF
&& extracted_dir=$(ls -d */)
&& mv SIGNATURE.SMF $extracted_dir
&& mkdir -p {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}/$extracted_dir
&& mv $extracted_dir {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}/
args:
chdir: "{{ __sap_install_media_detect_software_main_directory }}"
chdir: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
loop: "{{ __sap_install_media_detect_fact_files_sapfile_results }}"
loop_control:
loop_var: line_item
Expand All @@ -148,17 +160,10 @@
- line_item.archive_type == 'sapcar'
- line_item.extract_archive == 'y'

- name: SAP Install Media Detect - Organize all files - Move SIGNATURE.SMF into subdir for SAP HANA non-export files
ansible.builtin.shell: |
extracted_dir=$(ls -d */)
mv SIGNATURE.SMF ${extracted_dir}
args:
chdir: "{{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}"
loop: "{{ __sap_install_media_detect_fact_files_sapfile_results }}"
loop_control:
loop_var: line_item
when:
- line_item.sap_file_type is search("saphana")
- name: SAP Install Media Detect - Organize all files - Remove temp dir - {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
ansible.builtin.file:
path: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
state: absent

- name: SAP Install Media Detect - Organize all files - Copy certain files to 'sap_hana' directory
ansible.builtin.copy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@
- __sap_install_media_detect_fact_files_sapfile_results | selectattr('sap_file_type', 'equalto', 'saphana_client') | length > 0
fail_msg: "No file found for saphana_client"
when:
- (sap_install_media_detect_db | d('')) == 'saphana'
- (sap_install_media_detect_db | d('')) == 'saphana' or
(sap_install_media_detect_db_client | d('')) == 'saphana'

- name: SAP Install Media Detect - Prepare - Assert that sapase is present
ansible.builtin.assert:
Expand All @@ -235,7 +236,8 @@
- __sap_install_media_detect_fact_files_sapfile_results | selectattr('sap_file_type', 'equalto', 'sapase_client') | length > 0
fail_msg: "No file found for sapase_client"
when:
- (sap_install_media_detect_db | d('')) == 'sapase'
- (sap_install_media_detect_db | d('')) == 'sapase' or
(sap_install_media_detect_db_client | d('')) == 'sapase'

- name: SAP Install Media Detect - Prepare - Assert that sapmaxdb is present
ansible.builtin.assert:
Expand All @@ -259,7 +261,8 @@
- __sap_install_media_detect_fact_files_sapfile_results | selectattr('sap_file_type', 'equalto', 'oracledb_client') | length > 0
fail_msg: "No file found for oracledb_client"
when:
- (sap_install_media_detect_db | d('')) == 'oracledb'
- (sap_install_media_detect_db | d('')) == 'oracledb' or
(sap_install_media_detect_db_client | d('')) == 'oracledb'

- name: SAP Install Media Detect - Prepare - Assert that ibmdb2 is present
ansible.builtin.assert:
Expand All @@ -275,7 +278,8 @@
- __sap_install_media_detect_fact_files_sapfile_results | selectattr('sap_file_type', 'equalto', 'ibmdb2_client') | length > 0
fail_msg: "No file found for ibmdb2_client"
when:
- (sap_install_media_detect_db | d('')) == 'ibmdb2'
- (sap_install_media_detect_db | d('')) == 'ibmdb2' or
(sap_install_media_detect_db_client | d('')) == 'ibmdb2'

- name: SAP Install Media Detect - Prepare - Assert that ibmdb2_license is present
ansible.builtin.assert:
Expand Down
4 changes: 2 additions & 2 deletions roles/sap_install_media_detect/tasks/set_global_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

- name: SAP Install Media Detect - Detection completed - Set facts for SAP HANA - sap_swpm
ansible.builtin.set_fact:
sap_swpm_cd_rdms_path: "{{ sap_hana_client_path.files[0].path }}/" # for sap_swpm Ansible Role
sap_swpm_cd_rdbms_path: "{{ sap_hana_client_path.files[0].path }}/" # for sap_swpm Ansible Role
ignore_errors: true
when:
- sap_install_media_detect_move_or_copy_archives
Expand Down Expand Up @@ -204,7 +204,7 @@
- sap_swpm_cd_oracle_path
- sap_swpm_cd_sapase_path
- sap_swpm_cd_sapmaxdb_path
- sap_swpm_cd_rdms_path
- sap_swpm_cd_rdbms_path
- sap_swpm_cd_ibmdb2_client_path
- sap_swpm_cd_oracle_client_path
- sap_swpm_cd_sapase_client_path
Expand Down
2 changes: 1 addition & 1 deletion roles/sap_swpm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sap_swpm_cd_export_pt1_path:
sap_swpm_cd_export_pt2_path:
sap_swpm_cd_language_path:
sap_swpm_cd_java_path:
sap_swpm_cd_rdms_path:
sap_swpm_cd_rdbms_path:
sap_swpm_cd_export_path:
sap_swpm_cd_ibmdb2_path:
sap_swpm_cd_ibmdb2_client_path:
Expand Down
2 changes: 1 addition & 1 deletion roles/sap_swpm/templates/configfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HDB_Software_Dialogs.useMediaCD = {{ sap_swpm_software_use_media }}
######
SAPINST.CD.PACKAGE.LANGUAGE = {{ sap_swpm_cd_language_path }}
SAPINST.CD.PACKAGE.JAVA = {{ sap_swpm_cd_java_path }}
SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdms_path }}
SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdbms_path }}
# SAPINST.CD.PACKAGE.KERNEL =
# SAPINST.CD.PACKAGE.KERNEL2 =
# SAPINST.CD.PACKAGE.KERNEL3 =
Expand Down

0 comments on commit fe07ff6

Please sign in to comment.