In the first part of this blog series, we discussed how Terraform and Ansible can provide z/OS environments with application and data ready to go, with no reliance on LPAR capacity, and with just one click. Using a fictional conversation with a mainframe user, we introduced our thinking, and innovations, to support a typical mainframe team’s requirement.

Here, we delve further into the topic – and what better way than to face possibly the most important question of all…

“Does this really work for Z?”

Ansible and Terraform both support z/OS. Many teams are already using Ansible to manage their z/OS applications and config, and IBM provide a (frequently updated) core collection of Ansible modules to automate a wide range of tasks on z/OS. Terraform supports z/VM and KVM on IBM Z hardware and LinuxONE, and it also supports z/OS running on PopUp Mainframe – Terraform can manage the PopUp Mainframe instance just like any other virtual machine (VM).

In the PopUp Mainframe dev team, we use Ansible and Terraform regularly to provision self-service z/OS environments, install applications, deploy updates, roll out config changes, and much more. We have cloud images as well as on-prem images, all under Terraform control.

To find out more about how we use Ansible, look at our blog, Automating the heck out of every LPAR.

“Will it save me time?”

Yes! The key benefits of automation apply just as much to infrastructure as they do to testing. The usual ‘automation benefits’ hold true – removing error-prone steps, taking less time, reduced reliance on a specific person or specific team to do the work, automated execution reports, etc.

Using Terraform and Ansible delivers “codified” knowledge: information which is captured in source code or config files so it doesn’t have to be passed along by word-of-mouth or through complicated documentation. In the PopUp dev team, whenever there is an opportunity to automate or “codify” a task, we seize it, and further reduce reliance on tribal knowledge, two-dimensional documentation, or busy specialist expertise as part of our efficiency goals.

Having tasks automated has been quite transformational for our team in reducing some of our single person knowledge/skill dependencies. This enables anyone to perform the task even if they would not be completely confident to do it manually. Codifying removes the need for the user to understand (or remember) the nuances of commands and saves their cognitive energy for other tasks.

Moving to config files is a game-changer, as it enables source control e.g. git, to be used. Once all your config is in git, it will be version-controlled, like all your code, and becomes much easier to manage and audit. No longer do you need to rely on comments which have been overwritten many times to try and understand the reasoning behind a specific configuration, you can look into git and see exactly who changed it, when, what they changed, and hopefully why – with a useful commit message. Integration with git also enables integration with pipelines – so you can deploy application and config changes and control your z/OS environments via automation. Of course, with pipelines you can also perform security scanning, vulnerability testing and a whole host of other vital steps we should all be doing for the security of our applications.

Terraform has the concept of drift detection, by highlighting any inconsistencies between the expected state and the actual state of your infrastructure components. This can be very helpful in alerting you to issues, and it also provides a quick route to resolution, to bring your infrastructure back to the state it should be in.

With Terraform and Ansible, we can spin up a new PopUp environment in our lab in minutes. Previously it would take us a few hours to create the VM and configure it manually. It is quick to tear down our PopUps too, so we provision and remove PopUps frequently. This has the dual benefit of reducing our maintenance overheads and increasing consistency across our lab. Since we spin up a new PopUp as needed, we can be sure that all PopUps have the same versions and patch levels. In many cases it is quicker and easier to destroy and create a new PopUp rather than patching old ones. The number of PopUps we have at any moment ebbs and flows with project demand.

“Do I have to use both Terraform and Ansible together?”

While Terraform and Ansible are best buddies, they can be used independently, and frequently are, with great success. Using Ansible allows you to manage your environments, deploy applications and config, and orchestrate tasks. Terraform enables you to provision and tear down complete environments. Our advice? Start wherever you have the biggest bottleneck and improve incrementally from there.

“Where do I start with Terraform and Ansible for z/OS?”

The power of Terraform and Ansible is huge, and it might seem daunting to start using them in your team. But Terraform and Ansible are industry-leading tools and the chances are, your organization is already using them somewhere.

Terraform for Z supports IBM Z and LinuxONE environments. PopUp is also ready to integrate with Terraform out-of-the-box. Terraform relies on definition files to define the target infrastructure. Once you have configured the Terraform definition files, you will be able to manage, deploy and test your z/OS environments (whether that is on LinuxONE, Z hardware, or on a PopUp) like the rest of your infrastructure (which are likely already managed by Terraform).

We can give you a jump-start by sharing Terraform definition files developed for PopUps to get you up and running in no time.

Many z/OS users rely on Ansible playbooks for all sorts of z/OS tasks, including health checks, maintenance, and config management. At PopUp, we have built a stack of playbooks covering a range of tasks, which are ready-to-run on your z/OS. Our pre-built Ansible playbooks are available here and come pre-installed on all PopUps.

“How can I learn more?”

Terraform is gaining broader traction in the market with each passing month, so it is not just our perspective we are sharing here. Learn more about Terraform from IBM, the Terraform for Z page and the Terraform website. Once you are ready, get started in minutes with pre-built Ansible playbooks for z/OS and Terraform definition files for PopUp. Contact us to get access. Also, be sure to check out our further perspectives about platform engineering, Ansible for z/OS, and git on our blog site.

Recommended Posts