Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
This blog post describes how to install SAP S/4HANA and SAP HANA on IBM Power Systems using Red Hat Ansible Engine as well as Red Hat Ansible Tower. The goal is to automate the installation of SAP S/4HANA and SAP HANA.

Red Hat Ansible is a powerful command line interface (CLI) automation engine that can automate IT tasks. Red Hat Ansible uses simple YAML syntax to describe a desired configuration, offers secure access to remote systems and integrates with other solutions. For more information about Red Hat Ansible see Red Hat Ansible documentation.

Red Hat Ansible Tower is a web-based console designed to make Red Hat Ansible adaptable for IT teams. Red Hat Ansible Tower helps IT teams to scale automation, roll-out updates, build configurations, organize inventory management, and job scheduling. Red Hat Ansible Tower comes with a web interface and a REST API that can be embedded into other IT processes and tools. The Red Hat Ansible Tower web-based user interface shows overview dashboards about all job exit status, successful and failed playbook runs, status of host inventories, a role-based access control, and a permission system for running playbooks. For more information see Red Hat Ansible Tower documentation.

The following figure shows two techniques to install SAP software. The first is the installation of SAP software using Red Hat Ansible CLI and the second is the installation of SAP software using Red Hat Ansible Tower. You can use either one of them although depends on your skill set and purpose for use. To install SAP HANA, SAP S/4HANA and SAP NetWeaver, you need to install prerequisites that are specific to Red Hat Enterprise Linux operating system (OS) for target systems like IBM Power Systems; then run SAP installer and SAP product packages. These tasks are automated with Red Hat Ansible CLI or Red Hat Ansible Tower.


Red Hat Ansible CLI vs Red Hat Ansible Tower


The blog post series of Marcos Entenza "Automating your SAP HANA and S/4HANA by SAP deployments using Ansible" describes how to use Red Hat Ansible automation to deploy SAP Solutions on other hardware architecture.

Customer value


Deploying SAP software is requiring SAP admin skill level. Powerful tooling allows to handle
complex deployment scenarios encapsulating this SAP admin skill level in ease-of-use
automation workflows. As an option, Red Hat Ansible can be a choice for this job. You do not
need to program extensive shell scripts because there are already developed open source
packages called Ansible Roles that can be reused from Ansible Galaxy community. Red Hat
Ansible configuration files called playbooks contain instructions for the Red Hat Ansible
Engine. They are written in YAML like key-value pairs hence you do not need to learn a new
programming language. The configuration of required prerequisites and specific
configurations for SAP S/4HANA and SAP HANA has been implemented and published by
the Red Hat Enterprise Linux community.

Red Hat Ansible Tower is a web-based GUI solution to automate the installation of SAP S/4HANA and SAP HANA on IBM Power Systems. Red Hat Ansible Tower offers a graphical dashboard and a navigation menu to show your host status and configuration, to navigate to your job runs and templates, to show your projects and so on. Therefore, using Red Hat Ansible Tower visual user interface (UI) and with a few clicks, you can create a new job template to automate the complete SAP software installation.

Red Hat Ansible runs commands by way of SSH. Therefore, you do not need to install additional software on your server to implement authentication for client hosts. The following table shows many of the features using Red Hat Ansible CLI or Red Hat Ansible Tower:









































































Key value Red Hat Ansible CLI Red Hat Ansible Tower
Open-source automation tool + -
Free for commercial use Yes, under respect the policies of General Public License Yes with trial license
usability CLI for those who are familiar with using command-line tools Web-based GUI that easy to use and navigate
Easy to install and set up + +
Helps to check if your system has been configured correctly before installation of prerequisites and SAP software + +
Automate installing prerequisites and additional packages before starting to install SAP software + +
Automate multiple SAP software installations by running at least 1 script By command execution By clicking a button
Helps scaling up by adding new hosts, building host groups, adding multiple Red Hat Ansible nodes + +
Shows each task step within execution SAP software installation + +
Managing access permission for different roles By way of the CLI By way of the Dashboard
Monitoring host statuses and job runs in real time + +
Helps to automate, deploy, monitor applications in complex environments + +
Configuration for sending of notifications about automation status + +

We summarized all key points and advantages by using Red Hat Ansible CLI or Red Hat Ansible Tower for installing SAP HANA and SAP S/4HANA on IBM Power Systems.

Use case - unattended installation of SAP reference and test systems


