Update some vars and add other ones

This commit is contained in:
Alex 2020-05-21 20:20:43 +02:00
parent cd4aae0924
commit 190452473b
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
3 changed files with 5 additions and 12 deletions

View File

@ -1,6 +1,6 @@
- name: Copy HAProxy files - name: Copy HAProxy files
loop: loop:
- { src: 'haproxy.conf.j2', dest: '/etc/haproxy/haproxy.cfg' } - { src: 'haproxy.conf.j2', dest: '{{ haproxy.config }}' }
template: template:
follow: yes follow: yes
src: "{{ item.src }}" src: "{{ item.src }}"

View File

@ -1,7 +1,7 @@
global global
maxconn 2048 maxconn 2048
maxconnrate 40 maxconnrate 40
unix-bind prefix /run/haproxy user nobody group nogroup unix-bind prefix {{ haproxy.socketroot }} user {{ haproxy.user }} group {{ haproxy.group }}
defaults defaults
mode http mode http
@ -29,7 +29,7 @@ resolvers local
hold nx 100ms hold nx 100ms
hold timeout 3s hold timeout 3s
hold valid 5s hold valid 5s
{% for entry in services.haproxy.ports.tcp %} {% for entry in haproxy.ports.tcp %}
listen {{ entry.group }} listen {{ entry.group }}
mode tcp mode tcp
@ -47,7 +47,7 @@ frontend http
acl root url / acl root url /
{% for domains in services.haproxy.public %} {% for domains in haproxy.public %}
use_backend backend-{{ domains.service }} if { hdr_beg(host) -i {{ domains.domain }} } use_backend backend-{{ domains.service }} if { hdr_beg(host) -i {{ domains.domain }} }
{% endfor %} {% endfor %}
@ -56,7 +56,7 @@ frontend http
http-response set-header X-Content-Type-Options nosniff http-response set-header X-Content-Type-Options nosniff
http-response set-header Referrer-Policy no-referrer-when-downgrade http-response set-header Referrer-Policy no-referrer-when-downgrade
http-response set-header Strict-Transport-Security max-age=31536000;\ includeSubDomains;\ preload http-response set-header Strict-Transport-Security max-age=31536000;\ includeSubDomains;\ preload
{% for domains in services.haproxy.public %} {% for domains in haproxy.public %}
backend backend-{{ domains.service }} backend backend-{{ domains.service }}
server-template {{ domains.service }} 1 _{{ domains.service }}._tcp.redxen.localhost server-template {{ domains.service }} 1 _{{ domains.service }}._tcp.redxen.localhost

View File

@ -1,7 +0,0 @@
apt_packages:
- { package: "haproxy", state: present }
systemd:
services:
- { name: "haproxy", enabled: true, action: reloaded, daemon_reload: true}
overrides:
- "haproxy"