Ansible role for SAP software installation using SWPM
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
This role has been tested and working for the following scenarios
This role has been tested and working for the following SAP products
The general rule is - if the installation uses SAP SWPM then this Ansible Role can be used.
NOTE: This Ansible role is delivered by Red Hat with a support scope of Technology Preview only for the following deployment scenarios:
S/4HANA 2021 and S/4HANA 2022 single-host installation on x86_64: RHEL 8.4, 8.6, 9.0 and ppc64le: RHEL 8.4 and 8.6.
Only the default
role mode is supported.
All other functionality of this role is currently not supported by Red Hat.
Ensure the required volumes and filesystems are configured in the host. You can use the role sap_storage_setup
to configure this. More info here
Please run the RHEL SAP System Role sap_general_preconfigure
for initial host configuration; as necessary, also use sap_netweaver_preconfigure
and sap_hana_preconfigure
For further guidance on using SAP SWPM for different SAP Software installations, please see System Provisioning with Software Provisioning Manager (SWPM) - User Guides for SAP SWPM 1.0 and User Guides for SAP SWPM 2.0
SAPCAR executable
SWPM*.SAR
igs*.sar
igshelper*sar
SAPHOSTAGENT*SAR
SAPEXEDB_*SAR
SAPEXE_*SAR
IMDB_CLIENT*SAR
The inputs are critical for running this role
- Determines the installation type
- Incomplete parameters will result to failure
- Wrong parameters will result to failure
Create an input file which contains all relevant installation information.
Sample input files are stored in the inputs folder of this Ansible collection. Use the samples as guide for your desired installation
Please check the default parameters file for more information on other parameters that can be used as an input:
Sample Playbooks and sample parameters are shown in the Ansible Collection /playbooks
directory.
The Ansible Collection /playbooks
directory includes sample playbooks for using the sap_swpm
Ansible Role in the following ‘modes’:
The Ansible Collection /playbooks/vars
directory includes sample variable files for:
sap_swpm
‘Default mode’ to generate inifile.params of…
sap_swpm
‘Default Templates mode’ to generate inifile.params of…
sap_swpm
‘Advanced mode’ to generate inifile.params of…
sap_swpm
‘Advanced Templates mode’ to generate inifile.params of…
sap_swpm
‘Inifile Reuse mode’ inifile.params file for…
NOTE: these are only sample files, they are meant to be edited by the user before execution and do not cover all scenarios possible (the Ansible Role can execute ant SAP SWPM installation)
Sample Ansible Playbook Execution
ansible-playbook --connection=local --limit localhost -i "localhost," sap-swpm.yml -e "@inputs/S4H.install"
ansible-playbook -i "<target-host>" sap-swpm.yml -e "@inputs/S4H.install"
---
- hosts: all
become: true
roles:
- { role: sap_swpm }
Get SAPCAR executable filename from sap_swpm_sapcar_path
Get SWPM executable filename from sap_swpm_swpm_path
Get all .SAR filenames from sap_swpm_software_path
Update /etc/hosts
(optional - yes by default)
Apply firewall rules for SAP HANA (optional - no by default)
inifile.params
based on inputsSet expiry of Unix created users to ‘never’
Apply firewall rules for SAP NW (optional - no by default)
Every SAP Software installation via SAP Software Provisioning Manager (SWPM) is possible, there are different Ansible Role execution modes available:
sap_swpm_templates_product_input: default
), run software install tasks using easy Ansible Variable to generate SWPM Unattended installations
sap_swpm_templates_product_input: default_templates
), optional use of templating definitions for repeated installationssap_swpm_templates_product_input: advanced
), run software install tasks with Ansible Variables one-to-one matched to SWPM Unattended Inifile parameters to generate bespoke SWPM Unattended installations
sap_swpm_templates_product_input: advanced_templates
), optional use of templating definitions for repeated installationssap_swpm_templates_product_input: inifile_reuse
), run previously-defined installations with an existing SWPM Unattended inifile.paramsExample using all inifile list parameters with the Default Templates mode to install SAP ECC EhP8 on IBM Db2:
sap_swpm_ansible_role_mode: default_templates
sap_swpm_templates_product_input: default_templates
sap_swpm_templates_install_dictionary:
template_name_ecc_ehp8_ibmdb2:
sap_swpm_product_catalog_id: NW_ABAP_OneHost:BS2016.ERP608.DB6.PD
sap_swpm_inifile_dictionary:
sap_swpm_sid:
...
sap_swpm_inifile_list:
- swpm_installation_media
- swpm_installation_media_swpm1
- swpm_installation_media_swpm1_exportfiles
- swpm_installation_media_swpm1_ibmdb2
- sum_config
- credentials
- credentials_anydb_ibmdb2
- db_config_anydb_all
- db_config_anydb_ibmdb2
- db_connection_nw_anydb_ibmdb2
- nw_config_anydb
- nw_config_other
- nw_config_central_services_abap
# - nw_config_central_services_java
- nw_config_primary_application_server_instance
- nw_config_ports
- nw_config_host_agent
# - nw_config_post_abap_reports
- sap_os_linux_user
With the following tags, the role can be called to perform certain activities only:
sap_swpm_generate_inifile
: Only create the sapinst inifile. This can be useful for checking if the inifile is created as desired.sap_swpm_sapinst_commandline
: Only show the sapinst command line.sap_swpm_pre_install
: Perform all preinstallation steps, then exit.sap_swpm_setup_firewall
: Only perform the firewall preinstallation settings (but only if variable sap_swpm_setup_firewall
is set to true
).sap_swpm_update_etchosts
: Only update file /etc/hosts
(but only if variable sap_swpm_update_etchosts
is set to true
).Apache license 2.0
IBM Lab for SAP Solutions, Red Hat for SAP Community of Practice, Jason Masipiquena, Sean Freeman, Bernd Finger, Markus Koch