This blog post describes the unattended installation of a single LPAR SAP standard system. This ansible based installation of SAP S/4HANA or SAP NetWeaver and the SAP HANA database on a single server is used for example, for installing reference and test systems.

The following SAP instances are installed:



























SAP Instance Instance ID Instance name SAPSID
SAP HANA database 20 HDB20 ABD
ABAP Central Service Instance (ASCS instance) 21 ASCS21 AB1
Primary Application Server Instance (PAS instance) 22 D22 or DVEBMGS22 or AB1

The chosen SAP instance ID and SAPSIDs are examples only and customizable by way of variables.

These values are used throughout this configuration which you can adapt for your system:

  • LPAR host name <yourhostname>

  • Directory for installation files /data/installer

  • Password like XXpasswd1are placeholders for the real passwords


Two approaches are explained here, the Red Hat Ansible command line and the Red Hat Ansible Tower setup. If the command line interface is enough, use it and skip the Red Hat Ansible Tower description. If you are aiming for the Red Hat Ansible Tower setup, we recommend to first start with the Red Hat Ansible command line setup, verify all settings are working and then continue with the Red Hat Ansible Tower setup.

Preconfiguration and setting up the environment


This blog post assumes that the following system requirements are met:

  • Set up your LPAR on IBM Power Systems: POWER8 or higher (little endian, linuxppc64le).

  • Install Red Hat Enterprise Linux V8 or later, see the description on how to do that here.

  • Check your LPAR has available operating system software repositories.

  • Update all packages on your system.

  • Provide SSH root access on the target host to install SAP software.

  • Install the latest version of Python.

  • Download the SAP installer and the SAP product packages to the target host.

  • To avoid the reboot handler error check that SELinux is set to targeted and permissive.

  • The prereq checker sap-netweaver-preconfigure requires at least 20 GB of swap space configured for SAP NetWeaver and SAP S/4HANA installations.


Before starting to work with Red Hat Ansible, you need to check that all machines and hosts are configured correctly.








:bulb:Hint:

If your root file system space is limited and a single large file system is mounted for the SAP application, you must link the various locations the SAP application is stored to the single, large volume.

For example:

If the large volume is mounted at /data, then it is advisable to create symbolic links from these directories to the new volume before starting the installation:
$ ls -ld /sapmnt /hana /usr/sap
lrwxrwxrwx 1 root root 10 May 6 14:31 /hana -> /data/hana
lrwxrwxrwx 1 root root 12 May 6 14:31 /sapmnt -> /data/sapmnt
lrwxrwxrwx 1 root root 13 May 6 14:30 /usr/sap -> /data/usr_sap


 








:warning: Note:

The Community Roles come with a playbook sap_hostagent/tasks/deploy_sar.yml that does not run remotely. With this change the playbook can be started on a remote machine, which is essential for example, when using Red Hat Ansible Tower. This can be fixed buy adding two remote_src: yes lines in the code:
- name: Copy SAR based SAPHOSTAGENT to the target host
copy:
...
remote_src: yes

- name: Copy SAPCAR tool to the target host
copy:
...
remote_src: yes


 








:warning: Need to repeat the playbook? Do a SAP uninstall first!

In case of typos or errors a playbook run can fail.

The current set of playbooks do not use the resume option of the SAP installer. To start again, after a failed attempt, follow these steps:

  1. Correct the errors or typos in variables and/or playbooks.

  2. Uninstall all SAP instances you intended to install.

  3. Check no SAP processes that contain your SAPSID are running on your target system (especially sapstartsrv processes).


You do not need to remove SAP related UNIX user or group accounts of a SAP instance - they can be reused without errors. In other words, clean up your system, so the playbooks can start a full SAP install.

 

Installing SAP software with Red Hat Ansible CLI


Getting started


Installing Red Hat Ansible CLI is easy, just use a package installer like yum on your development environment. We install Red Hat Ansible CLI on Red Hat Enterprise Linux V8.1:
   sudo yum install ansible

If you have a different platform than Red Hat Enterprise Linux check this installation guide.

To implement your configuration for installing SAP software you need to define a playbook. Red Hat Ansible playbooks are configuration files written in YAML and contain all the information about target system requirements, tasks, variables and so on. If you have a large system environment and you need to automate many processes on multiple machines, divide your configuration into different files. This bundle of files is defined as Ansible Roles. They are reusable components and can be included inside any playbook. Ansible Roles are stored in their own repository called Ansible Galaxy.
For the SAP software deployment, we are using two sets of Ansible Roles:

