The Ansible role sap_swpm
installs various SAP Systems installable by SAP Software Provisioning Manager (SWPM).
fedora.linux_system_roles
- Roles:
selinux
- Roles:
Install required collections by ansible-galaxy install -vv -r meta/collection-requirements.yml
.
Managed nodes:
- Directory with SAP Installation media is present and
sap_swpm_software_path
updated. Download can be completed using community.sap_launchpad. - Ensure that servers are configured for SAP Systems. See Recommended section.
- Ensure that volumes and filesystems are configured correctly. See Recommended section.
Place a valid SAPCAR executable file in a directory specified by variable sap_swpm_sapcar_path
(e.g. /software/sapcar). Example: SAPCAR_1300-70007716.EXE
Place a valid SWPM SAR file in a directory specified by variable sap_swpm_swpm_path
(e.g. /software/sap_swpm). Example: SWPM20SP18_3-80003424.SAR
Place the following files in a directory specified by variable sap_swpm_software_path
(e.g. /software/sap_swpm_download_basket):
- For a new installation
- Download the appropriate software from SAP Software Download Center, Maintenance Planner, etc.
- For a restore or new installation
- SAP IGS -
igs*.sar
- SAP IGS HELPER -
igshelper*sar
- SAP Host Agent -
SAPHOSTAGENT*SAR
- SAP Kernel DB -
SAPEXEDB_*SAR
- SAP Kernel DB Independent -
SAPEXE_*SAR
- SAP HANA Client -
IMDB_CLIENT*SAR
- SAP IGS -
Alternatively, you can place all the files mentioned above into a single directory and use the role sap_install_media_detect to identify the required files and set the role variables automatically so that the role sap_swpm
has access to all the files needed for a successful installation of SAP System.
It is recommended to execute this role together with other roles in this collection, in the following order:
Note: For most scenarios, a database like SAP HANA must be available. Use the role sap_hana_install for installing the SAP HANA database.
-
Determine installation type
- The product id specified determines the installation type
- standard installation
- system restore
- generic product installation
- high availability installation
- The product id specified determines the installation type
-
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
-
(Optional) Update
/etc/hosts
ifsap_swpm_update_etchosts
is set totrue
(Default:false
). -
(Optional) Apply firewall rules for SAP HANA if
sap_swpm_setup_firewall
is set totrue
(Default:false
). -
At this stage, the role is searching for a sapinst inifile on the managed node, or it will create one:
-
If a file
inifile.params
is located on the managed node in the directory specified insap_swpm_inifile_directory
, the role will not create a new one but rather download this file to the control node. -
If such a file does not exist, the role will create an SAP SWPM
inifile.params
file by one of the following methods:Method 1: Predefined sections of the file
inifile_params.j2
will be used to create the fileinifile.params
. The variablesap_swpm_inifile_sections_list
contains a list of sections which will part of the fileinifile.params
. All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. Example: The inifile parameterarchives.downloadBasket
will be set to the content of the role parametersap_swpm_software_path
.Method 2: The file
inifile.params
will be configured from the content of the dictionarysap_swpm_inifile_parameters_dict
. This dictionary is defined like in the following example:
-
sap_swpm_inifile_parameters_dict:
archives.downloadBasket: /software/download_basket
NW_getFQDN.FQDN: example.com
It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: Define both of the related parameters, sap_swpm_inifile_sections_list
and sap_swpm_inifile_parameters_dict
.
- The file
inifile.params
is then transferred to a temporary directory on the managed node, to be used by the sapinst process.
- Execute SWPM. This and the remaining steps can be skipped by setting the default of the parameter
sap_swpm_run_sapinst
tofalse
.
-
Set expiry of Linux created users to 'never'
-
(Optional) Apply firewall rules for SAP Netweaver if
sap_swpm_setup_firewall
is set totrue
(Default:false
).
Playbook for installing a SAP ABAP ASCS instance in distributed system with sap_install_media_detect role
Example shows execution together with sap_install_media_detect role, which sets required variables for sap_swpm
role.
---
- name: Ansible Play for SAP ABAP ASCS installation in distributed system
hosts: nwas_ascs
become: true
any_errors_fatal: true
max_fail_percentage: 0
tasks:
- name: Execute Ansible Role sap_install_media_detect
ansible.builtin.include_role:
name: community.sap_install.sap_install_media_detect
vars:
sap_install_media_detect_swpm: true
sap_install_media_detect_hostagent: true
sap_install_media_detect_igs: true
sap_install_media_detect_kernel: true
sap_install_media_detect_webdisp: false
sap_install_media_detect_source_directory: /software
- name: Execute Ansible Role sap_swpm
ansible.builtin.include_role:
name: community.sap_install.sap_swpm
vars:
sap_swpm_sid: AE1
sap_swpm_virtual_hostname: ae1ascs
sap_swpm_ascs_instance_nr: "01"
sap_swpm_master_password: "Password@1" # Do not use, this is example only!
sap_swpm_ddic_000_password: "Password@1" # Do not use, this is example only!
sap_swpm_sapadm_uid: "3000"
sap_swpm_sapsys_gid: "3001"
sap_swpm_sidadm_uid: "3001"
sap_swpm_product_catalog_id: NW_ABAP_ASCS:NW750.HDB.ABAPHA
sap_swpm_inifile_sections_list:
- swpm_installation_media
- swpm_installation_media_swpm1
- credentials
- credentials_hana
- db_config_hana
- db_connection_nw_hana
- nw_config_other
- nw_config_central_services_abap
- nw_config_primary_application_server_instance
- nw_config_ports
- nw_config_host_agent
- sap_os_linux_user
sap_swpm_role_parameters_dict:
sap_swpm_install_saphostagent: 'true'
With the following tags, the role can be called to perform certain activities only:
- tag
sap_swpm_generate_inifile
: Only create the sapinst inifile, without running most of the preinstall steps. This can be useful for checking if the inifile is created as desired. - tag
sap_swpm_sapinst_commandline
: Only show the sapinst command line. - tag
sap_swpm_pre_install
: Perform all preinstallation steps, then exit. - tag
sap_swpm_setup_firewall
: Only perform the firewall preinstallation settings (but only if variablesap_swpm_setup_firewall
is set totrue
). - tag
sap_swpm_update_etchosts
: Only update file/etc/hosts
(but only if variablesap_swpm_update_etchosts
is set totrue
).
Apache 2.0
NOTE: Discontinued variables:
sap_swpm_ansible_role_mode
- Type:
bool
- Default:
true
Set to false
to disable execution of sapinst after creation of inifile.
- Type:
list
- Default:
sap_swpm_inifile_sections_list:
- swpm_installation_media
- swpm_installation_media_swpm2_hana
- credentials
- credentials_hana
- db_config_hana
- db_connection_nw_hana
- db_restore_hana
- nw_config_other
- nw_config_central_services_abap
- nw_config_primary_application_server_instance
- nw_config_ports
- nw_config_host_agent
- sap_os_linux_user
Define list of sections that will be used to control parameters added into sapinst inifile. Available values:
sap_swpm_inifile_sections_list:
- swpm_installation_media
- swpm_installation_media_swpm2_hana
- swpm_installation_media_swpm1
- swpm_installation_media_swpm1_exportfiles
- swpm_installation_media_swpm1_ibmdb2
- swpm_installation_media_swpm1_oracledb_121
- swpm_installation_media_swpm1_oracledb_122
- swpm_installation_media_swpm1_oracledb_19
- swpm_installation_media_swpm1_sapase
- swpm_installation_media_swpm1_sapmaxdb
- maintenance_plan_stack_tms_config
- maintenance_plan_stack_tms_transports
- maintenance_plan_stack_spam_config
- maintenance_plan_stack_sum_config
- maintenance_plan_stack_sum_10_batch_mode
- credentials
- credentials_hana
- credentials_anydb_ibmdb2
- credentials_anydb_oracledb
- credentials_anydb_sapase
- credentials_anydb_sapmaxdb
- credentials_nwas_ssfs
- credentials_hdbuserstore
- db_config_hana
- db_config_anydb_all
- db_config_anydb_ibmdb2
- db_config_anydb_oracledb
- db_config_anydb_oracledb_121
- db_config_anydb_oracledb_122
- db_config_anydb_oracledb_19
- db_config_anydb_sapase
- db_config_anydb_sapmaxdb
- db_connection_nw_hana
- db_connection_nw_anydb_ibmdb2
- db_connection_nw_anydb_oracledb
- db_connection_nw_anydb_sapase
- db_restore_hana
- nw_config_anydb
- nw_config_other
- nw_config_central_services_abap
- nw_config_central_services_java
- nw_config_primary_application_server_instance
- nw_config_additional_application_server_instance
- nw_config_ers
- nw_config_ports
- nw_config_java_ume
- nw_config_java_feature_template_ids
- nw_config_java_icm_credentials
- nw_config_webdisp_generic
- nw_config_webdisp_gateway
- nw_config_host_agent
- nw_config_post_load_abap_reports
- nw_config_livecache
- nw_config_sld
- nw_config_abap_language_packages
- sap_os_linux_user
- Type:
string
Define path to directory with SAPCAR file.
- Type:
string
(Optional) Define name of SAPCAR file, or leave for auto-detection.
- Type:
string
Define path to directory with SWPM.
- Type:
string
(Optional) Define name of SWPM file, or leave for auto-detection.
- Type:
string
(Optional) Define path to directory with unpacked SWPM file.
- Type:
bool
- Default:
false
Set to true
to use SAP Media files instead of SAR files.
- SWPM2 (New SAP products like S4H, BW4H) uses SAR files.
- SWPM1 (Older SAP products) use CD Media files.
- Type:
string
Define directory where sapinst inifile will be stored.
- Type:
bool
- Default:
true
Set to false
to disable installation of SAP Hostagent. Not recommended
- Type:
string
Define SWPM Product catalog ID for installation. Example for SAP ASCS Netweaver: NW_ABAP_ASCS:NW750.HDB.ABAPHA
.
- Type:
string
Define SAP System ID (SID) for installation.
- Type:
string
Define SAP Netweaver ABAP Central Services (ASCS) instance number.
- Type:
string
Define SAP Netweaver ABAP Central Services (ASCS) hostname.
- Type:
string
Define SAP Netweaver Enqueue Replication Server (ERS) instance number.
- Type:
string
Define SAP Netweaver Enqueue Replication Server (ERS) hostname.
- Type:
string
Define SAP Netweaver Primary Application Server (PAS) instance number.
- Type:
string
Define SAP Netweaver Primary Application Server (PAS) hostname.
- Type:
string
Define SAP Netweaver Additional Application Server (AAS) instance number.
- Type:
string
Define SAP Netweaver Additional Application Server (AAS) hostname.
- Type:
string
Define SAP Netweaver JAVA Central Services (SCS) instance number.
- Type:
string
Define SAP Netweaver JAVA Central Services (SCS) hostname.
- Type:
string
Define master password used for all users created during SWPM execution.
- Type:
string
Define DDIC user password in client 000 for new install, or existing for restore.
- Type:
string
Define virtual hostname when installing High Available instances (e.g. SAP ASCS/ERS cluster).
The role attempts to resolve sap_swpm_virtual_hostname
on the managed node, using DNS and /etc/hosts, and will fail
if this hostname resolution fails. The role will also fail if the IPv4 address for sap_swpm_virtual_hostname
is
not part of the IPv4 addresses of the managed node.
- Type:
string
Define IP Address of database host for /etc/hosts update.
- Type:
string
Define FQDN of database host for /etc/hosts update.
- Type:
string
Define hostname of database host for /etc/hosts update.
- Type:
string
Define database ID (SID).
- Type:
string
Define database instance number.
- Type:
string
Define database SYSTEM user password.
- Type:
string
Define database SYSTEMDB user password.
- Type:
string
Define database sidadm user password.
- Type:
string
Define ABAP database schema name based on database type:
SAPHANADB
for SAP HANAABAP
orSAPABAP1
on IBM Db2SAPSR3
on Oracle DB
- Type:
string
Define ABAP database schema password for new installation or restore from backup.
- Type:
string
Define JAVA database schema name.
- Type:
string
Define JAVA database schema password for new installation or restore from backup.
- Type:
string
- Type:
string
- Type:
string
- Default:
000
Define client number of JAVA UME.
- Type:
string
Define type of JAVA UME.
- Type:
string
- Default:
{{ sap_swpm_pas_instance_nr }}
Define instance number of JAVA UME.
- Type:
string
Define admin password for JAVA UME.
- Type:
string
Define guest password for JAVA UME.
- Type:
string
Define sapjsf password for JAVA UME.
- Type:
string
Define instance hostname of JAVA UME.
- Type:
string
Define directory with SAP HANA Backup files.
- Type:
string
Define prefix of SAP HANA Backup files.
- Type:
string
Define SAP HANA SYSTEM password from source database.
- Type:
string
Define instance number of SAP Web Dispatcher.
- Type:
bool
- Default:
false
Set to true
to set parameter configureSystemConnectivity
to true during installation.
- Type:
bool
- Default:
false
Set to true
to activate ICF.
- Type:
string
Define backend SID for SAP Web Dispatcher connection.
- Type:
string
Define backend message server HTTP port for SAP Web Dispatcher connection.
- Type:
string
Define backend message server hostname for SAP Web Dispatcher connection.
- Type:
string
Define backend hostname for SAP Web Dispatcher RFC connection.
- Type:
string
Define backend instance number for SAP Web Dispatcher RFC connection.
- Type:
string
- Default:
000
Define backend SAP client for SAP Web Dispatcher RFC connection.
- Type:
string
- Default:
DDIC
Define backend SAP user for SAP Web Dispatcher RFC connection.
- Type:
string
Define password for backend SAP user for SAP Web Dispatcher RFC connection.
- Type:
string
Define to set parameter scenarioSize
during installation.
- Type:
string
Define virtual hostname of SAP Web Dispatcher.
- Type:
string
Define password for Linux user SAPADM.
- Type:
string
Define password for Linux user SIDADM.
- Type:
string
Define UID of Linux user SAPADM.
- Type:
string
Define GID of Linux group SAPSYS.
- Type:
string
Define UID of Linux user SIDADM.
- Type:
string
- Default:
true
Enable to install gateway as part of ASCS installation.
- Type:
string
- Default:
23
Define to limit number of parallel extraction SAP HANA jobs.
- Type:
string
Define password for Diagnostic Agent.
- Type:
string
- Default:
{{ sap_swpm_software_path }}
Define individual path for SAP IGS file. sap_swpm_software_path
is used by default.
- Type:
string
Define individual name of SAP IGS file. Newest file is auto-detected in sap_swpm_igs_path
.
- Type:
string
- Default:
{{ sap_swpm_software_path }}
Define individual path for SAP IGS Helper file. sap_swpm_software_path
is used by default.
- Type:
string
Define individual name of SAP IGS Helper file. Newest file is auto-detected in sap_swpm_igs_helper_path
.
- Type:
string
- Default:
{{ sap_swpm_software_path }}
Define individual path for Database dependent kernel files. sap_swpm_software_path
is used by default.
- Type:
string
Define individual name of Database dependent kernel file. Newest file is auto-detected in sap_swpm_kernel_dependent_path
.
- Type:
string
- Default:
{{ sap_swpm_software_path }}
Define individual path for Database independent kernel files. sap_swpm_software_path
is used by default.
- Type:
string
Define individual name of Database independent kernel file. Newest file is auto-detected in sap_swpm_kernel_independent_path
.
- Type:
string
- Default:
{{ sap_swpm_software_path }}
Define individual path for SAP Web Dispatcher files. sap_swpm_software_path
is used by default.
- Type:
string
Define individual name of SAP Web Dispatcher file. Newest file is auto-detected in sap_swpm_web_dispatcher_path
.
- Type:
string
Define FQDN for SAP Installation.
- Type:
bool
- Default:
true
Set to false
to disable enabling of FQDN during SWPM.
- Type:
string
- Default:
n
Set to y
to use encrypted password file for SWPM execution.
Location has to be same as parameter file location.
- Type:
string
Define path to encrypted password file, used when sap_swpm_use_password_file
is set to y
.
- Type:
bool
- Default:
false
Enable to use Livecache
- Type:
string
- Default:
SAP
Define load type parameter loadType
.
- Type:
bool
- Default:
false
Set to true
to execute sap_swpm
role in generic auto-detection mode, ignoring steps for individual detection.
- Type:
string
Define installation type method. Available types: restore
, ha
, maint_plan_stack
, ha_maint_plan_stack
.
Installation type is auto-detected from sap_swpm_product_catalog_id
.
- Type:
string
Define to override default virtual hostname sap_swpm_virtual_hostname
sapinst command used for HA installation.
- Type:
string
Define to override default sapinst command parameter for Maintenance Plan stack file.
- Type:
bool
- Default:
false
Set to true
to configure firewall after SWPM execution.
- Type:
bool
- Default:
false
Set to true
to to update /etc/hosts
file with SAP system details for SWPM execution.
- Type:
bool
- Default:
false
Set to true
to display what sapinst command is being executed.
- Type:
bool
- Default:
true
Set to false
to not change the owner, group, and permissions of the files in sap_swpm_software_path
.
- Type:
string
- Default:
0755
Set permissions for all directories in sap_swpm_software_path
.
- Type:
string
- Default:
root
Set owner for all directories in sap_swpm_software_path
.
- Type:
string
- Default:
root
Set group ownership for all directories in sap_swpm_software_path
.
- Type:
string
- Default:
0755
Set permissions for SAPCAR file in sap_swpm_sapcar_path
.
- Type:
string
- Default:
root
Set owner for SAPCAR file in sap_swpm_sapcar_path
.
- Type:
string
- Default:
root
Set group ownership for SAPCAR file in sap_swpm_sapcar_path
.
- Type:
string
- Default:
0644
Set permissions for all non-SAPCAR files in sap_swpm_software_path
and for SWPM*.SAR files in sap_swpm_swpm_path
.
- Type:
string
- Default:
root
Set owner for all non-SAPCAR files in sap_swpm_software_path
and for SWPM*.SAR files in sap_swpm_swpm_path
.
- Type:
string
- Default:
root
Set group ownership for all non-SAPCAR files in sap_swpm_software_path
and for SWPM*.SAR files in sap_swpm_swpm_path
.