June 24, 2020 By Steve Strutt 2 min read

Use Red Hat Ansible with Terraform and IBM Cloud Schematics to deploy apps on IBM Cloud.

For those not familiar with Red Hat Ansible, it is a popular configuration management and provisioning tool. Based on Python and YAML, it is easy to learn and use, and it comes with an impressive catalog of pre-built content in Ansible Galaxy for provisioning and configuration of open source applications.

IBM Cloud Schematics brings the power of both Ansible and Terraform to IBM Cloud users to help automate the end-to-end deployment of cloud infrastructure and applications. By applying Infrastructure as Code (IaC) principles, Terraform and Ansible enable open-source-based apps to be deployed repeatably and reliably on IBM Cloud in minutes. 

Why to use both Ansible and Terraform for application provisioning on IBM Cloud

For me, this lies in their very different approaches to provisioning and focus. I see the sweet spot of Terraform as being infrastructure orchestration and lifecycle management of infrastructure resources. Ansible, on the other hand, excels with configuration management and application provisioning.
Any comparison or choice of tool also has to take into account how the application will be managed and upgraded. This leads onto the discussion of whether the infrastructure is to be treated as immutable or mutable—or, more prosaically, as “cattle or pets.” For a deeper discussion and comparison see my earlier blog, “Infrastructure as Code: Chef, Ansible, Puppet, or Terraform?” or “What is Infrastructure as Code (IaC)?” For some applications, or where its desired to reuse existing content from Ansible Galaxy, they make a good team (as represented in the figure above). 

To enable Terraform users to use Ansible for application configuration and provisioning, Schematics implements the Terraform pattern of a provisioner to extend Terraform’s base functionality. This brings the full potential of Ansible under the control of Terraform using the Ansible Provisioner for Terraform, delivering the ability to run Ansible playbooks, roles, and modules during the Terraform provisioning flow. Another benefit of using the provisioner, compared to calling Ansible via a script from within Terraform, is that it also masks many of the complexities of the SSH setup required to use Ansible. 

More details

For details on how to use the Ansible Provisioner for Terraform with Schematics for application provisioning, see the IBM Developer article “Learn about repeatable and reliable end-to-end app provisioning and configuration.”

To try it out, follow the companion example to demonstrate the use of out-of-the-box Ansible roles to install a multi-tier open source application and components onto VSIs in IBM Cloud.

If you have questions, engage our team via Slack by registering here and join the discussion in the #general channel on our public IBM Cloud Schematics Slack channel.

Was this article helpful?
YesNo

More from Cloud

Enhance your data security posture with a no-code approach to application-level encryption

4 min read - Data is the lifeblood of every organization. As your organization’s data footprint expands across the clouds and between your own business lines to drive value, it is essential to secure data at all stages of the cloud adoption and throughout the data lifecycle. While there are different mechanisms available to encrypt data throughout its lifecycle (in transit, at rest and in use), application-level encryption (ALE) provides an additional layer of protection by encrypting data at its source. ALE can enhance…

Attention new clients: exciting financial incentives for VMware Cloud Foundation on IBM Cloud

4 min read - New client specials: Get up to 50% off when you commit to a 1- or 3-year term contract on new VCF-as-a-Service offerings, plus an additional value of up to USD 200K in credits through 30 June 2025 when you migrate your VMware workloads to IBM Cloud®.1 Low starting prices: On-demand VCF-as-a-Service deployments begin under USD 200 per month.2 The IBM Cloud benefit: See the potential for a 201%3 return on investment (ROI) over 3 years with reduced downtime, cost and…

The history of the central processing unit (CPU)

10 min read - The central processing unit (CPU) is the computer’s brain. It handles the assignment and processing of tasks, in addition to functions that make a computer run. There’s no way to overstate the importance of the CPU to computing. Virtually all computer systems contain, at the least, some type of basic CPU. Regardless of whether they’re used in personal computers (PCs), laptops, tablets, smartphones or even in supercomputers whose output is so strong it must be measured in floating-point operations per…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters