hands-on lab

Use Terraform and Ansible Together to Create an Azure Linux VM with Nginx Installed

Difficulty: Intermediate
Duration: Up to 1 hour and 30 minutes
Students: 341
Rating: 5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Terraform is an infrastructure automation tool that allows companies to manage infrastructure through code. This provides many benefits such as greater recovery, predictability, and speed. Infrastructure as code is quickly becoming a standard for managing cloud resources and is widely practiced among the top high performing companies.

In this lab, you'll learn how to use Terraform to provision an Azure VM, bootstrapped using Ansible. Ansible is an IT automation technology often used within DevOps to reliably and repeatedly install software and applications on VMs that run in the cloud and on-prem servers. You'll use Terraform together with Ansible to launch a Linux VM and then perform automated configuration management on it, installing and configuring Nginx (web server). The Ansible playbook that you develop will download and setup an example static HTML5 responsive website, to be served by the Nginx web server.

Learning Objectives

Upon completion of this intermediate level lab, you'll be able to:

  • Use Terraform to init, plan, and apply Azure infrastructure
  • Use Ansible as a configuration management tool to automatically bootstrap an Azure VM during launch time
  • Configure an Azure VM with Nginx (web server)

Intended Audience

  • Anyone interested in learning how to use Terraform to provision Azure infrastructure
  • Cloud Architects
  • DevOps Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Basic understanding of Azure
  • Basic understanding of Terraform
  • Basic understanding of Ansible

The following content can be used to fulfill the prerequisite:

Environment before

Environment after

Covered topics

Lab steps

Access the CloudAcademy IDE
Create a Terraform template to provision an Azure Linux VM
Install Ansible and integrate it into the Terraform Templates