Initial role setup with basic configuration

This commit is contained in:
Gregory Ballantine
2026-04-08 11:22:12 -04:00
parent 5a46b4087f
commit dd0ebf4a43
8 changed files with 90 additions and 1 deletions

31
tasks/main.yml Normal file
View File

@@ -0,0 +1,31 @@
---
- name: Load OS-specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_os_family }}.yml"
- "default.yml"
- name: Install HAProxy
package:
name: "{{ haproxy_package }}"
state: present
- name: Ensure configuration directory exists
file:
path: "{{ haproxy_config_path | dirname }}"
state: directory
mode: '0755'
- name: Deploy HAProxy configuration
template:
src: haproxy.cfg.j2
dest: "{{ haproxy_config_path }}"
validate: "haproxy -c -f %s"
notify: reload haproxy
- name: Ensure HAProxy is started and enabled
service:
name: "{{ haproxy_service_name }}"
state: started
enabled: yes