v8.1.3: Update haproxy.service template for distribution version logic

Adjusted the condition to apply "EXTRAOPTS" only for version 7 of the distribution. This ensures compatibility and prevents unintended configuration for other versions.
pull/410/head
Aidaho 2024-12-13 12:44:53 +03:00
parent 05279fa64f
commit 8a99e206d4
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ After=network.target
[Service]
EnvironmentFile=-/etc/default/haproxy
EnvironmentFile=-/etc/sysconfig/haproxy
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" {% if ansible_facts['distribution_major_version'] != '8' %}"EXTRAOPTS=-S /run/haproxy-master.sock"{% endif %}
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" {% if ansible_facts['distribution_major_version'] == '7' %}"EXTRAOPTS=-S /run/haproxy-master.sock"{% endif %}
ExecStartPre=/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecStart=/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS