File tree Expand file tree Collapse file tree 8 files changed +57
-5
lines changed Expand file tree Collapse file tree 8 files changed +57
-5
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,21 @@ haproxy_ssl_options: no-sslv3 no-tls-tickets force-tlsv12
177
177
haproxy_ssl_ciphers : AES128+EECDH:AES128+EDH
178
178
haproxy_ssl : ' ssl crt {{ haproxy_ssl_certificate }} ciphers {{ haproxy_ssl_ciphers }} {{ haproxy_ssl_options }}'
179
179
180
+ # # Certificate Storage
181
+ haproxy_certstore :
182
+ - web :
183
+ crt_base : /etc/ssl/
184
+ key_base : /etc/ssl/private/
185
+ load :
186
+ - crt "example.com_fullchain.crt" key "example.com.key" alias "example_com"
187
+ - internal :
188
+ crt_base : /etc/ssl/
189
+ key_base : /etc/ssl/private/
190
+ load :
191
+ - crt "example.de_fullchain.crt" key "example.de.key" alias "example_de"
192
+
193
+ haproxy_ssl : ' tfo ssl crt "@web/example_com" alpn h2,http/1.1 ssl-min-ver TLSv1.2'
194
+
180
195
# Docker
181
196
# see more details in `tasks/docker.yml` and https://docs.ansible.com/ansible/latest/collections/community/general/docker_container_module.html
182
197
haproxy_docker_name : " haproxy"
Original file line number Diff line number Diff line change 4
4
ansible.builtin.service :
5
5
name : " {{ haproxy_service }}"
6
6
state : restarted
7
- when : haproxy_mode == "system"
7
+ when : haproxy_mode == "system" or haproxy_mode == "custom"
8
8
9
9
- name : Reload haproxy
10
10
ansible.builtin.service :
11
11
name : " {{ haproxy_service }}"
12
12
state : reloaded
13
- when : haproxy_mode == "system"
13
+ when : haproxy_mode == "system" or haproxy_mode == "custom"
Original file line number Diff line number Diff line change 1
1
---
2
2
# file: roles/haproxy/tasks/config.yml
3
3
- name : Configuring HAproxy
4
+ tags : [haproxy, haproxy-config]
4
5
ansible.builtin.template :
5
6
src : etc/haproxy/haproxy.cfg.j2
6
7
dest : " {{ haproxy_config }}"
Original file line number Diff line number Diff line change 33
33
- name : Sysctl
34
34
include_tasks : sysctl.yml
35
35
tags : [haproxy, haproxy-sysctl]
36
- when : haproxy_mode == "system"
36
+ when : haproxy_mode == "system" or haproxy_mode == "custom"
37
37
38
38
- name : Docker
39
39
include_tasks : docker.yml
Original file line number Diff line number Diff line change 1
1
---
2
2
# file: roles/haproxy/tasks/sysctl.yml
3
- - name : Enabling/Disabling net.ipv4.ip_nonlocal_bind option
3
+ - name : Enabling/Disabling net.ipvX.ip_nonlocal_bind option
4
+ tags : [haproxy, haproxy-sysctl]
4
5
ansible.posix.sysctl :
5
- name : net.ipv4.ip_nonlocal_bind
6
+ name : " {{ item }} "
6
7
value : " 1"
7
8
sysctl_file : /etc/sysctl.d/10-ip_nonlocal_bind.conf
8
9
sysctl_set : true
9
10
reload : true
10
11
state : present
12
+ with_items :
13
+ - net.ipv4.ip_nonlocal_bind
14
+ - net.ipv6.ip_nonlocal_bind
11
15
notify : Restart haproxy
12
16
when : haproxy_bind_nonlocal_ip | bool
13
17
14
18
- name : Enabling/Disabling net.ipv4.ip_forward option
19
+ # tags: [haproxy, haproxy-sysctl]
15
20
ansible.posix.sysctl :
16
21
name : net.ipv4.ip_forward
17
22
value : " 1"
Original file line number Diff line number Diff line change
1
+ {% if haproxy_certstore is defined and haproxy_certstore |length %}
2
+ ##########################
3
+ # Certificate Storage #
4
+ ##########################
5
+ {% for dict_item in haproxy_certstore %}
6
+ {% for name , value in dict_item .items () %}
7
+ crt-store {{ name }}
8
+ {% if value .crt_base is defined %}
9
+ crt-base {{ value.crt_base }}
10
+ {% endif %}
11
+ {% if value .key_base is defined %}
12
+ key-base {{ value.key_base }}
13
+ {% endif %}
14
+ {% if value .load is defined %}
15
+ {% for load in value .load %}
16
+ load {{ load }}
17
+ {% endfor %}
18
+ {% endif %}
19
+ {% endfor %}
20
+
21
+ {% endfor %}
22
+ {% endif %}
Original file line number Diff line number Diff line change 25
25
gid {{ haproxy_global_gid }}
26
26
{% endif %}
27
27
maxconn {{ haproxy_global_maxconn | default('4000') }}
28
+ {% if ansible_os_family != 'Debian' %}
28
29
pidfile {{ haproxy_global_pidfile | default('/var/run/haproxy.pid') }}
30
+ {% endif %}
29
31
{% if haproxy_global_ca_base is defined and haproxy_global_ca_base | length %}
30
32
ca-base {{ haproxy_global_ca_base }}
31
33
{% endif %}
53
55
{% if haproxy_global_ssl_server_verify is defined and haproxy_global_ssl_server_verify | length %}
54
56
ssl-server-verify {{ haproxy_global_ssl_server_verify }}
55
57
{% endif %}
58
+ {% if haproxy_global_limited_quic is defined and haproxy_global_limited_quic is true %}
59
+ limited-quic
60
+ {% endif %}
56
61
{% if haproxy_global_stats is defined and haproxy_global_stats | length %}
57
62
{% for stat in haproxy_global_stats %}
58
63
stats {{ stat }}
Original file line number Diff line number Diff line change 10
10
11
11
{# USERLIST CONFIGURATION #}
12
12
{% include 'haproxy-userlist.cfg.j2' %}
13
+
14
+ {# Certificate Storage #}
15
+ {% include 'haproxy-certstore.cfg.j2' %}
16
+
13
17
{# STATS CONFIGURATION #}
14
18
{% include 'haproxy-stats.cfg.j2' %}
15
19
You can’t perform that action at this time.
0 commit comments