Latest Updates

configure haproxy Using ansible roles

APACHE WEB SERVER

HAPROXY

if you don’t know how to configure an Apache web server and HAPROXY you can read my following blog: 


https://all-about-devops.blogspot.com/2021/03/configure-haproxy-using-ansible.html

RED HAT ANSIBLE

RED HAT ANSIBLE ROLES

Defaults:

Files:

Handlers:

Meta:

Tasks:

Templates:

Tests:

Vars:

ansible-galaxy init 'any role name'
- hosts: 'nodes name where to configure'
roles:
- 'role name'
ansible-playbook 'playbook-name.yml'

Task Objective:

Let’s Get Started

[HAPROXY]
192.168.0.112 ansible_connection=ssh ansible_user=root ansible_ssh_pass=root
[WebServer]
192.168.0.113 ansible_connection=ssh ansible_user=root ansible_ssh_pass=root
192.168.0.108 ansible_connection=ssh ansible_user=root ansible_ssh_pass=root
ansible all -m ping


step 2: Create apache and HAPROXY role and put all codes to make it ready to use

haproxy role:

step 3: Create an ansible-playbook to run this role

- hosts: WebServerroles:      - apache
- hosts: HAPROXYroles: - HAPROXY



http://"haproxy server ip":"listening port" Actual Backend server that is used by haproxy192.168.0.108
192.168.0.113



GitHub Link:

No comments