Ansible Galaxy CLI will be used later to retrieve these two packages. Before start writing playbooks, you need to create a working directory where these will be stored. For example, the following is the project directory which will store files and configuration files:
deploy_netweaver_and_hana_on_ibm_power_project/ 
├──group_vars/
│ └──sapservers.yml
├──host_vars/
│ └──<yourhostname>.yml
├──roles/
│ └──(download described below)
├──hosts
├──requirements.yml
└──sap-deploy.yml

Red Hat Ansible inventory


Red Hat Ansible manages hosts and host groups with the ansible inventory. Based on the ansible inventory, you can define which SAP software component is installed on which host group. An Ansible inventory file can have different formats, depending on your inventory plugins. The most used are INI and YAML. Refer to the Ansible user guide for more detailed information. The community roles mentioned above use two hosts, one host for SAP S/4HANA and other host for SAP HANA. In our setup, SAP S/4HANA and SAP HANA are installed on one machine <yourhostname>, but the structure is kept in the event you want to divide the installation.

The Ansible inventory file hosts in INI format with joined groups 'hana' and 's4hana' points to the same hostname <yourhostname> and looks like this:
  #inventory for servers

[sapservers:children]
hana
s4hana

[hana]
<yourhostname>

[s4hana]
<yourhostname>

To run a playbook, add -i option and directory path to tell Red Hat Ansible where your inventory file is located. To test if all defined hosts are accessible to Red Hat Ansible, try to ping your machines:
  ansible all -i /path/to/your/inventory/file -m ping

This command displays a result for all host machines available for SAP installation. If some host is not accessible from a remote machine, check your host credentials, SSH settings like SSH private key and so on. If the SSH private key requires a passphrase, you need to specify it in your inventory file. To avoid this complexity use SSH private key without the passphrase.

General installation definitions


SAP Host installation settings, SAP Domain and other settings, that are general to all hosts of the group sapservers are stored in a group variable file group_vars/sapservers.yml

SAP host agent software is installed on all hosts, therefore these SAP host agent settings are defined in the group variable file:

  • SAP host agent installation type

  • SAP host agent paths and file names


The SAP installer sapinst needs an host entry in /etc/hosts to resolve your hostname. You can either create a manual entry in order <ip> <full qualified domain name> <short hostname> and set sap_preconfigure_modify_etc_hosts: false. Alternatively ansible can add the host name entry, if you set the variable sap_preconfigure_modify_etc_hosts: true and add the hosts DNS domain in variable sap_domain:.

The group variable file sapservers.yml file in group_vars directory looks as follows:
  #Defined variables for sap_hostagent role
sap_hostagent_installation_type: "sar"
sap_hostagent_sar_local_path: "/data/installer/S4HANA1909FPS01"
sap_hostagent_sar_file_name: "SAPHOSTAGENT46_46-70002261.SAR"
sap_hostagent_sapcar_local_path: "/data/installer/S4HANA1909FPS01"
sap_hostagent_sapcar_file_name: "SAPCAR.EXE"
sap_hostagent_clean_tmp_directory: true

#Defined variables for sap_preconfigure role
sap_preconfigure_selinux_state: permissive
# If you need to modify your host names set up it as true
sap_preconfigure_modify_etc_hosts: false
# define the SAP domain name only if you set 'sap_preconfigure_modify_etc_hosts: true'
#sap_domain: "subdomain.enterprise-domain-name.com"

Fill out the role variables where you define the installer local path, the SAPCAR tool path, and the name of the SAR file.








:warning: Note:

The filename for the SAPCAR tool cannot be "SAPCAR" since this file is also inside the host agent SAR file and an error will occurs when the file already exists while extracting this tool. We recommend to rename the SAPCAR tool to "SAPCAR.EXE" or "SAPCAR_<version>.EXE" and specify this name as value of the variable sap_hostagent_sapcar_file_name.

For more information look into the github repository where the roles are implemented:

 SAP HANA and SAP S/4HANA specific definitions


SAP HANA and SAP S/4HANA host specific settings such as:

  • Software installation source paths

  • Installer file name

  • SAPSIDs

  • ...


are stored in the Red Hat Ansible host variable file host_vars/<yourhostname>.yml

To keep this demonstration simple, passwords are added to the host variables not encrypted. This is meant for a simple and quick start of a working setup.








:warning: Ansible password vault

