Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions molecule/haproxy/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ dependency:
driver:
name: "podman"
platforms:
- name: "haproxy_v3.2"
image: "${MOLECULE_IMAGE:-ghcr.io/hifis-net/ubuntu-systemd:24.04}"
pre_build_image: true
privileged: true
override_command: false
systemd: true
tty: true
- name: "haproxy_v3.0"
image: "${MOLECULE_IMAGE:-ghcr.io/hifis-net/ubuntu-systemd:24.04}"
pre_build_image: true
Expand Down Expand Up @@ -45,6 +52,10 @@ provisioner:
vars:
haproxy_ssl_dhparam_size: 512
host_vars:
haproxy_v3.2:
haproxy_create_self_signed_cert: true
haproxy_ppa_version: "ppa:vbernat/haproxy-3.2"
haproxy_version: "3.2.*"
haproxy_v3.0:
haproxy_create_self_signed_cert: true
haproxy_ppa_version: "ppa:vbernat/haproxy-3.0"
Expand Down
5 changes: 4 additions & 1 deletion molecule/haproxy/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
ansible.builtin.meta: "end_host"
when: >-
ansible_facts.distribution_release | lower == 'bookworm' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.4', '==') or
ansible_facts.distribution_release | lower == 'bullseye' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=') or
ansible_facts.distribution_release | lower == 'buster' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.8', '>=')
- name: "Stop play for unsupported HAProxy / Ubuntu combinations"
ansible.builtin.meta: "end_host"
when: "ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<')"
when: >-
ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<') or
ansible_facts.distribution_release | lower != 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=')
- name: "Populate service facts."
ansible.builtin.service_facts:
Expand Down
4 changes: 2 additions & 2 deletions roles/haproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ haproxy_executable_path: '/usr/sbin/haproxy'
Variable to pin the PPA version to a certain value:

```yaml
haproxy_ppa_version: 'ppa:vbernat/haproxy-3.0'
haproxy_ppa_version: 'ppa:vbernat/haproxy-3.2'
```

#### HAProxy version

Variable to pin the HAProxy version to a certain value:

```yaml
haproxy_version: '3.0.*'
haproxy_version: '3.2.*'
```

#### HAProxy user
Expand Down
4 changes: 2 additions & 2 deletions roles/haproxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# Path to the executable of HAProxy
haproxy_executable_path: "/usr/sbin/haproxy"
# HAProxy PPA version
haproxy_ppa_version: "ppa:vbernat/haproxy-3.0"
haproxy_ppa_version: "ppa:vbernat/haproxy-3.2"
# HAProxy version
haproxy_version: "3.0.*"
haproxy_version: "3.2.*"
# HAProxy user
haproxy_user: "haproxy"
# HAProxy group
Expand Down
5 changes: 4 additions & 1 deletion roles/haproxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
ansible.builtin.meta: "end_host"
when: >-
ansible_facts.distribution_release | lower == 'bookworm' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.4', '==') or
ansible_facts.distribution_release | lower == 'bullseye' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=') or
ansible_facts.distribution_release | lower == 'buster' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.8', '>=')
- name: "Stop role for unsupported HAProxy / Ubuntu combinations"
ansible.builtin.meta: "end_host"
when: "ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<')"
when: >-
ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<') or
ansible_facts.distribution_release | lower != 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=')
- name: "Enable ip_forward."
become: true
Expand Down