Skip to content

Commit bae4511

Browse files
committed
Extend unsupported distro/version check for HAProxy >= 3.2
Added support checks to prevent role execution for HAProxy >= 3.2 on Debian Bullseye and non-Ubuntu Noble distributions. This avoids failure on unsupported combinations. Signed-off-by: Norman Ziegner <n.ziegner@hzdr.de>
1 parent 0258af2 commit bae4511

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

molecule/haproxy/verify.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
ansible.builtin.meta: "end_host"
1212
when: >-
1313
ansible_facts.distribution_release | lower == 'bookworm' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.4', '==') or
14+
ansible_facts.distribution_release | lower == 'bullseye' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=') or
1415
ansible_facts.distribution_release | lower == 'buster' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.8', '>=')
1516
1617
- name: "Stop play for unsupported HAProxy / Ubuntu combinations"
1718
ansible.builtin.meta: "end_host"
18-
when: "ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<')"
19+
when: >-
20+
ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<') or
21+
ansible_facts.distribution_release | lower != 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=')
1922
2023
- name: "Populate service facts."
2124
ansible.builtin.service_facts:

roles/haproxy/tasks/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
ansible.builtin.meta: "end_host"
1919
when: >-
2020
ansible_facts.distribution_release | lower == 'bookworm' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.4', '==') or
21+
ansible_facts.distribution_release | lower == 'bullseye' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=') or
2122
ansible_facts.distribution_release | lower == 'buster' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.8', '>=')
2223
2324
- name: "Stop role for unsupported HAProxy / Ubuntu combinations"
2425
ansible.builtin.meta: "end_host"
25-
when: "ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<')"
26+
when: >-
27+
ansible_facts.distribution_release | lower == 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('2.9', '<') or
28+
ansible_facts.distribution_release | lower != 'noble' and haproxy_version | regex_search('\\d+\\.\\d+') is version('3.2', '>=')
2629
2730
- name: "Enable ip_forward."
2831
become: true

0 commit comments

Comments
 (0)