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
parent
58972cf188
commit
29ef364fab
|
@ -1,2 +0,0 @@
|
|||
[Service]
|
||||
Environment=CONFIG=/etc/haproxy
|
|
@ -11,39 +11,35 @@
|
|||
tags:
|
||||
- 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
|
||||
copy:
|
||||
src=haproxy.cfg
|
||||
dest=/etc/haproxy
|
||||
mode=0644
|
||||
src: haproxy.cfg
|
||||
dest: /etc/haproxy
|
||||
mode: u=rw,go=r
|
||||
notify: restart haproxy
|
||||
- name: ensure haproxy global configuration is set
|
||||
template:
|
||||
src=global.cfg.j2
|
||||
dest=/etc/haproxy/10-global.cfg
|
||||
mode=0644
|
||||
src: global.cfg.j2
|
||||
dest: /etc/haproxy/conf.d/10-global.cfg
|
||||
mode: u=rw,go=r
|
||||
notify: restart haproxy
|
||||
- name: ensure haproxy defaults are set
|
||||
template:
|
||||
src=defaults.cfg.j2
|
||||
dest=/etc/haproxy/20-defaults.cfg
|
||||
mode=0644
|
||||
src: defaults.cfg.j2
|
||||
dest: /etc/haproxy/conf.d/20-defaults.cfg
|
||||
mode: u=rw,go=r
|
||||
notify: restart haproxy
|
||||
|
||||
- name: ensure haproxy starts at boot
|
||||
service:
|
||||
name=haproxy
|
||||
enabled=yes
|
||||
name: haproxy
|
||||
enabled: true
|
||||
tags:
|
||||
- service
|
||||
|
||||
- name: ensure haproxy is running
|
||||
service:
|
||||
name: haproxy
|
||||
state: started
|
||||
tags:
|
||||
- service
|
||||
|
|
Loading…
Reference in New Issue