Ansible Roles (Httpd + Haproxy)
Today we will create 2 ansible roles and then will run them combined to create a load balancer setup with 2 nodes connected to it.
Lets first init the roles by ansibe galaxy
After these commads
t15.yml is the main file in which we have combined both the codes
Lets create tasks in both the roles
httpdserver -> tasks -> main.yml
The main.yml file in httpdserver
loadbalancer -> tasks -> main.yml
The main.yml for loadbalancer
The config file of haproxy looks like
We can see the working of loadbalancer
Thank You for reading.
I would like to thanks Vimal Daga Sir.
My Email — ayanchawlae@gmail.com
My LinkedIn — https://www.linkedin.com/in/ayanchawlae/
Comments
Post a Comment