2025-10-22 15:34:42 +02:00
2024-12-20 17:15:44 +01:00
2024-12-20 17:15:44 +01:00
2024-12-20 17:15:44 +01:00
2025-09-23 15:12:08 +02:00
2024-12-20 17:09:00 +01:00

haproxy

The present role:

  • install HAProxy
  • push a default configuration file
  • generate a self-signed certificate

By default, HAProxy will be installed from Debian backports repository, but you can optionnaly choose to install it from HAPRoxy's Debian repository (and choose the version). Configuration file could also be overrided.

Optional: Use HAProxy's official Debian repository

You can enable installation from the official HAProxy Debian repository by setting the following variable in your playbook or inventory:

haproxy_use_debian_repo: true

You can also override the following variables if needed:

haproxy_debian_repo_url: 'http://haproxy.debian.net'
haproxy_debian_repo_distribution: '{{ ansible_distribution_release }}'
haproxy_debian_repo_component: 'main'
haproxy_debian_repo_key_url: 'https://haproxy.debian.net/bernat.debian.org.gpg'
haproxy_version: '3.2'  # default version

The apt source line will look like:

deb [signed-by=/usr/share/keyrings/haproxy.debian.net.gpg] http://haproxy.debian.net bookworm-backports-3.2 main

By default, the role installs HAProxy from Debian backports. If you enable the repository, it will be added and HAProxy will be installed from there.

Overriding the HAProxy configuration file

If you want to use your own configuration file (outside the role), set the variable haproxy_custom_configuration_file to the path of your file. The role will copy it to /etc/haproxy/haproxy.cfg instead of rendering the template.

Example:

haproxy_custom_configuration_file: '/path/to/my/haproxy.cfg'

If not set, the default template haproxy.cfg.j2 will be used.

You can enable installation from the official HAProxy Debian repository by setting the following variable in your playbook or inventory:

haproxy_use_debian_repo: true

You can also override the following variables if needed:

haproxy_debian_repo_url: 'http://haproxy.debian.net'
haproxy_debian_repo_distribution: '{{ ansible_distribution_release }}'
haproxy_debian_repo_component: 'main'
haproxy_debian_repo_key_url: 'https://haproxy.debian.net/haproxy-archive-keyring.gpg'

By default, the role installs HAProxy from Debian backports. If you enable the repository, it will be added and HAProxy will be installed from there.

Description
No description provided
Readme MIT 39 KiB
Languages
Jinja 100%