High Availability & Automation

Scale your infrastructure. You will use Ansible to automate web server provisioning, deploy HAProxy for load balancing, and implement Keepalived for virtual IP failover.

DevOps EngineerAnsibleDevOpsLinux

Introduction

Automation and availability depend on different mechanisms: repeatable provisioning, traffic distribution, a stable service address, and recovery actions when a process stops. This challenge-based project configures each mechanism on one Linux host so you can see how the pieces fit together.

You will provision Nginx through a local Ansible playbook, distribute requests between two prepared backends with HAProxy, assign a virtual IP with Keepalived, and schedule a Bash watchdog to recover Nginx. The exercises validate concrete service state and traffic behavior while keeping the limits of a single-node lab explicit.

What You Will Learn

  • Create a local Ansible inventory, template, and playbook that installs, starts, and configures Nginx
  • Configure HAProxy in HTTP mode with a port 80 frontend and round-robin backend on ports 8001 and 8002
  • Verify through repeated requests that both prepared backend responses are reachable through HAProxy
  • Identify the default-route interface and define a Keepalived VI_1 MASTER instance with VIP 10.0.0.100
  • Start Keepalived and confirm that the /32 virtual IP is present on a local interface
  • Write an executable Nginx watchdog, append dated recovery events to a log, and schedule it every minute in root's crontab

Who This Course Is For

This project is for DevOps and Linux learners ready to combine Ansible, HAProxy, Keepalived, Bash, and Cron in outcome-driven tasks.

Prerequisites: Familiarity with Linux package and service management, YAML, basic Ansible plays, HTTP proxy concepts, network interfaces and virtual IPs, shell conditionals, and crontab; this is an assessment-style project.

Learning environment: A browser-accessible single-node Linux host with sudo, Ansible, Nginx, HAProxy, Keepalived, Cron, two prepared local HTTP backends, and local network access; no cloud or additional server is required.

Frequently Asked Questions

Does the Ansible phase provision a real fleet of servers?

No. The inventory targets the local lab host. You still create and run a real playbook for package installation, file deployment, and service management, but multi-host SSH orchestration is not tested.

Are the HAProxy backends separate machines?

No. Two prepared services run locally on ports 8001 and 8002. HAProxy listens on port 80, uses HTTP round robin, and repeated requests must reach both “Server 1” and “Server 2.”

Does the Keepalived task demonstrate actual failover between two nodes?

No. You configure one MASTER instance and verify VIP 10.0.0.100 on its interface. There is no BACKUP node, VRRP takeover, or failback test in this single-node environment.

What does the automated recovery task restart?

It checks and starts Nginx only, logs a recovery entry to /var/log/nginx_recovery.log, and runs every minute from root's crontab. It does not monitor HAProxy, Keepalived, a remote node, or application health beyond service state.

Teacher

labby
Labby
Labby is the LabEx teacher.