From c9d6d35ddaf9dcb16f40c0f4b47598c850c01d8c Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 10 Nov 2023 18:02:53 +0100 Subject: [PATCH] Fix the sysctl behaviour --- defaults/main.yml | 2 +- tasks/haproxy-sysctl.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0d7658e..3f58b94 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,7 +7,7 @@ haproxy_ubuntu_latest_repo: "ppa:vbernat/haproxy-{{ haproxy_version }}" haproxy_pkg_state: present haproxy_enabled: True haproxy_loglevel: info -haproxy_k_bind_non_local_ip: True +haproxy_k_bind_non_local_ip:"{% if keepalived_enabled is defined and keepalived_enabled %}true{% else %}false{% endif %}" haproxy_install_dataplane_api: True haproxy_dataplane_api_version: '{{ haproxy_version }}.0' haproxy_dataplane_api_download_url: 'https://github.com/haproxytech/dataplaneapi/releases/download/v{{ haproxy_dataplane_api_version }}/dataplaneapi_{{ haproxy_dataplane_api_version }}_Linux_x86_64.tar.gz' diff --git a/tasks/haproxy-sysctl.yml b/tasks/haproxy-sysctl.yml index 9099257..6c8f358 100644 --- a/tasks/haproxy-sysctl.yml +++ b/tasks/haproxy-sysctl.yml @@ -10,6 +10,7 @@ sysctl: name={{ item }} value={{ haproxy_sysctl_conntrack_max }} reload=yes state=present with_items: - net.nf_conntrack_max + when: iptables_persistent_enabled is defined and iptables_persistent_enabled tags: [ 'haproxy', 'haproxy_sysctl' ]