Automating SAP installation with open-source tools
The original content of this post was posted first on the AWS for SAP blog: https://aws.amazon.com/blogs/awsforsap/automating-sap-installation-with-open-source-tools/
Introduction
We’ve already demonstrated in our first blog post how to provision the infrastructure for SAP applications using Terraform, and in our second blog post we added in automation of SAP software installation using Systems Manager. Now it is time to go deeper with open-source common tools like Jenkins and Ansible to have the SAP installation in a comprehensible single pipeline. This approach brings a few benefits added on top of the other alternatives:
- Helps customer teams to be compliant with auditable policies related to configuration as code, since in this blog post we will automate all of SAP software installation.
- Turns the SAP installation into a repeatable process, making the quality of the outcome easier to improve, since it can be simulated and run several times using the same source of information.
Another good option to deploy SAP is AWS Launch Wizard. Customer teams can build SAP systems that align with AWS best practices rapidly from the AWS Console following a guided experience designed for SAP administrators.
To help achieve goals such as increasing deployment efficiency and quality, many customers are automating as many repeatable processes as they can. Jenkins is an industry pattern providing one orchestrator environment that helps to put together all the required pieces. It runs the same commands we’d do manually using BASH for Linux.
In the end of this article you’ll have a Jenkins pipeline with the image below as its outcome:
The above pipeline has capabilities to build all the needed infrastructure and install the actual software for non-HA (1) SAP Primary Application Server (PAS), SAP Hana Database and SAP ABAP SAP Central Services (ASCS).
To help you make use of Jenkins and Ansible to fully automate your SAP software installation, we’ve open sourced code to a GitHub repository for this installation automation. This will automate and will be used together with the GitHub repository we created for provisioning your infrastructure using, which was explained in our first blog post.
Understanding the pipeline steps
- Checkout SCM — this is when Jenkins looks for the code on GitHub
- Prepare — Jenkins checks if all the required variables for the run are present (variables are described on section “Preparing Jenkins”)
- Check ENV states — checks if there is one S3 bucket available for storing the final Terraform state file, and also if there’s already one environment up using this automation. IMPORTANT: this step is going to create on bucket on your provided account. The bucket name will be “sap-install-bucket-” followed by a random number. Terraform will store its state file in this bucket.
- Create ENV — The infrastructure automation based on Terraform creates all the needed infrastructure for this installation. To understand what’s going to be created, review our first blog post.
- Install Hana and ASCS — this is a place holder, meaning that the next two steps (6 and 7) run in parallel.
- Install Hana — installs Hana on the instance created by Terraform.
- Install ASCS — Installs ASCS on its instance.
- Install PAS — installs PAS on its dedicated instance after Hana and ASCS are finished.
- Notify — a simple terminal notification stating the end of processing.
- Post actions — Jenkins auto-generated step stating the end of the whole pipeline.