Sourav Dinda
3 min readApr 7, 2021

Ansible playbook to Configure Reverse Proxy i.e. Haproxy and update its configuration file automatically on each time new Managed node (Configured With Apache Webserver) join the inventory.

1.What is Ansible……?

A responsive software tool that provides simple but powerful automation for cross-platform computer support. It is primarily intended for IT professionals, who use application deployment, workstation and server updates, cloud provisioning, configuration management, inter-service orchestration, and system administrators on a weekly or daily basis.

What is Load Balancing… ?

Load balancing ensures the availability, uptime, and functionality of your servers, websites, and applications during traffic spikes. This is especially important for companies with multiple data centers and high traffic websites or applications.

Load Balancing is defined as follow:

A performance optimization strategy that provides error-tolerance by splitting incoming tasks into multiple computing resources, thereby preventing one resource from being overloaded.”

The goal of load balancing is to use optimal resources, maximize server stability, and prevent individual components from being overloaded. This allows a server to share the amount of work that needs to be done between two or more servers, allowing more work to be done at the same time.

Ansible Playbook to configure the Reverse Proxy

o/p :

Let’s run playbook by following command :

# ansible-playbook “playbook_file_name”

Here we can see that playbook run successfully , and now we can check the contents whatever we written in playbook .

Now I am going to manually to check the content , you can see the below ,

  1. HAproxy status in the Loadbalancer:

2.Configuration file of HAproxy in the LoadBalancer.

Now I am going to web-browser to check the content .

Both page came from different server….

By seeing this output we can conclude that , haproxy work properly in loadbalancer.

Thank you for reading!!

Sourav Dinda
Sourav Dinda

No responses yet