Skip to content

Commit

Permalink
Merge pull request #481 from sean-freeman/minor_fixes
Browse files Browse the repository at this point in the history
fix for sles and mp stack xml
  • Loading branch information
berndfinger authored Sep 28, 2023
2 parents 79de6a7 + c8c71f4 commit 18a988d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
7 changes: 7 additions & 0 deletions roles/sap_hana_install/tasks/pre_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
- '/hana/data'
tags: sap_hana_install_chown_hana_directories

# SELinux is not currently supported by SAP using SLES4SAP
# This is a workaround to avoid change to default to enable SELinux
- name: SAP HANA Pre Install - Ensure SELinux does not execute for SLES
ansible.builtin.set_fact:
sap_hana_install_modify_selinux_labels: false
when: ansible_os_family == "Suse"

- name: SAP HANA Pre Install - Configure '/hana' SELinux file contexts
ansible.builtin.include_role:
name: '{{ sap_hana_install_system_roles_collection }}.selinux'
Expand Down
4 changes: 2 additions & 2 deletions roles/sap_swpm/tasks/pre_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}"
# If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank
# IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true"
# If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
# If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}"
sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_START_GUISERVER=false {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}"
tags: sap_swpm_sapinst_commandline

Expand Down Expand Up @@ -62,7 +62,7 @@
- " WEBDISP - {{ sap_swpm_web_dispatcher_path }}/{{ sap_swpm_web_dispatcher_file_name }} "
- " SAPCAR - {{ sap_swpm_sapcar_path }}/{{ sap_swpm_sapcar_file_name }} "
- " SWPM - {{ sap_swpm_swpm_path }}/{{ sap_swpm_swpm_sar_file_name }} "
- " MP Stack - {{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }} "
- " MP Stack - {{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"
- " Backup - {{ sap_swpm_backup_location }} "

- name: SAP SWPM - Installation Process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Install using SAP Maintenance Planner Stack XML

# Check for MP Stack XML if filename not given
- name: SAP SWPM Pre Install - MP Stack XML - Get from {{ sap_swpm_mp_stack_path }}
- name: SAP SWPM Pre Install - MP Stack XML - Search for MP_*.xml file in {{ sap_swpm_mp_stack_path }}
ansible.builtin.shell: |
ls MP*.xml
args:
Expand All @@ -31,7 +31,7 @@
(sap_swpm_mp_stack_file_name is none) or
(sap_swpm_mp_stack_file_name | length == 0)

- name: SAP SWPM Pre Install - MP Stack XML - Set fact
- name: SAP SWPM Pre Install - MP Stack XML - Set fact for filename
ansible.builtin.set_fact:
sap_swpm_mp_stack_file_name: "{{ sap_swpm_mp_stack_file_get.stdout }}"
# Test if variable string is not defined or None / blank
Expand All @@ -41,22 +41,22 @@
(sap_swpm_mp_stack_file_name is none) or
(sap_swpm_mp_stack_file_name | length == 0)

- name: SAP SWPM Pre Install - MP Stack XML - Set fact
- name: SAP SWPM Pre Install - MP Stack XML - Show File and Path
ansible.builtin.debug:
msg: "SAP Maintenance Planner Stack XML is {{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
msg: "SAP Maintenance Planner Stack XML is {{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"

- name: SAP SWPM Pre Install - MP Stack XML - Set fact for SWPM injection
ansible.builtin.set_fact:
sap_swpm_swpm_command_mp_stack: "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
sap_swpm_swpm_command_mp_stack: "SAPINST_STACK_XML={{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"

- name: SAP SWPM Pre Install - MP Stack XML - Ensure (1 of 2) SAP System ID is correct inside SAP Maintenance Plan Stack XML
ansible.builtin.replace:
path: "{{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
path: "{{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"
regexp: '<constraint name="sid" value="([A-Z][0-9])\w"'
replace: '<constraint name="sid" value="{{ sap_swpm_sid | upper }}"'

- name: SAP SWPM Pre Install - MP Stack XML - Ensure (2 of 2) SAP System ID is correct inside SAP Maintenance Plan Stack XML
ansible.builtin.replace:
path: "{{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
path: "{{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"
regexp: '<sid>([A-Z][0-9])\w'
replace: '<sid>{{ sap_swpm_sid | upper }}'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Install using SAP Maintenance Planner Stack XML

# Check for MP Stack XML if filename not given
- name: SAP SWPM Pre Install - MP Stack XML - Get from {{ sap_swpm_mp_stack_path }}
- name: SAP SWPM Pre Install - MP Stack XML - Search for MP_*.xml file in {{ sap_swpm_mp_stack_path }}
ansible.builtin.shell: |
ls MP*.xml
args:
Expand All @@ -16,7 +16,7 @@
(sap_swpm_mp_stack_file_name is none) or
(sap_swpm_mp_stack_file_name | length == 0)

- name: SAP SWPM Pre Install - MP Stack XML - Set fact
- name: SAP SWPM Pre Install - MP Stack XML - Set fact for filename
ansible.builtin.set_fact:
sap_swpm_mp_stack_file_name: "{{ sap_swpm_mp_stack_file_get.stdout }}"
# Test if variable string is not defined or None / blank
Expand All @@ -26,22 +26,22 @@
(sap_swpm_mp_stack_file_name is none) or
(sap_swpm_mp_stack_file_name | length == 0)

- name: SAP SWPM Pre Install - MP Stack XML - Set fact
- name: SAP SWPM Pre Install - MP Stack XML - Show File and Path
ansible.builtin.debug:
msg: "SAP Maintenance Planner Stack XML is {{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
msg: "SAP Maintenance Planner Stack XML is {{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"

- name: SAP SWPM Pre Install - MP Stack XML - Set fact for SWPM injection
ansible.builtin.set_fact:
sap_swpm_swpm_command_mp_stack: "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
sap_swpm_swpm_command_mp_stack: "SAPINST_STACK_XML={{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"

- name: SAP SWPM Pre Install - MP Stack XML - Ensure (1 of 2) SAP System ID is correct inside SAP Maintenance Plan Stack XML
ansible.builtin.replace:
path: "{{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
path: "{{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"
regexp: '<constraint name="sid" value="([A-Z][0-9])\w"'
replace: '<constraint name="sid" value="{{ sap_swpm_sid | upper }}"'

- name: SAP SWPM Pre Install - MP Stack XML - Ensure (2 of 2) SAP System ID is correct inside SAP Maintenance Plan Stack XML
ansible.builtin.replace:
path: "{{ sap_swpm_mp_stack_path }}/{{ sap_swpm_mp_stack_file_name }}"
path: "{{ (sap_swpm_mp_stack_path + '/' + sap_swpm_mp_stack_file_name) | regex_replace ('//*', '/') }}"
regexp: '<sid>([A-Z][0-9])\w'
replace: '<sid>{{ sap_swpm_sid | upper }}'

0 comments on commit 18a988d

Please sign in to comment.