Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAProxy configuration validation fails during role execution on Ubuntu 24.04 #57

Open
Cust0mfirmware opened this issue Oct 21, 2024 · 2 comments

Comments

@Cust0mfirmware
Copy link

Environment

OS: Ubuntu 24.04
Ansible Environment:

ansible [core 2.16.3]
config file = /home/user/.ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True

Playbook Used

---
- name: Install and configure HAProxy Load Balancer
  hosts: loadbalancers
  become: true
  roles:
    - { role: geerlingguy.haproxy }

Error Details

When running the role geerlingguy.haproxy on an Ubuntu 24.04 system, the task Copy HAProxy configuration in place fails with the following message:

TASK [geerlingguy.haproxy : Copy HAProxy configuration in place.] **************
fatal: [loadbalancer]: FAILED! => {"changed": false, "checksum": "c6c037af65e62d4d6ee5db810f49a9bd1f83df13", "exit_status": 1, "msg": "failed to validate", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Steps to Reproduce

  • Set up a fresh Ubuntu 24.04 environment.
  • Install Ansible and the geerlingguy.haproxy role.
  • Run the provided playbook with the configuration as outlined above.

Expected Behavior

HAProxy should install, the configuration should be copied, without validation errors.

Actual Behavior:

The playbook fails at task "Copy HAProxy configuration in place", error message see above.

Additional Notes

The HAProxy configuration seems to be valid, running haproxy -f /etc/haproxy/haproxy.cfg -c directly on the Ubuntu system does not show any syntax errors.

@philipp-intelliroad
Copy link

I ran into the same problem.

My haproxy version is: "HAProxy version 2.8.5-1ubuntu3.1 2024/10/02"

Nov 26 11:50:38 haproxy01 haproxy[14756]: [NOTICE]   (14756) : haproxy version is 2.8.5-1ubuntu3.1
Nov 26 11:50:38 haproxy01 haproxy[14756]: [NOTICE]   (14756) : path to executable is /usr/sbin/haproxy
Nov 26 11:50:38 haproxy01 haproxy[14756]: [ALERT]    (14756) : config : parsing [/etc/haproxy/haproxy.cfg:35] : 'option httpchk' : hiding headers or body at the end of the version string is unsupported>
Nov 26 11:50:38 haproxy01 haproxy[14756]: [ALERT]    (14756) : config : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
Nov 26 11:50:38 haproxy01 haproxy[14756]: [ALERT]    (14756) : config : Fatal errors found in configuration.
Nov 26 11:50:38 haproxy01 systemd[1]: haproxy.service: Main process exited, code=exited, status=1/FAILURE

If I create a configuration without the httpchk header everything works fine.

@philipp-intelliroad
Copy link

Adding - haproxy_backend_httpchk: "" as var removes the httpchk line from the file and fixes the problem for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants