first commit

This commit is contained in:
Ryan Cuda
2026-01-25 08:31:56 -07:00
commit 1234ef51c0
57 changed files with 2560 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
{
"collection_info": null,
"dependencies": [],
"format": 1,
"license": "MIT",
"license_file": null,
"name": "balancer",
"namespace": "local",
"readme": "README.md",
"repository": null,
"tags": [
"haproxy",
"loadbalancer",
"networking",
"web"
],
"version": "1.0.0"
}

View File

@@ -0,0 +1,11 @@
---
haproxy_frontend_port: 80
haproxy_backend_servers:
- name: node3
address: node3
port: 80
- name: node4
address: node4
port: 80

View File

@@ -0,0 +1,6 @@
---
- name: Restart haproxy
ansible.builtin.service:
name: haproxy
state: restarted

View File

@@ -0,0 +1,2 @@
install_date: 'Tue 30 Dec 2025 12:53:11 AM '
version: ''

View File

@@ -0,0 +1,21 @@
---
galaxy_info:
role_name: balancer
author: lab
description: Installs and configures HAProxy to load balance Apache servers
license: MIT
min_ansible_version: "2.9"
platforms:
- name: EL
versions:
- "9"
galaxy_tags:
- haproxy
- loadbalancer
- networking
- web
dependencies: []

View File

@@ -0,0 +1,28 @@
---
- name: Install HAProxy
ansible.builtin.dnf:
name: haproxy
state: present
- name: Enable and start HAProxy
ansible.builtin.service:
name: haproxy
state: started
enabled: true
- name: Deploy HAProxy configuration
ansible.builtin.template:
src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
owner: root
group: root
mode: '0644'
notify: Restart haproxy
- name: Allow port 80 through firewalld
ansible.posix.firewalld:
service: http
permanent: true
immediate: true
state: enabled

View File

@@ -0,0 +1,25 @@
global
log /dev/log local0
log /dev/log local1 notice
daemon
maxconn 2048
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5s
timeout client 50s
timeout server 50s
frontend http_front
bind *:80
default_backend webservers
backend webservers
balance roundrobin
option httpchk
server node3 node3:80 check
server node4 node4:80 check