hands-on lab

Deploying Web Applications using Ansible

Difficulty: Intermediate
Duration: Up to 1 hour and 15 minutes
Students: 2,086
Rating: 4.7/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

Ansible is a configuration management tool that you can use to configure servers and deploy applications. Ansible is free, easy to set up with few dependencies, and allows you to model complex configuration and deployment workflows.

Learning how to deploy a web application end to end will make you more proficient in using Ansible.

In this lab, you will learn how to create and configure an Ansible role, and you will create and configure a role that deploys a web application.

Learning Objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Use the Vim text editor to edit YAML files
  • Create an Ansible role to configure the LAMP stack
  • Separate variables, templates, and handlers to make your role more reusable
  • Deploy a Python web application with Ansible

Prerequisites

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

  • Ansible
  • Vim
  • YAML

The following courses and lab can be used to fulfill the prerequisites:

Updates

December 17th, 2021 - Update the format of the lab

December 14th, 2021 - Resolved an issue that caused the lab setup to not complete

October 8th, 2021 - Addressed the erroring main.yml file spacing issue

September 9th, 2021 - Reduced lab startup time by half

August 18th, 2020 - Resolved a package dependency issue causing the lab instance to fully provision

August 7th, 2020 - Updated lab to use EC2 instance connect and added a validation check for the web application deployment

June 3rd, 2020 - Addressed an issue with the Ansible version

March 23rd, 2020 - Updated a lab step to avoid a yaml formatting issue

January 10th, 2019 - Added a validation Lab Step to check the work you perform in the Lab

July 13th, 2018 - Updated to use the latest version of Ansible

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Connecting to the Ubuntu Virtual Machine using EC2 Instance Connect
Creating an Ansible Role to Install a LAMP Stack
Setting Default Variables and Using Notifications
Deploying a Web Application