2014-03-14 17:50:31 +08:00
|
|
|
---
|
2014-11-06 00:57:28 +08:00
|
|
|
- name: Add repository
|
2014-09-05 03:14:11 +08:00
|
|
|
apt_repository: >
|
2014-11-06 00:57:28 +08:00
|
|
|
repo=ppa:vbernat/haproxy-1.5
|
2014-09-05 03:14:11 +08:00
|
|
|
state=present
|
2014-03-14 17:50:31 +08:00
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- name: Install haproxy
|
2014-09-05 03:14:11 +08:00
|
|
|
apt: >
|
|
|
|
name={{ item }}
|
|
|
|
state=present
|
2014-03-14 17:50:31 +08:00
|
|
|
with_items:
|
|
|
|
- haproxy
|
|
|
|
- socat
|
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- name: Copy default configuration
|
2014-09-05 03:14:11 +08:00
|
|
|
copy: >
|
|
|
|
src=precise/haproxy
|
|
|
|
dest=/etc/default/haproxy
|
2014-03-14 17:50:31 +08:00
|
|
|
notify: restart haproxy
|
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- name: Create configuration
|
2014-09-05 03:14:11 +08:00
|
|
|
template: >
|
|
|
|
src=precise/haproxy.cfg
|
|
|
|
dest=/etc/haproxy/haproxy.cfg
|
|
|
|
backup=yes
|
2014-03-14 17:50:31 +08:00
|
|
|
notify: restart haproxy
|
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- name: Start and enable haproxy
|
2014-09-05 03:14:11 +08:00
|
|
|
service: >
|
|
|
|
name=haproxy
|
|
|
|
state=started
|
|
|
|
enabled=yes
|