So this post is extended from task

In this we have to Configure the HAProxy and Webserver over the EC2 instances in AWS

One may think that it is similar to previous task the only change we need to do is the inventory in ansible but there are few other changes that needs to be done:

  1. make root password in ec2 instance

2. enable passwordauthentication to yes

3. copy ssh keys for passwordless login

  1. For making root password use command
passwd root

2. For enabling passwordauthentication

edit /etc/ssh/sshd_config

3. For copying ssh keys use

ssh-copy-id root@PublicIP

Rest all the things are same and the reason for that is been using Ansible

The video has been made which shows ever detail about this task from scratch

This video starts from launching instances till configuring them as LB and backend servers



This Post is all about HAProxy and Webserver configuration using Ansible.

So, What is HAProxy?

HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers.

  • Description

In this task we need to install HAProxy on one system and then we need to use this as LoadBalancer for Webserver running in other systems/server.

This all is automated using ansible

Ansible YAML file for HAProxy

Installing HAProxy



This is a docker task which needs the following to be done

  • Configuring HTTPD Server on Docker Container
  • Setting up Python Interpreter and running
  • Python Code on Docker Container

Step 1: Launch docker container using command

docker run -it --name os1 centos

Step 2: Download Httpd software using

yum install httpd