feat(loadbalancer): working on noble
Description
- (non) Working
loadbalanceron Ubuntu 24.04 Noble
Closes
- Closes #415
Very weird issue with haproxy not installing, and Salt failing to proceed because of this, but a 2nd vagrant up fixes it, it is available in the repos, etc. Troubleshooting...
loadbalancer: [ERROR ] Command 'consul-template' failed with return code: 14
loadbalancer: [ERROR ] stderr: haproxy: unrecognized service
loadbalancer: 2024/08/12 18:18:50.111644 [ERR] (cli) 1 error occurred:
loadbalancer: * failed to execute command "service haproxy reload" from "/usr/share/consul-template/templates/haproxy.cfg" => "/etc/haproxy/haproxy.cfg": child: command exited with a non-zero exit status:
loadbalancer:
loadbalancer: service haproxy reload
loadbalancer:
loadbalancer: This is assumed to be a failure. Please ensure the command
loadbalancer: exits with a zero exit status.
loadbalancer: [ERROR ] retcode: 14
loadbalancer: [ERROR ] {'pid': 4668, 'retcode': 14, 'stdout': '', 'stderr': 'haproxy: unrecognized service\n2024/08/12 18:18:50.111644 [ERR] (cli) 1 error occurred:\n\t* failed to execute command "service haproxy reload" from "/usr/share/consul-template/templates/haproxy.cfg" => "/etc/haproxy/haproxy.cfg": child: command exited with a non-zero exit status:\n\n service haproxy reload\n\nThis is assumed to be a failure. Please ensure the command\nexits with a zero exit status.'}
✗ vs loadbalancer
vagrant@loadbalancer:~$ sudo apt search haproxy
Sorting... Done
Full Text Search... Done
golang-github-armon-go-proxyproto-dev/noble 0.0~git20190211.68259f7-2 all
Golang package to handle HAProxy Proxy Protocol
haproxy/noble 2.8.5-1ubuntu3 arm64
fast and reliable load balancing reverse proxy
I'm not sure why, but it seems that the requisites system has changed some in newer releases of salt. (I am remembering most things with requisites occurring at the end, whereas now it seems to try to execute things as soon as all requisites are fulfilled).
The issue you are pointing to seems to be resolved by
diff --git a/salt/haproxy/init.sls b/salt/haproxy/init.sls
index 74a0942..f398cad 100644
--- a/salt/haproxy/init.sls
+++ b/salt/haproxy/init.sls
@@ -80,6 +80,7 @@ haproxy:
- mode: "0640"
- require:
- pkg: consul-pkgs
+ - pkg: haproxy
/usr/local/bin/haproxy-ocsp:
to explicitly require that haproxy is installed before the consul-template configuration is written, and thus before our consul state detects it and tries to act on it.
Haproxy failing to start
Aug 12 18:57:29 loadbalancer.vagrant.psf.io haproxy[4839]: [ALERT] (4839) : config : parsing [/etc/haproxy/haproxy.cfg:126] : error detected while parsing ACL 'our_domains' : failed to open pattern file </etc/haproxy/our_domains>.
Aug 12 18:57:29 loadbalancer.vagrant.psf.io haproxy[4839]: [ALERT] (4839) : config : parsing [/etc/haproxy/haproxy.cfg:129] : error detected while parsing an 'http-request deny' condition : no such ACL : 'our_domains'.
Aug 12 18:57:29 loadbalancer.vagrant.psf.io haproxy[4839]: [ALERT] (4839) : config : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
latest issue is around proxy protocol impl: [ALERT] (4824) : config : parsing [/etc/haproxy/haproxy.cfg:573] : unknown keyword 'send-proxy' in 'listen' section
Closing in favor of #486