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
|
|
|
|
|
|
|
|
- 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
|
2016-04-13 19:52:10 +02:00
|
|
|
|