In production environments, sensitive information such as passwords must be moved to an encrypted Ansible-Vault instead. For more information, refer to the ansible user guide section Encrypting content with Ansible Vault and the description of the command line tool ansible-vault.

 

The host variable <yourhostname>.yml file in host_vars directory looks as follows:
  #Defined variables for SAP HANA deployment
# the following two lines must be changed in sync with two lines below:
# sap_hana_deployment_hana_sid = sap_s4hana_deployment_db_sid
# sap_hana_deployment_hana_instance_number = sap_s4hana_deployment_hana_instance_nr
sap_hana_deployment_hana_sid: "ABD"
sap_hana_deployment_hana_instance_number: "20"
sap_hana_deployment_bundle_path: "/data/installer/S4HANA1909FPS01"
sap_hana_deployment_bundle_sar_file_name: "IMDB_SERVER20_047_0-80002046.SAR"
sap_hana_deployment_sapcar_path: "/data/installer/SAPCAR"
sap_hana_deployment_sapcar_file_name: "SAPCAR.EXE"
sap_hana_deployment_root_password: "XXpasswd1"
sap_hana_deployment_sapadm_password: "XXpasswd1"
sap_hana_deployment_hana_env_type: development
sap_hana_deployment_hana_mem_restrict: "n"
sap_hana_deployment_common_master_password: "XXpasswd3"
sap_hana_deployment_sidadm_password: "XXpasswd1"
sap_hana_deployment_hana_db_system_password: "XXpasswd2"
sap_hana_deployment_ase_user_password: "XXpasswd4"
sap_hana_deployment_apply_license: false

#Defined variables for S/4HANA deployment
sap_s4hana_deployment_product_id: "NW_ABAP_OneHost:S4HANA1909.CORE.HDB.ABAP"
sap_s4hana_deployment_sapcar_path: "/data/installer/SAPCAR"
sap_s4hana_deployment_sapcar_file_name: "SAPCAR.EXE"
sap_s4hana_deployment_swpm_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_swpm_sar_file_name: "SWPM20SP05_5-80003426.SAR"

sap_s4hana_deployment_sid: "AB1"
sap_s4hana_deployment_ascs_instance_nr: "21"
sap_s4hana_deployment_pas_instance_nr: "22"
sap_s4hana_deployment_db_host: "<yourhostname>"
# these two lines must be changed in sync with the sap_hana settings above:
sap_s4hana_deployment_db_sid: "ABD"
sap_s4hana_deployment_hana_instance_nr: "20"

sap_s4hana_deployment_db_schema_password: "XXpasswd"
sap_s4hana_deployment_db_schema_abap_password: "XXpasswd"
sap_s4hana_deployment_master_password: "XXpasswdM"
sap_s4hana_deployment_hana_systemdb_password: "xxPasswd"
sap_s4hana_deployment_hana_system_password: "xxSystemPsw"
sap_s4hana_deployment_parallel_jobs_nr: "30"
sap_s4hana_deployment_db_sidadm_password: "yourPasswd"

sap_s4hana_deployment_igs_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_igs_file_name: "igsexe_10-80003246.sar"
sap_s4hana_deployment_igs_helper_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_igs_helper_file_name: "igshelper_17-10010245.sar"

sap_s4hana_deployment_kernel_dependent_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_kernel_dependent_file_name: "SAPEXEDB_100-80004417.SAR"

sap_s4hana_deployment_kernel_independent_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_kernel_independent_file_name: "SAPEXE_100-80004418.SAR"
sap_s4hana_deployment_software_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_sapadm_password: "spAdmpass1"
sap_s4hana_deployment_sap_sidadm_password: "spAdmpass2"

These role variables are defined under:

Get Community and System Roles from Red Hat Ansible Galaxy - requirements.yml


According to SAP Note 2772999 there are prerequisites such as packages, system settings and others. These prerequisites have to be implemented before installing and running SAP systems. These prerequisites are implemented as Ansible Roles and can be used to configure all required changes on the Red Hat target server. For Red Hat Enterprise Linux V8.1, the following three prerequisites Red Hat Enterprise Linux System Roles for SAP need to be applied:

  • sap-preconfigure

  • sap-netweaver-preconfigure

  • sap-hana-preconfigure


Additionally community roles for SAP software deployment are required:

  • sap-hostagent

  • sap-s4hana-deployment

  • sap-hana-deployment


