|
1 | 1 | # SPDX-License-Identifier: Apache-2.0 |
2 | 2 | --- |
3 | 3 |
|
4 | | -# Load variables while maintaining backwards compatibility when variable is empty string. |
5 | | -# Check if variable is defined and non-empty before using it, otherwise fall back to backwards |
6 | | -# compatible variable or default empty string that will fail asserts afterwards. |
7 | | -# NOTE: This is not __var assignment so it will not override user specified vars due to precedence! |
8 | | -- name: SAP HANA - Main - Set mandatory variables used by hdblcm configfile |
9 | | - ansible.builtin.set_fact: |
10 | | - sap_hana_install_sid: |
11 | | - "{{ sap_hana_sid | d('') |
12 | | - if sap_hana_install_sid | string | length == 0 |
13 | | - else sap_hana_install_sid }}" |
14 | | - sap_hana_install_number: |
15 | | - "{{ sap_hana_instance_number | d(sap_hana_install_instance_nr) | d(sap_hana_install_instance_number) | d('') |
16 | | - if sap_hana_install_number | string | length == 0 |
17 | | - else sap_hana_install_number }}" |
18 | | - sap_hana_install_system_usage: "{{ sap_hana_install_env_type | d(sap_hana_install_system_usage) | d('custom') }}" |
19 | | - sap_hana_install_restrict_max_mem: "{{ sap_hana_install_mem_restrict | d(sap_hana_install_restrict_max_mem) | d('n') }}" |
20 | | - tags: |
21 | | - - sap_hana_install_check_hana_exists |
22 | | - - sap_hana_install_check_installation |
23 | | - - sap_hana_install_preinstall |
24 | | - - sap_hana_install_set_log_mode |
25 | | - - sap_hana_install_configure_firewall |
26 | | - |
27 | | -# Separate task for password with no_log |
28 | | -- name: SAP HANA - Main - Set mandatory variables used by hdblcm configfile - passwords |
29 | | - ansible.builtin.set_fact: |
30 | | - sap_hana_install_master_password: |
31 | | - "{{ sap_hana_install_common_master_password | d('') |
32 | | - if sap_hana_install_master_password is not defined or sap_hana_install_master_password | string | length == 0 |
33 | | - else sap_hana_install_master_password }}" |
34 | | - no_log: true # Required for password handling |
35 | | - tags: |
36 | | - - sap_hana_install_check_hana_exists |
37 | | - - sap_hana_install_check_installation |
38 | | - - sap_hana_install_preinstall |
39 | | - - sap_hana_install_set_log_mode |
40 | | - - sap_hana_install_configure_firewall |
41 | | - |
42 | | -- name: SAP HANA - Main - Validate the role variables |
| 4 | +# SAP HANA |
| 5 | +- name: SAP HANA - Main - Prepare some variables |
43 | 6 | ansible.builtin.include_tasks: |
44 | | - file: pre_tasks/assert_variables.yml |
| 7 | + file: pre_tasks/prepare_variables.yml |
45 | 8 | tags: |
46 | 9 | - sap_hana_install_check_hana_exists |
47 | 10 | - sap_hana_install_check_installation |
48 | 11 | - sap_hana_install_preinstall |
49 | 12 | - sap_hana_install_set_log_mode |
50 | 13 | - sap_hana_install_configure_firewall |
51 | 14 |
|
52 | | -# SELinux is not currently supported by SAP using SLES4SAP |
53 | | -# This can still be overwritten by extra variables. |
54 | | -- name: SAP HANA Pre Install - Ensure SELinux does not execute for SLES |
55 | | - ansible.builtin.set_fact: |
56 | | - sap_hana_install_modify_selinux_labels: false |
57 | | - when: ansible_os_family == "Suse" |
58 | | - |
59 | | - |
60 | 15 | # SAP HANA presence has to be validated for both new system and adding new hosts. |
61 | 16 | - name: SAP HANA - Main - Validate presence of existing SAP HANA database |
62 | 17 | ansible.builtin.include_tasks: |
|
93 | 48 | - name: SAP HANA - Install - Pre-Tasks |
94 | 49 | ansible.builtin.include_tasks: |
95 | 50 | file: pre_install.yml |
96 | | - tags: sap_hana_install_preinstall |
97 | 51 |
|
98 | 52 | - name: SAP HANA - Install |
99 | 53 | ansible.builtin.include_tasks: |
|
169 | 123 | {% if sap_hana_install_update_firewall %} |
170 | 124 | Firewall is enabled and SAP HANA ports are open. |
171 | 125 | {% endif %} |
172 | | - {% if sap_hana_install_modify_selinux_labels %} |
173 | | - SELinux file contexts are configured for SAP folders '{{ sap_hana_install_root_path }}' and '/usr/sap'. |
| 126 | + {% if __sap_hana_install_configure_selinux %} |
| 127 | + SELinux file contexts are configured for SAP folders ({{ sap_hana_install_directories | map('quote') | join(', ') }}). |
174 | 128 | {% endif %} |
175 | | - {% if ansible_os_family == "RedHat" and sap_hana_install_use_fapolicyd %} |
176 | | - Fapolicyd is configured for SAP folders '{{ sap_hana_install_root_path }}' and '/usr/sap'. |
| 129 | + {% if ansible_os_family == "RedHat" and __sap_hana_install_configure_fapolicyd %} |
| 130 | + Fapolicyd is configured for SAP folders ({{ sap_hana_install_directories | map('quote') | join(', ') }}). |
177 | 131 | {% endif %} |
178 | 132 | vars: |
179 | 133 | __sap_hana_install_fact_hana_version: "{{ __sap_hana_install_register_completion_result.stdout.split(';')[0] }}" |
|
0 commit comments