Task-12.2:

Rishabh
3 min readMar 27, 2021

--

Task Description:
Part-1:Use Ansible playbook to Configure Reverse
Proxy i.e. Haproxy and update it’s configuration
file automatically on each time new Managed node
(Configured With Apache Webserver) join the inventory over AWS
using instance
over there.

For part -1

Pre-requisite:
a. AWS account.
b. Linux O.S as Ansible controller node.
c. Pem key is required to login.
d. Haproxy.cfg.j2 file for templating
e. Ansible installed and configured over the local Instance for Provisioning.
f. haproxy.cfg file in system storage to be used as a template.

♦ STEP-1: Provisioning OS using Ansible Playbook.

♦ STEP-2: Updating the Inventory file.

♦ STEP-3: Modifying the haproxy.cfg file for Ansible template module.

>> groups[‘any group name we have created inside inventory’] is a Default ansible keyword.

♦ STEP-4: Creating a Index.php file for testing.

♦ STEP-5: Creating a Playbook.

>> Remove the Selinux Module we don’t require it in the AWS Linux.
>> Or We can Add “ignore_errors: yes” just in line with selinux module.

♦ STEP-6: Running the Playbook.

>> As we can see everything ran successfully… Task 12–2 Completed.
>> To verify we will use the loadbalancer to test our webpage

--

--

Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.