2023-08-23 18:22:50 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install haproxy package
|
|
|
|
community.general.pacman:
|
|
|
|
name:
|
|
|
|
- haproxy
|
|
|
|
|
2024-06-19 22:51:40 -04:00
|
|
|
- name: Figure out local IP address
|
|
|
|
set_fact:
|
|
|
|
service_ip: "{{ vpn_ip if wireguard_services else local_ip }}"
|
|
|
|
|
|
|
|
# for info about this, see top of roles/containers/templates/docker-compose.yml.j2
|
|
|
|
- name: Enumerate services to forward
|
|
|
|
set_fact:
|
|
|
|
haproxy_services:
|
|
|
|
- name: gitea
|
|
|
|
ports:
|
|
|
|
- 2498
|
|
|
|
- 3000
|
|
|
|
- name: navidrome
|
|
|
|
ports:
|
|
|
|
- 4533
|
|
|
|
- name: synapse
|
|
|
|
ports:
|
|
|
|
- 8008
|
|
|
|
- name: paperless
|
|
|
|
ports:
|
|
|
|
- 8000
|
|
|
|
|
|
|
|
- name: Deploy haproxy config (bastion)
|
|
|
|
template:
|
|
|
|
src: haproxy.cfg.bastion.j2
|
|
|
|
dest: /etc/haproxy/haproxy.cfg
|
|
|
|
lstrip_blocks: true
|
|
|
|
when: '"bastion" in group_names'
|
|
|
|
|
|
|
|
- name: Deploy haproxy config (fleet)
|
2023-08-23 18:22:50 -04:00
|
|
|
template:
|
2024-06-19 22:51:40 -04:00
|
|
|
src: haproxy.cfg.fleet.j2
|
2023-08-23 18:22:50 -04:00
|
|
|
dest: /etc/haproxy/haproxy.cfg
|
2023-09-03 20:09:56 -04:00
|
|
|
lstrip_blocks: true
|
2024-06-19 22:51:40 -04:00
|
|
|
when: '"fleet" in group_names'
|
2023-08-23 18:22:50 -04:00
|
|
|
|
|
|
|
- name: Enable haproxy service
|
|
|
|
systemd:
|
|
|
|
name: haproxy
|
|
|
|
enabled: yes
|
|
|
|
state: started
|