You install both package groups in one step. Therefore your file requirements.yml will contain two files described in Automating your SAP HANA and S/4HANA by SAP deployments using Ansible – Part 2 and Automating your SAP HANA and S/4HANA by SAP deployments using Ansible – Part 3.

These roles are available in Red Hat's Community repositories and in Ansible Galaxy. You can choose which source will be defined in your playbook. For our example, we add all required Ansible Roles in the playbook requirements.yml:
#From GitHub repository:
- src: https://github.com/linux-system-roles/sap-preconfigure.git
- src: https://github.com/linux-system-roles/sap-hana-preconfigure.git
- src: https://github.com/linux-system-roles/sap-netweaver-preconfigure.git
#From Ansible Galaxy repository:
- name: redhat_sap.sap_hostagent
- name: redhat_sap.sap_hana_deployment
- name: redhat_sap.sap_s4hana_deployment

Before the ansible-galaxy command can be used to download files from GitHub, check that Git software is installed in your machine. If it is not installed, run the following command:
   sudo yum install git

Now install all required roles in the directory roles by running the Ansible Galaxy command:
   ansible-galaxy install -r requirements.yml -p roles

SAP Software Deployment - sap-deploy.yml


Finally, create a playbook sap-deploy.yml, that includes all required system preparation and community software deployment rules:
 ---
- hosts: sapservers
roles:
- { role: redhat_sap.sap_hostagent }
- { role: sap-preconfigure }
- hosts: hana
roles:
- { role: sap-hana-preconfigure }
- { role: redhat_sap.sap_hana_deployment }
- hosts: s4hana
roles:
- { role: sap-netweaver-preconfigure }
- { role: redhat_sap.sap_s4hana_deployment }

To start the automation deployment, run the playbook sap-deploy.yml:
ansible-playbook -i hosts sap-deploy.yml

After the playbook finished without errors, SAP host agent, SAP HANA and SAP S/4HANA are installed on '<yourhostname>'.

Installing SAP software with Red Hat Ansible Tower


Start with Red Hat Ansible Tower


To use Red Hat Ansible Tower for the unattended Ansible installation, you will need:

  • A host with Red Hat Ansible Tower installed

  • A Red Hat Ansible Automation Platform license, you can try a trial license 60 days for free

  • A Red Hat Ansible Tower user account with

    • Administrative permissions to edit your Tower inventory and project (need to be created once)

    • Permissions to create Tower templates and credentials



  • A working SSH connection from Red Hat Ansible Tower Server to your SAP installation target system


The following first steps configuring Red Hat Ansible Tower are:

  • Define your Inventory by adding group(s) and host(s) into the configuration if needed.

  • Create or choose the credential for Ansible Tower to connect to and execute Red Hat Ansible playbooks.

  • Create or choose one project that will be used for your playbook to run the SAP software installation.

  • Create template that contains the playbook and installation parameters.


These steps are now explained in more detail.

Set up directory for ansible roles


A local directory on the Red Hat Ansible Tower server is used as file storage instead of a git source code management repository to archive two goals:

  • A single, combined repository for all Red Hat system - and Community roles.

  • Option to customize roles to enable execution from Red Hat Ansible Tower server.


Create target directory on Red Hat Tower server

Create a directory on the Red Hat Tower server as target directory for the ansible roles:
REPOS=/var/lib/awx/projects
sudo mkdir $REPOS/sap_installation

Assign directory ownership to your UNIX user account:
sudo chown $LOGNAME: $REPOS/sap_installation

Ensure the new directory is accessible by assigning execute permissions to the parent directory:
sudo chmod o+x $REPOS

The new directory is now ready to be filled with content.
Prepare a custom repository

The installation target machine <yourhostname> can be used to prepare a storage space for all ansible roles first and then copy files to the Tower server.

When ready, our roles directory structure will look like this:
sap_installation/ 
├──roles/
│ └──(download described below)
└──sap-deploy.yml

As a first step, ensure the desired software is installed on the Red Hat system, for example <yourhostname>:
yum install -y git ansible 

Create a working folder sap_installation:
mkdir ~/sap_installation
cd ~/sap_installation

Create a file sap-deploy.yml with the following content:
---
- hosts: "{{ sap_hostagent_hostname }}"
roles:
- { role: sap-preconfigure }
- { role: redhat_sap.sap_hostagent }
- hosts: "{{ sap_hana_hostname }}"
roles:
- { role: sap-hana-preconfigure }
- { role: redhat_sap.sap_hana_deployment }
- hosts: "{{ sap_s4hana_hostname }}"
roles:
- { role: sap-netweaver-preconfigure }
- { role: redhat_sap.sap_s4hana_deployment }

