roles/haproxy: fix issues

This commit is contained in:
dogeystamp 2023-09-03 20:09:56 -04:00
parent ff40949ff7
commit e0b7c5a15e
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 13 additions and 8 deletions

View File

@ -16,7 +16,7 @@ services:
- GITEA__server__SSH_DOMAIN={{ gitea_domain }}
ports:
- "3000:3000"
- "2499:22"
- "2498:22"
restart: unless-stopped
volumes:
- {{ dataroot }}/gitea:/data

View File

@ -9,6 +9,7 @@
template:
src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
lstrip_blocks: true
- name: Enable haproxy service
systemd:

View File

@ -4,19 +4,23 @@ defaults
timeout connect 10s
timeout client 36h
timeout server 36h
balance leastconn
{% if groups["gitea"] | length > 0 %}
listen gitea_ssh
bind *:2499
balance leastconn
mode tcp
option tcp-check
tcp-check expect rstring SSH-2.0-OpenSSH.*
{% for host in groups["gitea"] %}
server {{ host }} {{ hostvars[host]["local_ip"] }}:2499
server {{ host }} {{ host }}:2498
{% endfor %}
{% endif %}
{% if groups["syncthing"] | length > 0 and "syncthing" not in group_names %}
listen syncthing
bind *:22000
{% for host in groups["syncthing"] %}
server {{ host }} {{ host }}:22000
{% endfor %}
{% endif %}