Chapter 4. RHEL System Roles for SAP The RHEL System Roles for SAP provide a quick, easy, and consistent method for preparing your local system or any number of remote systems according to applicable SAP notes for SAP software. They include the Ansible roles sap_general_preconfigure , sap_netweaver_preconfigure , and sap_hana_preconfigure and require an Ansible execution system (e.g., Ansible Automation Platform, Ansible Core). 4.1. Installing Ansible Core Ansible Core is available in the RHEL 9 AppStream repository. If you already have an Ansible Automation Platform or Ansible Core package installed, you can skip this step and proceed to Installing RHEL System Roles for SAP . Prerequisites You have system administrator access. Procedure Install the ansible-core package: 4.2. Installing RHEL System Roles for SAP RHEL System Roles for SAP is available in the RHEL for SAP Solutions r epository. It requires certain functionality delivered in the RHEL System Roles, which are available in the AppStream repository. Prerequisites You have system administrator access. You have installed the Ansible Core package or Ansible Automation Platform. Procedure Install RHEL System Roles for SAP and RHEL System Roles: 4.3. System configuration with RHEL System Roles for SAP 4.3.1. Preparing a local system If the Ansible Engine is installed on the same system on which you want to install the SAP software, perform the steps outlined in this procedure to configure your local managed node. Prerequisites You have system administrator access. Procedure Make a backup of the system if you would like to preserve the original configuration of the server. Create a file named sap.yml with the following content: --- - hosts: localhost vars: ansible_connection: local sap_general_preconfigure_max_hostname_length: 64 sap_general_preconfigure_reboot_ok: false sap_general_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_reboot_ok: false sap_hana_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_update: true roles: - sap_general_preconfigure - sap_netweaver_preconfigure - sap_hana_preconfigure Important The correct indentation and the use of spaces instead of tabs is essential for YAML files. Note The line sap_general_preconfigure_max_hostname_length: 64 is only required if your hostname ( hostname -s ) is longer than 13 characters and if you are not using this system for an SAP ABAP Platform instance. Without this line, the role sap_general_preconfigure will fail its hostname check because a hostname with more than 13 characters is not allowed for an SAP ABAP Platform instance as per SAP note 611361 . The line sap_netweaver_preconfigure is used to perform specific installation and configuration steps for an SAP ABAP Platform. It can be removed or commented out for an SAP HANA database only system. The line sap_hana_preconfigure is used to perform specific installation and configuration steps for an SAP HANA database. It can be removed or commented out for an SAP ABAP Platform only system. Run the sap.yml Ansible playbook: This will configure this system according to the applicable SAP notes for SAP ABAP Platform and/or SAP HANA on RHEL 9. After the ansible-playbook command has finished successfully, reboot the system: 4.3.2. Preparing one or more remote systems If the Ansible Engine is installed on the same system on which you want to install the SAP software, perform the steps outlined in this procedure to configure your local managed node. Prerequisites You have system administrator access. Procedure Make a backup of the remote systems if you would like to preserve the original configuration of the server. Create an inventory file or modify file /etc/ansible/hosts to contain the name of a group of hosts and each system which you intend to configure (=managed node) in a separate line (example for three hosts in a host group named sap_hosts ): [sap_hosts] host01 host02 host03 Verify that you can log in to all three hosts using ssh without a password. Example: Create a YAML file named sap.yml with the following content: --- - hosts: sap_hosts vars: sap_general_preconfigure_max_hostname_length: 64 sap_general_preconfigure_reboot_ok: false sap_general_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_reboot_ok: true sap_hana_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_update: true roles: - sap_general_preconfigure - sap_netweaver_preconfigure - sap_hana_preconfigure Note The line sap_general_preconfigure_max_hostname_length: 64 is only required if your hostname ( hostname -s ) is longer than 13 characters and if you are not using this system for an SAP ABAP Platform instance. Without this line, the role sap_general_preconfigure will fail its hostname check because a hostname with more than 13 characters is not allowed for an SAP ABAP Platform instance as per SAP note 611361 . The line sap_netweaver_preconfigure is used to perform specific installation and configuration steps for an SAP ABAP Platform. It can be removed or commented out for an SAP HANA database only system. The line sap_hana_preconfigure is used to perform specific installation and configuration steps for an SAP HANA database. It can be removed or commented out for an SAP ABAP Platform only system. Run the sap.yml Ansible playbook: This will configure all systems that are part of host group sap_hosts according to the applicable SAP notes for SAP ABAP Platform and/or SAP HANA on RHEL 9. Finally, if necessary, the systems are rebooted. Additional resources RHEL System Roles for SAP

Commands:
dnf install ansible-core
dnf install rhel-system-roles-sap rhel-system-roles
--- - hosts: localhost vars: ansible_connection: local sap_general_preconfigure_max_hostname_length: 64 sap_general_preconfigure_reboot_ok: false sap_general_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_reboot_ok: false sap_hana_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_update: true roles: - sap_general_preconfigure - sap_netweaver_preconfigure - sap_hana_preconfigure
ansible-playbook sap.yml -e 'ansible_python_interpreter=/usr/libexec/platform-python'
reboot
[sap_hosts] host01 host02 host03
ssh host01 uname -a ssh host02 hostname ssh host03 echo test
--- - hosts: sap_hosts vars: sap_general_preconfigure_max_hostname_length: 64 sap_general_preconfigure_reboot_ok: false sap_general_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_reboot_ok: true sap_hana_preconfigure_fail_if_reboot_required: false sap_hana_preconfigure_update: true roles: - sap_general_preconfigure - sap_netweaver_preconfigure - sap_hana_preconfigure
ansible-playbook sap.yml