This role installs additional required packages and performs additional configuration steps for installing and running SAP HANA.
If you want to configure a RHEL system for the installation and later usage of SAP HANA, you have to first run role sap_general_preconfigure
and then role sap_hana_preconfigure. However, if we wish to run SLES for HANA, you may run only this role.
The support status of this role is: “Fully supported for RHEL managed nodes”
The role requires additional collections which are specified in meta/collection-requirements.yml
. Before using this role,
make sure that the required collections are installed, for example by using the following command:
ansible-galaxy install -vv -r meta/collection-requirements.yml
To use this role, your system needs to be configured with the basic requirements for SAP NetWeaver or SAP HANA. This is typically done by running role sap_general_preconfigure (for RHEL managed nodes before RHEL 7.6, community maintained role sap-base-settings can be used).
It is also strongly recommended to run role linux-system-roles.timesync for all systems running SAP HANA, to maintain an identical system time, before or after running role sap_hana_preconfigure.
Managed nodes need to be properly registered to a repository source and have at least the following Red Hat repositories accessible (see also example playbook):
for RHEL 7.x:
rhel-7-[server | for-power-le]-e4s-rpms |
rhel-sap-hana-for-rhel-7-[server | for-power-le]-e4s-rpms |
for RHEL 8.x:
rhel-8-for-[x86_64 | ppc64le]-baseos-e4s-rpms |
rhel-8-for-[x86_64 | ppc64le]-appstream-e4s-rpms |
rhel-8-for-[x86_64 | ppc64le]-sap-solutions-e4s-rpms |
for RHEL 9.x:
rhel-9-for-[x86_64 | ppc64le]-baseos-e4s-rpms |
rhel-9-for-[x86_64 | ppc64le]-appstream-e4s-rpms |
rhel-9-for-[x86_64 | ppc64le]-sap-solutions-e4s-rpms |
for SLES 15.x:
For details on configuring Red Hat, see the knowledge base article: How to subscribe SAP HANA systems to the Update Services for SAP Solutions). If you set role parameter sap_hana_preconfigure_enable_sap_hana_repos to yes
, the role can enable these repos.
To install HANA on Red Hat Enterprise Linux 7, 8, or 9, you need some additional packages which are contained in the
rhel-sap-hana-for-rhel-7-[server | for-power-le]-e4s-rpms, |
rhel-8-for-[x86_64 | ppc64le]-sap-solutions-e4s-rpms, or |
rhel-9-for-[x86_64 | ppc64le]-sap-solutions-e4s-rpms |
repository.
To get this repository you need to have one of the following products:
To get a personal developer edition of RHEL for SAP solutions, please register as a developer and download the developer edition.
NOTE: This is a regular RHEL installation DVD as RHEL for SAP Solutions is no additional
product but only a special bundling. The subscription grants you access to the additional
packages through our content delivery network (CDN) after installation.
For supported RHEL releases click here.
Details on configuring SLES repositories can be found on the following articles for on-premise systems or BYOS cloud images
It is also important that your disks are setup according to the SAP storage requirements for SAP HANA. This BLOG is also quite helpful when sizing HANA systems.
You can use the storage role to automate this process
If you want to use this system in production, make sure that the time service is configured correctly. You can use rhel-system-roles to automate this.
For finding out which SAP notes will be used by this role for Red Hat systems, please check the contents of variable __sap_hana_preconfigure_sapnotes
in files vars/*.yml
(choose the file which matches your OS distribution and version).
For SLES, notes are applied using the saptune service. Saptune supports a number of solutions. A solution implements several SAP notes. The default solution for this role is ‘HANA’. To see a list of supported solutions and the notes that they implement, you can run saptune solution list
on the command line.
Do not run this role against an SAP HANA or other production system. The role will enforce a certain configuration on the managed node(s), which might not be intended.
1) Previous versions of this role used the variable sap_hana_preconfigure_use_tuned_where_possible to switch between either tuned settings
or kernel command line settings (where applicable).
The current version modifies this behavior:
yes
, which is also the default, the role will configure the system for using tuned and also switch to tuned profile sap-hana.no
, the role will perform a static configuration, including the modification of the linux command line in grub.2) Previous versions of this role used variable sap_hana_preconfigure_selinux_state to set the SELinux state to disabled.
As the role sap_general_preconfigure already allows to specify the desired SELinux state, and as sap_general_preconfigure
is always run before sap_hana_preconfigure, there is no need any more to let sap_hana_preconfigure configure the SELinux state.
The same applies to the assertion of the SELinux state.
3) SLES systems are now configured using saptune rather than the ansible implementation of the notes.
This role does not require any parameter to be set in the playbook or inventory.
bool
If set to false
, the role will only execute or verify the installation or configuration steps of SAP notes.
Default is to perform installation and configuration steps.
bool
If sap_hana_preconfigure_config_all
is set to false
, set this variable to true
to perform only the
installation steps of SAP notes.
bool
If sap_hana_preconfigure_config_all
is set to false
, set this variable to true
to perform only the
configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to true
.
Example:
sap_hana_preconfigure_config_all: false
sap_hana_preconfigure_configuration: true
sap_hana_preconfigure_2772999_04: true
sap_hana_preconfigure_2382421: true
bool
false
If set to true
, the role will run in assertion mode instead of the default configuration mode.
bool
false
In assertion mode, the role will check either tuned or static settings.
If this parameter is set to to true
, the role will check both tuned and static settings.
bool
false
In assertion mode, the role will abort when encountering any assertion error.
If this parameter is set to false
, the role will not abort when encountering an assertion error.
This is useful if the role is used for reporting a system’s SAP notes compliance.
str
'fedora.linux_system_roles'
fedora.linux_system_roles
redhat.rhel_system_roles
Set which Ansible Collection to use for the Linux System Roles.
For community/upstream, use ‘fedora.linux_system_roles’
For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use ‘redhat.rhel_system_roles’
bool
false
Check the RHEL release against parameter sap_hana_preconfigure_supported_rhel_minor_releases
, which is a list of
known SAP HANA supported RHEL minor releases. By default, the role will display a message and continue running if
the RHEL release is not part of that list. If set to true
, the role will fail in such a case.
list
with elements of type str
Use this parameter to set your own list of SAP HANA supported RHEL minor releases.
bool
false
Set to ‘true’ to enable the SAP HANA required RHEL repos.
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_use_hana_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 7 repos on x86_64’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 7 repos on ppc64le’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 8 repos on x86_64’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 8 repos on ppc64le’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 9 repos on x86_64’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
list
with elements of type str
Use this parameter to set your own list of SAP HANA required RHEL 9 repos on ppc64le’
This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
The related parameters are sap_general_preconfigure_enable_repos
and sap_general_preconfigure_req_repos
.
bool
false
Use this parameter to set the RHEL minor release, which is required for SAP HANA.
The related parameter is sap_general_preconfigure_set_minor_release
.
bool
true
Set to false
if you do not want the SAP HANA directories to be created by the role.
The SAP HANA directories will always be created if sap_hana_preconfigure_modify_selinux_labels
(see below) is set to true
, no matter how sap_hana_preconfigure_create_directories
is set.
list
with elements of type str
List of SAP HANA directories to be created.
bool
true
For compatibility of SAP HANA with SELinux in enforcing mode, the role will recursively add
the usr_t
label to directories and files in the directories where HANA is installed.
If relabeling not desired, set this parameter false
.
If the variable is set to true
, the SAP HANA directories will be created no matter
how the variable sap_hana_preconfigure_create_directories
(see above) is set.
list
with elements of type str
List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list
or a list of the minimum required packages for SAP HANA server (parameter __sap_hana_preconfigure_packages_min_install
).
bool
true
SAP HANA requires certain minimum package versions to be supported. These minimum levels are listed in SAP Note 2235581.
Set this parameter to false
if you want to ignore these requirements.
bool
false
Set this parameter to true
to update the system to the latest package levels.
By setting the parameter sap_general_preconfigure_set_minor_release
of the
role sap_general_preconfigure
to true
, you can install the most recent package updates
without updating to a more recent RHEL minor release.
bool
false
Set to true
if you want to perform a reboot at the end of the role, if necessary.
bool
true
If sap_hana_preconfigure_reboot_ok
is set to false
, which is the default, a reboot requirement should not
remain unnoticed. For this reason, we let the role fail. Set this parameter to false
to override this behavior.
Can be useful if you want to implement your own reboot handling.
list
with elements of type str
Network related linux kernel parameter settings for SAP HANA on all hardware platforms.
list
with elements of type str
Network related linux kernel parameter settings for platform ppc64le.
bool
false
Set to true
to also set NetApp NFS required kernel parameters.
bool
false
If sap_hana_preconfigure_use_netapp_settings_nfs
is set to true
and NFS Version 3 is to be used,
this parameter must be set to true
as well.
bool
true
Set this parameter to false
to not install the IBM Power Systems service and productivity tools.
bool
true
Set this parameter to false
if you do not want to add the IBM Power tools repository (e.g. because the packages
are already available on the local network). The IBM Power Systems service and productivity tools will only
be installed if the variable sap_hana_preconfigure_install_ibm_power_tools
is set to true
, which is the default.
str
URL of the IBM Power tools repository.
str
''
List of interfaces for which the MTU size will be set to 9000
.
list
with elements of type str
List of interfaces for which the tso flag will be set.
bool
true
Use tuned for configuring most of the kernel settings for SAP HANA
Set this parameter to false
to use static kernel settings
str
'sap-hana'
Name of the SAP HANA tuned tuned profile to enable (RHEL).
bool
false
Set this parameter to true
to modify the Grub boot command line.
bool
true
By default, the role will run grub2-mkconfig
to update the Grub configuration if necessary.
Set this parameter to false
if this is not desired.
str
Use this parameter to specify the name of the RHEL group which is used for the database processes.
It will be used to configure process limits as per step “Configuring Process Resource Limits” of SAP note 2772999.
Example:
sap_hana_preconfigure_db_group_name: dba
str
'3.0.2'
Version of saptune to install (SLES for SAP Applications).
This will replace the current installed version if present, even downgrade if necessary.
str
'HANA'
HANA
NETWEAVER+HANA
S4HANA-APP+DB
S4HANA-DBSERVER
The saptune solution to apply (SLES for SAP Applications).
bool
false
On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications).
Set this parameter to true
on Azure.
Simple playbook, named sap+hana.yml:
---
- hosts: all
roles:
- role: sap_general_preconfigure
- role: sap_hana_preconfigure
Simple playbook for an extended check (assert) run, named sap+hana-assert.yml:
---
- hosts: all
vars:
sap_general_preconfigure_assert: yes
sap_general_preconfigure_assert_ignore_errors: yes
sap_hana_preconfigure_assert: yes
sap_hana_preconfigure_assert_ignore_errors: yes
roles:
- role: sap_general_preconfigure
- role: sap_hana_preconfigure
Normal run, for configuring server host_1 for SAP HANA:
ansible-playbook sap+hana.yml -l host_1
Extended Check (assert) run, not aborting if an error has been found:
ansible-playbook sap+hana-assert.yml -l host_1
Same as above, with a nice compact and colored output, this time for two hosts:
ansible-playbook sap+hana-assert.yml -l host_1,host_2 |
awk '{sub (" \"msg\": ", "")}
/TASK/{task_line=$0}
/fatal:/{fatal_line=$0; nfatal[host]++}
/...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0}
/^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2}
/SAP note/{print "\033[30m[" host"] "$0}
/FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0}
/WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0}
/PASS:/{npass[host]++; print "\033[32m[" host"] "$0}
/INFO:/{print "\033[34m[" host"] "$0}
/changed/&&/unreachable/{print "\033[30m[" host"] "$0}
END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) {
printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033[30m Last TASK and fatal output:\n"); print task_line, fatal_line
}
else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033[30m\n", nfail[var], nwarn[var], npass[var])}}'
Note: For terminals with dark background, replace the color code 30m
by 37m
.
In case you need to make an invisible font readable on a terminal with dark background, run the following command in the terminal:
printf "\033[37mreadable font\n"
In case you need to make an invisible font readable on a terminal with bright background, run the following command in the terminal:
printf "\033[30mreadable font\n"
Please read the developer guidelines if you want to contribute
Apache license 2.0
Red Hat for SAP Community of Practice, Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo, Rainer Leber