hands-on lab

Getting Started with Ansible

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 3,446
Rating: 4.8/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 tool for automating configuration management, application deployment, and server provisioning. It's relatively lightweight as it has few dependencies, which means it can be easily deployed to manage and configure computing resources.

Learning how to create a playbook to configure a server is one of the basic use-cases for Ansible.

In this lab, you will create a playbook that installs and configures the first three elements of the classic Linux Apache Mysql PHP (LAMP) web application software stack. 

Learning Objectives

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

  • Use the command line to create a new Ansible playbook
  • Install and configure the Apache webserver using an Ansible playbook
  • Make your playbook more reusable by adding variables

Prerequisites

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

  • The Bash command line
  • Ansible playbooks
  • YAML

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

Updates 

January 4th, 2024 - Resolved an issue that caused the lab to fail to setup on rare occasions

December 14, 2021 - Updated format of the lab

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

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Connecting to an EC2 Instance Using Amazon EC2 Instance Connect
Creating a Basic Ansible Playbook
Ensuring Services are Started in your Ansible Playbook
Adding Variables to your Ansible Playbook