2016-04-13 19:52:10 +02:00
|
|
|
---
|
|
|
|
- name: Get the haproxy repo key
|
2016-04-20 15:21:19 +02:00
|
|
|
apt_key: url={{ haproxy_repo_key }} state=present
|
2016-04-13 19:52:10 +02:00
|
|
|
when: haproxy_latest_release
|
|
|
|
tags: haproxy
|
|
|
|
|
|
|
|
- name: Define the haproxy repository
|
2016-04-20 15:21:19 +02:00
|
|
|
apt_repository: repo='{{ haproxy_ubuntu_latest_repo }}' state=present update_cache=yes
|
|
|
|
when:
|
|
|
|
- haproxy_latest_release
|
|
|
|
- is_ubuntu
|
|
|
|
tags: haproxy
|
|
|
|
|
|
|
|
- name: Define the haproxy repository
|
|
|
|
apt_repository: repo='{{ haproxy_debian_latest_repo }}' state=present update_cache=yes
|
|
|
|
when:
|
|
|
|
- haproxy_latest_release
|
|
|
|
- is_debian
|
2016-04-13 19:52:10 +02:00
|
|
|
tags: haproxy
|
|
|
|
|
|
|
|
- name: Install the haproxy package
|
2017-07-11 16:36:30 +02:00
|
|
|
apt: name=haproxy state=present default_release={{ ansible_lsb.codename }}-backports update_cache=yes cache_valid_time=3600
|
2016-04-13 19:52:10 +02:00
|
|
|
when: not haproxy_latest_release
|
2016-04-20 15:21:19 +02:00
|
|
|
register: install_haproxy
|
2016-04-13 19:52:10 +02:00
|
|
|
tags: haproxy
|
|
|
|
|
|
|
|
- name: Install the haproxy package
|
2017-07-11 16:36:30 +02:00
|
|
|
apt: name=haproxy state=latest default_release={{ ansible_lsb.codename }}-backports-{{ haproxy_version }} update_cache=yes cache_valid_time=3600
|
2016-04-13 19:52:10 +02:00
|
|
|
when:
|
|
|
|
- haproxy_latest_release
|
|
|
|
- is_debian
|
2016-04-20 15:21:19 +02:00
|
|
|
register: install_haproxy
|
2016-04-13 19:52:10 +02:00
|
|
|
tags: haproxy
|
|
|
|
|
|
|
|
- name: Install the haproxy package
|
2017-07-11 16:36:30 +02:00
|
|
|
apt: name=haproxy state=latest update_cache=yes cache_valid_time=3600
|
2016-04-13 19:52:10 +02:00
|
|
|
when:
|
|
|
|
- haproxy_latest_release
|
|
|
|
- is_ubuntu
|
2016-04-20 15:21:19 +02:00
|
|
|
register: install_haproxy
|
2016-04-13 19:52:10 +02:00
|
|
|
tags: haproxy
|
|
|
|
|
2016-07-05 12:45:01 +02:00
|
|
|
- name: Enable kernel binding non local IP addresses
|
|
|
|
sysctl: name={{ item }} value=1 reload=yes state=present
|
|
|
|
with_items:
|
|
|
|
- net.ipv4.ip_nonlocal_bind
|
|
|
|
when: haproxy_k_bind_non_local_ip
|
2017-12-19 17:58:31 +01:00
|
|
|
tags: [ 'haproxy', 'haproxy_sysctl' ]
|
2016-07-05 12:45:01 +02:00
|
|
|
|
|
|
|
- name: Disable kernel binding non local IP addresses
|
|
|
|
sysctl: name={{ item }} value=0 reload=yes state=present
|
|
|
|
with_items:
|
|
|
|
- net.ipv4.ip_nonlocal_bind
|
|
|
|
when: not haproxy_k_bind_non_local_ip
|
2017-12-19 17:58:31 +01:00
|
|
|
tags: [ 'haproxy', 'haproxy_sysctl' ]
|
|
|
|
|
|
|
|
- name: Increase the connection tracking table capacity
|
|
|
|
sysctl: name={{ item }} value={{ haproxy_sysctl_conntrack_max }} reload=yes state=present
|
|
|
|
with_items:
|
|
|
|
- net.nf_conntrack_max
|
2018-09-16 13:51:34 +02:00
|
|
|
when: is_not_debian9
|
2017-12-19 17:58:31 +01:00
|
|
|
tags: [ 'haproxy', 'haproxy_sysctl' ]
|
2016-04-13 19:52:10 +02:00
|
|
|
|