The three host variables sap_hostagent_hostnamesap_hana_hostname and sap_s4hana_hostname will be defined in the Red Hat Tower graphical user interface later.

Create a second file requirements.yml containing:
#From GitHub repository:
- src: https://github.com/linux-system-roles/sap-preconfigure.git
- src: https://github.com/linux-system-roles/sap-hana-preconfigure.git
- src: https://github.com/linux-system-roles/sap-netweaver-preconfigure.git
#From Ansible Galaxy repository:
- name: redhat_sap.sap_hostagent
- name: redhat_sap.sap_hana_deployment
- name: redhat_sap.sap_s4hana_deployment

Download all roles by executing:
ansible-galaxy install -r requirements.yml -p roles

All roles are now together in a single storage location.

As of today the playbook deploy_sar.yml file must be patched to include remote_src: yes. Check if your version needs this change by executing:
grep "remote_src:" -B2 roles/redhat_sap.sap_hostagent/tasks/deploy_sar.yml

Only if the last command did not find the parameter (there is no output), then execute this command:
sed -i.bak 's/copy:/copy:\n    remote_src: yes/' roles/redhat_sap.sap_hostagent/tasks/deploy_sar.yml

The last command adds the required remote_src option to the copy commands, which is required to copy files when started from Red Hat Tower server.

The combined and modified ansible rules set are now ready and can be copied to the Tower server:
scp -r sap-deploy.yml roles  <toweruser>@<towerserver>:/var/lib/awx/projects/sap_installation/

Note the file requirements.yml is intentionally not copied to avoid accidentally overwriting customized rules by automatically downloading them again.

Set up project


Red Hat Ansible Tower uses projects as a logical collection of one or more Red Hat Ansible Playbooks.

Using the Red Hat Tower web interface creates a new project. Select Projects on the left navigation bar, click the green plus-button on the right top corner.


Red Hat Ansible Tower - Project


To set up a project:

  • Define a project name.

  • Enter a project description.

  • Choose Manual as scm type which allows the local directory as repository source.

  • Leave the default project base path as is.

  • Select the sap_installation directory as playbook directory from the drop-down list.


Set up inventory


An inventory in Red Hat Ansible Tower contains hosts and groups - just as the Red Hat Ansible inventory on command line does - but was extended for the Tower web interface with fields for organization, user permissions, and more. For more information see Red Hat Ansible Tower documentation.

Click Inventories on the left navigation bar and create with the plus-button a new inventory if you do not have one. Define the properties that will be used:


Red Hat Ansible Tower - Inventory


The current setup description does not use groups as with a standard SAP setup all instances are installed on one host.

Then add your host with a click on the plus-button in the tab Hosts:


Red Hat Ansible Tower - Inventory Hosts


With Red Hat Ansible Tower variables can be defined at different locations. This setup uses extra variables defined in the template. Extra variables will overwrite all values defined for the same variable at other locations - see table shown in section Ansible Tower variable precedence hierarchy of the Red Hat Ansible Tower documentation.

For this reference system all installation parameters are stored in template variables, described in section Set up template below.

After saving the new inventory, proceed by configuring permissions for users and team members. For more details about how to configure your inventory, read the Red Hat Ansible Tower documentation.

Set up target host credentials


Red Hat Ansible Tower uses credentials for authentication and building connections to remote hosts when jobs will be executed on machines to install SAP software. For this purpose, you need to set up your host credentials such as user name, password, an existing SSH key in Red Hat Ansible Tower. If you do not have an SSH key, you can use the ssh-keygen tool to generate one on the target host and then copy it to the Red Hat Ansible Tower credentials. Click Credentials from the left navigation panel and you see the page that displays all available credentials.

Create a new credential by pressing the green plus-button on the top right corner.


Red Hat Ansible Tower - Credentials


Define the SAP application installation host credentials:

  • Enter a hostname like yourhostname.

  • Enter a description like SAP S/4HANA reference system.

  • Use Machine as credential type.

  • Enter root username for installation.

  • Password to be used for SSH authentication.

  • SSH private key and if used, the passphrase for your key.


The SSH key is used when copying files and username + password to execute the playbook on the target host. The Red Hat Ansible Tower documentation provides a detailed explanation for this step.

