r/haproxy: Clean up for modern haproxy versions

The current version of *haproxy* packaged in Fedora already enables
configuration via fragments in a drop-in directory, though it uses
a different path by default.  I still like separating the global
configuration from the defaults, though, and keeping the main
`haproxy.cfg` file empty.
frigate-exporter
Dustin 2024-06-12 18:28:16 -05:00
parent 58972cf188
commit 29ef364fab
2 changed files with 20 additions and 26 deletions

View File

@ -1,2 +0,0 @@
[Service]
Environment=CONFIG=/etc/haproxy

View File

@ -11,39 +11,35 @@
tags: tags:
- install - install
- name: ensure haproxy unit configuration extension directory exists
file:
path=/etc/systemd/system/haproxy.service.d
mode=0755
state=directory
- name: ensure haproxy config variable override is set
copy:
src=haproxy-config.conf
dest=/etc/systemd/system/haproxy.service.d/config.conf
mode=0644
notify:
- reload systemd
- restart haproxy
- name: ensure default haproxy configuration file is empty - name: ensure default haproxy configuration file is empty
copy: copy:
src=haproxy.cfg src: haproxy.cfg
dest=/etc/haproxy dest: /etc/haproxy
mode=0644 mode: u=rw,go=r
notify: restart haproxy notify: restart haproxy
- name: ensure haproxy global configuration is set - name: ensure haproxy global configuration is set
template: template:
src=global.cfg.j2 src: global.cfg.j2
dest=/etc/haproxy/10-global.cfg dest: /etc/haproxy/conf.d/10-global.cfg
mode=0644 mode: u=rw,go=r
notify: restart haproxy notify: restart haproxy
- name: ensure haproxy defaults are set - name: ensure haproxy defaults are set
template: template:
src=defaults.cfg.j2 src: defaults.cfg.j2
dest=/etc/haproxy/20-defaults.cfg dest: /etc/haproxy/conf.d/20-defaults.cfg
mode=0644 mode: u=rw,go=r
notify: restart haproxy notify: restart haproxy
- name: ensure haproxy starts at boot - name: ensure haproxy starts at boot
service: service:
name=haproxy name: haproxy
enabled=yes enabled: true
tags:
- service
- name: ensure haproxy is running
service:
name: haproxy
state: started
tags:
- service