Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 715 Bytes
- hosts: loadbalancer
user: root
sudo: yes
- private/private-vars.yml
- name: install haproxy
apt: name=haproxy state=latest
notify: flush iptables
- name: enable haproxy
service: name=haproxy enabled=yes state=started
- name: enable haproxy for ubuntu
template: src=templates/haproxy.j2 dest=/etc/default/haproxy backup=yes
notify: restart haproxy
- name: add haproxy config
template: src=templates/haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg backup=yes
notify: restart haproxy
- name: restart haproxy
service: name=haproxy state=restarted
- name: flush iptables
shell: iptables -F
You can’t perform that action at this time.