Define Job template


A job template defines the parameters used to execute ansible playbooks. Refer to job templates documentation for more information.

Select Template from the left navigation and click the green plus-button on the top right corner to create a new template.


Red Hat Ansible Tower - Job Template


Fill in the required and optional fields:

  • Template Name like SAP S4HANA <yourhostname>.

  • Template Description like SAP S4/HANA and HANA Installation on <yourhostname>.

  • Select Run as Job Type.

  • Select SAP S4HANA System Inventory from Inventory drop-down list.

  • Select SAP install tower project from Project drop-down list.

  • Select sap-deploy.yml from Playbook drop-down list.

  • Click the check mark for your machine credentials like SAP S4HANA machine credentials as credential.

  • verbosity of 3 (Debug) might be initially helpful and should be later set 0 (Normal).

  • At the bottom add extra variables as described below.


There are many more settings like permissions, notifications, ... which can be added if required.

In the field Extra Variables add the host variables as key-value pairs using YAML syntax. For demonstration purposes we do not encrypt our sensitive content like username and passwords. In a production environment it must be encrypted before being used as a variable. Ansible Vault provides an easy way to encrypt a string or file, check for more information Ansible Vault documentation.

The job template variables for the SAP software installation are defined as follows:
---
# Modify server name, paths, filenames, SAPSIDs and Instance Numbers as needed

sap_hostagent_hostname: <yourhostname>
sap_hana_hostname: <yourhostname>
sap_s4hana_hostname: <yourhostname>

# SAP instance installation parameters
# the following two lines must be changed in sync with two lines below:
# sap_hana_deployment_hana_sid = sap_s4hana_deployment_db_sid
# sap_hana_deployment_hana_instance_number = sap_s4hana_deployment_hana_instance_nr
sap_hana_deployment_hana_sid: "ABD"
sap_hana_deployment_hana_instance_number: "20"

# Variables required for `sap_preconfigure` role
sap_preconfigure_selinux_state: permissive
# If you need to modify your host names set up it as true
sap_preconfigure_modify_etc_hosts: false
# define the SAP domain name only if you set 'sap_preconfigure_modify_etc_hosts: true'
# sap_domain: "yoursubdomain.enterprise-domain-name.com"

#Common variables required for sap hostagent role
sap_hostagent_installation_type: "sar"
sap_hostagent_sar_local_path: "/data/installer/S4HANA1909FPS01"
sap_hostagent_sar_file_name: "SAPHOSTAGENT46_46-70002261.SAR"
sap_hostagent_sapcar_local_path: "/data/installer/S4HANA1909FPS01"
sap_hostagent_sapcar_file_name: "SAPCAR.EXE"
sap_hostagent_clean_tmp_directory: true

#Defining specific variables to be used for SAP HANA database deployment
sap_hana_deployment_bundle_path: "/data/installer/S4HANA1909FPS01"
sap_hana_deployment_bundle_sar_file_name: "IMDB_SERVER20_047_0-80002046.SAR"
sap_hana_deployment_sapcar_path: "/data/installer/SAPCAR"
sap_hana_deployment_sapcar_file_name: "SAPCAR.EXE"
sap_hana_deployment_root_password: "XXpasswd1"
sap_hana_deployment_sapadm_password: "XXpasswd1"
sap_hana_deployment_hana_env_type: development
sap_hana_deployment_hana_mem_restrict: "n"
sap_hana_deployment_common_master_password: "XXpasswd3"
sap_hana_deployment_sidadm_password: "XXpasswd1"
sap_hana_deployment_hana_db_system_password: "XXpasswd2"
sap_hana_deployment_ase_user_password: "XXpasswd4"
sap_hana_deployment_apply_license: false

#Variables to be used for S/4HANA deployment

sap_s4hana_deployment_product_id: "NW_ABAP_OneHost:S4HANA1909.CORE.HDB.ABAP"
sap_s4hana_deployment_sapcar_path: "/data/installer/SAPCAR"
sap_s4hana_deployment_sapcar_file_name: "SAPCAR.EXE"
sap_s4hana_deployment_swpm_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_swpm_sar_file_name: "SWPM20SP05_5-80003426.SAR"

