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

  1. Run the command (replace PLAYBOOK.YML by the actual name of the playbook and HOSTNAME by the name of the managed node):

    # ansible-playbook PLAYBOOK.YML -l HOSTNAME --step -vv

  2. Answer the first question with "N":

    Perform task: TASK: Gathering Facts (N)o/(y)es/(c)ontinue: N

  3. Answer the second question with "y":

    Perform task: TASK: sap-preconfigure : include os specific vars (N)o/(y)es/(c)ontinue: y

Verification

  1. This will display the absolute path name of file tasks/main.yml and 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

  1. Run the command on the local host to check the current setting.

    # locale
  2. The output should display either C or en_US.UTF-8 in the line starting with LC_MESSAGES=.

    1. If the command does not produce the expected output, run the following command on the local host before executing the ansible-playbook command:

      # 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

  1. Make a bakckup, if you would like to preserve the original configuration of the server.

    Note

    These roles are run after the installation of RHEL, therefore a backup should not be required.

  2. Create a YAML file named sap-netweaver.yml with the following content:

    - hosts: localhost
      connection: local
      roles:
        - sap-preconfigure
        - sap-netweaver-preconfigure
    Important

    The correct indentation of 2 spaces in front of roles: is essential.

  3. Run the RHEL System Roles sap-preconfigure and sap-netweaver-preconfigure to 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-preconfigure has changed the SELinux state from enabled to disabled, according to SAP Note 2772999.

  4. Reboot the managed nodes so that the new SELinux state will become effective. If you set the role variable sap_preconfigure_reboot_ok to yes, the role will reboot the server as the last step of its execution.

    Note

    By changing role variable sap_preconfigure_selinux_state from the default disabled to permissive before or at the time of running the playbook, you can have the role sap-preconfigure set the SELinux state to permissive, 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

  1. Create a YAML file named sap-netweaver.yml with 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-preconfigure
  2. Run 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 [30m in 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.

Procedure

  1. Make a backup, if you would like to preserve the original configuration of the server.

    Note

    These roles are run after the installation of RHEL, therefore a backup should not be required.

  2. Create an inventory file or modify file /etc/ansible/hosts that 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 named sap_hana):

    [sap_hana]
    host01
    host02
    host03
  3. 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
  4. Create a YAML file named sap-hana.yml with the following content:

    - hosts: sap_hana
      roles:
        - sap-preconfigure
        - sap-hana-preconfigure
    Important

    The correct indentation (e.g. 2 spaces in front of roles:) is essential.

  5. Run the RHEL System Roles sap-preconfigure and sap-hana-preconfigure to prepare the managed nodes for the installation of SAP HANA.

    # ansible-playbook sap-hana.yml
    Note

    Do 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 enabled to disabled (as per requirement in SAP Note 2292690 or SAP Note 2777782).

  6. 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

  1. Verify each host
  2. Create a YAML file named sap-hana.yml with 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-preconfigure
  3. Run the ansible-playbook command line option -l to specify the name of the remote host to verify.

    # ansible-playbook sap-hana.yml -l host01