Now that our lifecycle and content management platform is ready, we can switch gears over to Ansible Automation Platform and start building our automated process. First, let’s take a deep dive into the existing automation available today for provisioning and managing SAP systems, starting with the supported ansible collections we’ll want to leverage:
This snippet of code should look familiar: it’s an example of a requirements file containing collections we’ll be consuming. First, the redhat.satellite collection allows us to use Ansible to integrate with Satellite, and contains 60+ modules we can use for satellite configuration, host management, content management, and much more. The redhat.satellite.host module will allow us to describe to Satellite the system we want, and Satellite will go and provision the system. For example:
This task takes our definition of a HANA system, complete with the system name, ip address, resources, etc, and provisions a new system via Satellite to match what we’ve defined. In this example I’ve hard-coded the values to match what we configured in Satellite previously, however these could also be variables we define elsewhere, say, in our Ansible Inventory in Ansible Controller...more on this later.
Next, the redhat.rhel_system_roles collection provides a stable and consistent way to configure systems according to variables we define. Instead of needing to understand timesync or storage configuration across various RHEL versions, this collection abstracts the individual tasks and allows us to simply define what we want. Let’s consider our HANA system from above: in addition to provisioning the system, we’ll also want to configure some storage for HANA, as well as configure a time source. By leveraging this collection, we can simply define what we want and let Ansible do the heavy lifting:
This playbook demonstrates us defining what we want in the vars section, and then handing off the actual configuration tasks to the RHEL System Roles. I’ve fed in some common mount points used for HANA deployments.
Finally, we have the sap.rhel collection, which configures our systems according to the appropriate SAP Notes and Red Hat best practices. Instead of having to individually go through the SAP Notes and manually configure the systems, this collection handles all of the appropriate steps for us. This collection consists of three roles: preconfigure, netweaver_preconfigure, and hana_preconfigure. Consider the following playbook:
- name: preconfigure all SAP systems
- name: preconfigure HANA systems
While this playbook is short, it is extremely powerful: in these few lines of Ansible we’ve set up our systems according to all applicable SAP Notes and Red Hat best practices so our SAP systems will be as stable and performant as possible.
These collections get our systems ready to run SAP workloads, however we’re going to step further by consuming some additional roles that will allow us to install the various SAP components. These roles are not supported by Red Hat, but are supported by vibrant communities interested in the automation of SAP workloads using Ansible. Let’s take a look at our roles/requirements.yml file:
Josh Swanson is currently a Solution Architect for Red Hat. Ted Jones is currently a SAP Architect for the Red Hat SAP Tech Alliance team. Vivien Wang is currently an Ecosystem Partner Manager for the Red Hat Partner Engineering Ecosystem.