sap_s4hana_deployment_sid: "AB1"
sap_s4hana_deployment_ascs_instance_nr: "21"
sap_s4hana_deployment_pas_instance_nr: "22"
sap_s4hana_deployment_db_host: "<yourhostname>"
# The following two lines must be changed in sync with two lines below:
# sap_hana_deployment_hana_sid = sap_s4hana_deployment_db_sid
# sap_hana_deployment_hana_instance_number = sap_s4hana_deployment_hana_instance_nr
sap_s4hana_deployment_db_sid: "ABD"
sap_s4hana_deployment_hana_instance_nr: "20"

sap_s4hana_deployment_db_schema_password: "XXpasswd"
sap_s4hana_deployment_db_schema_abap_password: "XXpasswd"
sap_s4hana_deployment_master_password: "XXpasswdM"
sap_s4hana_deployment_hana_systemdb_password: "xxPasswd"
sap_s4hana_deployment_hana_system_password: "xxSystemPsw"
sap_s4hana_deployment_parallel_jobs_nr: "30"
sap_s4hana_deployment_db_sidadm_password: "yourPasswd"
sap_s4hana_deployment_igs_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_igs_file_name: "igsexe_10-80003246.sar"
sap_s4hana_deployment_igs_helper_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_igs_helper_file_name: "igshelper_17-10010245.sar"
sap_s4hana_deployment_kernel_dependent_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_kernel_dependent_file_name: "SAPEXEDB_100-80004417.SAR"
sap_s4hana_deployment_kernel_independent_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_kernel_independent_file_name: "SAPEXE_100-80004418.SAR"
sap_s4hana_deployment_software_path: "/data/installer/S4HANA1909FPS01"
sap_s4hana_deployment_sapadm_password: "spAdmpass1"
sap_s4hana_deployment_sap_sidadm_password: "spAdmpass2"

It is a good idea to check every variable line in advance.








:warning: check variable content

You will especially need to verify and modify these settings:

  • hostname<youhostname> to your actual target host name.

  • file name and paths: depending on SAP installation software package, software version and local storage location on your target machine these are likely to change.

  • sapcar: Verify that a copy named SAPCAR.EXE of SAPCAR file is stored in the sapcar_path directory.

  • SAP SIDs and instance numbers: Match to your needs.

  • passwords: Change the example passwords.



In Template Extra Variables you can find more information on the variable precedence in Red Hat Ansible Tower if you have already used them in Red Hat Ansible CLI.

When you finish with the job template configuration, click Save and then Launch button to run the job:


If the job run is successful, a green color is shown otherwise is red. The Completed Jobs view shows the list of all job templates that run completed. From this tab you can also see the job status and detailed information. The Templates view provides the list of all defined job templates and with the rocket-button you can restart the job run:


Hence it is easy to use Red Hat Ansible Tower to run playbooks. In this document you can find more information about how to configure and launch the job template.

Conclusion


As you can see Red Hat Ansible CLI and Red Hat Ansible Tower can speed up your work productivity. These help to manage complex processes with job automation and scheduling. Red Hat Ansible Tower provides a dashboard to view every job run and status. It is easy to use because you have GUI and many features to support the automation process. You can also customize the Red Hat Ansible Tower for your need. If you are familiar with command line tools then Red Hat Ansible CLI is a perfect solution to use in infrastructure workflows. You can easily integrate Red Hat Ansible Engine with other building tools for continuous integration and deployment of systems. You can now use Red Hat Ansible to work efficiently and enhance productivity. For more information see the additional information below.

If you have any questions or comments about this blog post please leave your comment using the Add Comment button.

Additional Information

















































Reference Link
SAP Note 765424 - Linux: Released IBM Hardware - POWER based servers https://launchpad.support.sap.com/#/notes/765424
SAP Certified and Supported SAP HANA Hardware Directory - IBM Power Systems https://www.sap.com/dmc/exp/2014-09-02-hana-hardware/enEN/power-systems.html
Supported Linux distributions and virtualization options for POWER8 and POWER9 Linux on Power Systems https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaam/liaamdistros.htm
Red Hat Enterprise Linux System Roles https://github.com/linux-system-roles/
Community Roles https://github.com/redhat-sap
Ansible Galaxy Repository https://galaxy.ansible.com/redhat_sap
Installing Red Hat Ansible https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
Using Red Hat Ansible https://docs.ansible.com/ansible/latest/user_guide/index.html
Red Hat Ansible Tower docs https://docs.ansible.com/ansible-tower/latest/html/quickstart/create_job.html
Tower Licensing, Updates, and Support https://docs.ansible.com/ansible-tower/latest/html/installandreference/updates_support.html