Chapter 5. Quick Start Guide to RHEL System Roles for SAP
Use the following procedures for configuring or verifying one or more systems for the installation of SAP NetWeaver or SAP HANA
5.1. Verifying the version of RHEL System Roles for SAP
Use the following steps to display the role path which is used when running the role so that you can verify if it is corresponding to the installed version.
Procedure
Run the command (replace
PLAYBOOK.YMLby the actual name of the playbook andHOSTNAMEby the name of the managed node):# ansible-playbook PLAYBOOK.YML -l HOSTNAME --step -vvAnswer the first question with "N":
Perform task: TASK: Gathering Facts (N)o/(y)es/(c)ontinue:NAnswer the second question with "y":
Perform task: TASK: sap-preconfigure : include os specific vars (N)o/(y)es/(c)ontinue:y
Verification
This will display the absolute path name of file
tasks/main.ymland then abort the play (because the vars file could not be found). Example output:TASK [sap-preconfigure : include os specific vars] **************************************************************************** task path: /usr/share/ansible/roles/sap-preconfigure/tasks/main.yml:3 fatal: [HOSTNAME]: FAILED! => {"msg": "No file was found when using first_found. Use errors='ignore' to allow this task to be skipped if no files are found"}
5.2. Preparing the control node
Use the following steps to display the system messages in English. RHEL System Roles for SAP requires that the Ansible control node uses locale C or en_US.UTF-8
Procedure
Run the command on the local host to check the current setting.
# locale
The output should display either
Coren_US.UTF-8in the line starting withLC_MESSAGES=.If the command does not produce the expected output, run the following command on the local host before executing the
ansible-playbookcommand:# export LC_ALL=C
Or
# export LC_ALL=en_US.UTF-8
5.3. Configuring the local system
Use the following steps for preparing the local system for the installation of SAP NetWeaver
Prerequisites
- No production software running on the system
- A minimum of 20480 MB of swap space is configured on the local system
Procedure
Make a bakckup, if you would like to preserve the original configuration of the server.
NoteThese roles are run after the installation of RHEL, therefore a backup should not be required.
Create a YAML file named
sap-netweaver.ymlwith the following content:- hosts: localhost connection: local roles: - sap-preconfigure - sap-netweaver-preconfigureImportantThe correct indentation of 2 spaces in front of
roles:is essential.Run the RHEL System Roles
sap-preconfigureandsap-netweaver-preconfigureto prepare the managed nodes for the installation of SAP NetWeaver.# ansible-playbook sap-netweaver.yml
At the end of the playbook run, the command will report that a reboot is required because role
sap-preconfigurehas changed the SELinux state fromenabledtodisabled, according to SAP Note 2772999.Reboot the managed nodes so that the new SELinux state will become effective. If you set the role variable
sap_preconfigure_reboot_okto yes, the role will reboot the server as the last step of its execution.NoteBy changing role variable
sap_preconfigure_selinux_statefrom the defaultdisabledtopermissivebefore or at the time of running the playbook, you can have the rolesap-preconfigureset the SELinux state topermissive, which is also allowed for SAP NetWeaver on RHEL 8. See the Examples section in this document for more information on setting role variables.
5.4. Verifying the local system
Use the following steps to verify if the local system is configured correctly for installation of SAP NetWeaver.
RHEL System roles for SAP can also be used to verify that RHEL systems are configured correctly.
Prerequisites
- RHEL System Roles for SAP version 3
Procedure
Create a YAML file named
sap-netweaver.ymlwith the following content:- hosts: localhost connection: local vars: sap_preconfigure_assert: yes sap_preconfigure_assert_ignore_errors: yes sap_netweaver_preconfigure_assert: yes sap_netweaver_preconfigure_assert_ignore_errors: yes roles: - sap-preconfigure - sap-netweaver-preconfigureRun the following command:
# ansible-playbook sap-netweaver.yml
In case you would like to get a more compact output, you can filter the output to just display the essential FAIL or PASS information for each assertion. If you are using a terminal with dark background, replace all occurrences of color code
[30min the following command sequence by[37m. Otherwise, the output of some lines will be unreadable due to dark font on dark background.In case you accidentally ran the above command on a terminal with dark background, you can re-enable the default white font again with the following command:
# awk 'BEGIN{printf ("\033[37mResetting font color\n")}'
5.5. Configuring remote systems
Use the following steps for preparing one or more remote servers (managed nodes) for the installation of SAP HANA.
Prerequisites
- Verify that the managed nodes are correctly set up for installing Red Hat software packages from a Red Hat Satellite server or the Red Hat Customer Portal.
- Access via the ssh command to all managed nodes from the Ansible control node without using a password.
- No production software running on the system
Supported RHEL release for SAP HANA.
- For information on supported RHEL releases for SAP HANA, see SAP Note 2235581
Procedure
Make a backup, if you would like to preserve the original configuration of the server.
NoteThese roles are run after the installation of RHEL, therefore a backup should not be required.
Create an inventory file or modify file
/etc/ansible/hoststhat contains the name of a group of hosts and each host which you intend to configure (=managed node) in a separate line (example for three hosts in a host group namedsap_hana):[sap_hana] host01 host02 host03
Verify that you can log in to all three hosts using ssh without password:
# ssh host01 uname -a # ssh host02 hostname # ssh host03 echo test
Create a YAML file named
sap-hana.ymlwith the following content:- hosts: sap_hana roles: - sap-preconfigure - sap-hana-preconfigureImportantThe correct indentation (e.g. 2 spaces in front of
roles:) is essential.Run the RHEL System Roles
sap-preconfigureandsap-hana-preconfigureto prepare the managed nodes for the installation of SAP HANA.# ansible-playbook sap-hana.yml
NoteDo not run these roles against an SAP or other production system. The role will enforce a certain configuration on the managed node(s), which typically is intended only right after the installation of RHEL and before the initial installation of SAP software.
At the end of the playbook run, the command will report for each managed node that a reboot is required, for example because role sap-preconfigure has changed the SELinux state from
enabledtodisabled(as per requirement in SAP Note 2292690 or SAP Note 2777782).- Reboot the managed nodes
5.6. Verifying a remote system
Use the following steps to verify if a remote system is configured correctly for installation of SAP HANA. It is recommended to verify each host separately
RHEL System roles for SAP can also be used to verify that RHEL systems are configured correctly.
Prerequisites
- RHEL System Roles for SAP version 3
Procedure
- Verify each host
Create a YAML file named
sap-hana.ymlwith the following content:- hosts: all vars: sap_preconfigure_assert: yes sap_preconfigure_assert_ignore_errors: yes sap_hana_preconfigure_assert: yes sap_hana_preconfigure_assert_ignore_errors: yes roles: - sap-preconfigure - sap-hana-preconfigureRun the ansible-playbook command line option -l to specify the name of the remote host to verify.
# ansible-playbook sap-hana.yml -l host01