ansible-haproxy icon indicating copy to clipboard operation
ansible-haproxy copied to clipboard

Add support for compiling the source code

Open fradaloisio opened this issue 3 years ago • 0 comments

What?

This PR will add support for compiling the source code of HAProxy, install a specific minor version, install the systemd file instead of the init.d (in case systemd is installed), create the global haproxy user and global haproxy group.

Why?

I've decided to start from something already working and build a role which compiles a specific haproxy version for different Linux distro (with Lua support also). The 'latest' version is not always what we would like to install. A scenario would be a deployment of a cluster of HAProxy in different phases, and in between these phases, a new minor version of HAProxy is released. By specifying the minor version, the cluster would have the same software installed. Another reason for this PR is a scenario where you want to install/configure/manage haproxy in the same infrastructure but in different Linux distribution, e.g. as a sidecar proxy.

How?

The main idea is to change just what is needed to compile and install haproxy. The PPA support has been kept as it is, but the variable haproxy_use_ppa has been changed to false by default. The install.yml has been renamed to install_ppa.yml, and a new intsall_src.yml has been added. In the tasks folder, the file main.yml has been changed in order to load the install_ppa.yml where the variable haproxy_use_ppa is true or load the install_ppa.yml when the haproxy_use_ppa is false.

Testing?

In the tests, other Vagrant boxes have been added, but Ubuntu 12 has been dropped since the PCRE JIT is not well supported. In the vagrant file Debian, CentOS and AMI Linux have been added.

Anything Else?

This role is the best role that I've seen so far.

fradaloisio avatar Jan 02 '21 22:01 fradaloisio