ARTH TASK 15 :-

🔅Create an ansible role myapache to configure Httpd WebServer.

WHAT IS ANSIBLE ?

WHAT IS ANSIBLE ROLES ?

-> PREREQUESITES

To begin task following things must be done

※ Inventory file

you need to create two group one for the load balancer and other for the webservers here iam using local vms you can also use aws instances for web servers

※ ANSIBLE COINFIGURATION FILE

STEP 1:-

change your directory to “ /root/.ansible/roles”

STEP 2 :- Writing Roles

here we gonna write roles for both webserver and loadbalancer

Roles for My_Webserver

A. For TASK file:-

※ Roles for My_LoadBalancer

A. For TASK file:-

STEP 3 :- Combing roles together

now we gonna create a playbook which will combine both the roles for controlling webserver versions and solving challenge for host ip’s addition dynamically over each Managed Node in HAProxy.cfg file.

STEP 4 :- Lets run our playbook final-setup.yml

STEP 4 :- Now lets see the result

♦️ In Haproxy Configuration File we can see that ip’s are added dynamically over managed nodes ;

※ lets check the result in browser

in the browser type