This repository is intended for customized playbooks derived from ansible.playbooks_for_sap
.
These playbooks are developed to serve as automation to build SAP systems for development and testing purpose.
Included configurations are for cheaper and smaller servers, while retaining full suite of functionalities of used Ansible Roles.
- SAP Software download is replaced by sourcing from NFS filesystem with intent to:
- Reduce cost associated with downloading same SAP Software again.
- Reduce duration of SAP Software preparation, dependent on internet speed and bandwidth.
- NOTE: You are responsible in providing correct software in NFS filesystem (examples are provided or each scenario).
- Idempotency improvements by additional validation steps
- Skip
sap_general_preconfigure
,sap_hana_preconfigure
,sap_netweaver_preconfigure
if usersidadm
is present and instance profile already exists. - Skip
sap_install_media_detect
if usersidadm
is present and instance profile already exists. - Skip
sap_swpm
if usersidadm
is present and instance profile already exists. - Skip
sap_hana_install
if HANA default profile already exists. - Skip
sap_ha_install_hana_hsr
if replication configuration is already present. - Skip
sap_ha_pacemaker_cluster
if cluster configuration is already present
- Skip
- Quality of Life improvements (tasks/)
iscsi_client_setup
- (Optional) Setup of client for iSCSI SBD stonithiscsi_server_setup
- (Optional) Setup of target for iSCSI SBD stonithnfs_cleanup
- Cleanup of NFS mounts for Netweaver instancesos_register
- Register and unregister BYOS images. Used by terminate playbook.prepare_inventory
- Creates dynamic inventory based on variable files. Usable for debugging withoutsap_infrastructure
role.tag_resources
- Tag provisioned resources.
- Development tools (tools/)
cluster_setup.yml
allows you to setup HA cluster on provisioned servers. This is very useful for cluster testing and configuration changes.cluster_destroy.yml
allows you to remove HA cluster configuration, before executingcluster_setup.yml
. This is destructive tool!terminate.yml
allows you to terminate resources provisioned in given scenario. This is destructive tool!
All playbooks were tested by using sap_vm_provision_iac_type: "ansible"
as method for provisioning
All playbooks were tested on dev
branch with all recent features and fixes.
It mainly applies to: sap_infrastructure
and sap_install
. It is possible that some features rely on new changes in used roles.
Software is provided by NFS filesystem, but there are some differences because of parallel execution.
HANA
- HANA HA installation is executed in parallel, which cannot be done using one source NFS.
- HANA software is copied during
sap_install_media_detect
from NFS to /software, then unpacked there. - This can be seen by separately defined source and target variables
sap_install_media_detect_source_directory
sap_install_media_detect_target_directory
ASCS, ERS, PAS, AAS
- ASCS/ERS/PAS/AAS software is opened directly from NFS filesystem, because they are not executed in parallel.
- This results in source NFS filesystem changes due to unpacking.
- NOTE These changes are not harmful because
sap_install_media_detect
will process packaged and unpacked again.
ap4s
├── scenarios
│ ├── sap_hana_ha
│ │ ├── vars
| │ │ ├── aws.yml
| │ │ ├── ...
| │ │ └── shared.yml
│ │ └── build.yml
│ │
│ ├── sap_ascs_ha
│ └── ...
│
├── tasks
│ ├── iscsi_client_setup.yml
│ ├── ...
│ └── prepare_inventory.yml
│
├── tools
| ├── cluster_destroy.yml
| ├── cluster_setup.yml
| └── terminate.yml
└── vars
├── aws.yml
├── ....yml
└── azure.yml
Playbooks:
- Each scenario contains scenario-specific playbook
- Tools folder contains playbooks that will execute on your system, by using same variables as during build
Tasks:
- Tasks cannot be executed by themselves, but they are called from playbooks in scenario and tool folders.
Variables:
./vars/
are scenario-wide platform specific that serve as place to store credentials, API user details, bastion details and cloud infrastructure details../scenario/*/vars/
are scenario specific platform variables that store host details, NFS sources, VIP addresses, etc.shared.yml
file is setup to allow build of exactly same system across different cloud platforms, with same SID and build parameters.
Ensure that you are familiar with Ansible variable precedence in Ansible documentation.
Principle of executing Ansible Playbooks for SAP and these playbooks is to always use external variables
with highest precedence.
Execution examples are show in specific order because of this:
- Main platform variables are loaded
- Shared scenario variables are loaded
- Platform and scenario specific variables are loaded. This way you can override some variables specified for all scenarios.
Ensure that you follow step by step instructions at GETTING_STARTED
Ensure that you populate all relevant variable files as:
- described in comments of particular variable file
- described in
ansible.playbooks_for_sap
Example for building and terminating SAP HANA HA Scale-up on AWS.
cd scenarios/sap_hana_ha
ansible-playbook build.yml -e @../../vars/aws.yml -e @./vars/shared.yml -e @./vars/aws.yml
cd scenarios/sap_hana_ha
ansible-playbook ../../tools/cluster_destroy.yml -e @../../vars/aws.yml -e @./vars/shared.yml -e @./vars/aws.yml
cd scenarios/sap_hana_ha
ansible-playbook ../../tools/cluster_setup.yml -e @../../vars/aws.yml -e @./vars/shared.yml -e @./vars/aws.yml
cd scenarios/sap_hana_ha
ansible-playbook ../../tools/terminate.yml -e @../../vars/aws.yml -e @./vars/shared.yml -e @./vars/aws.yml
NOTE: Loading order of external variable files ensures that:
- global platform variables are loaded first
- shared scenario specific variables are loaded second
- scenario and platform specific variables are loaded last
Updating variable files is easy method, but any future pull/fetch of repository will lead to losing them.
Following method was used during development and testing to keep all passwords and important information separate from files pushed to repository.
- Clone repository
- Copy variable file you want to use and added
.local
before file type extension. Example:cp vars/aws.yml vars/aws.local.yml
- Execute using new variables files. Example:
ansible-playbook build.yml -e @../../vars/aws.local.yml -e @./vars/shared.local.yml -e @./vars/aws.local.yml