Skip to content

Instantly share code, notes, and snippets.

@DavidMikeSimon
Created March 27, 2013 15:31
Show Gist options
  • Select an option

  • Save DavidMikeSimon/5255115 to your computer and use it in GitHub Desktop.

Select an option

Save DavidMikeSimon/5255115 to your computer and use it in GitHub Desktop.
- name: install haproxy required packages
apt: pkg=libssl0.9.8
# We can't use the regular Ubuntu packages because they only go up to
# haproxy 1.4, which does not have SSL support
- name: download haproxy deb file
get_url: url=http://debian.byte-consult.be/haproxy_1.5-dev17_amd64.deb
dest=/root/haproxy.deb
- name: install haproxy
command: dpkg -i /root/haproxy.deb creates=/usr/sbin/haproxy
register: haproxy_bin_changed
- name: create haproxy user
user: name=haproxy
notify:
- restart haproxy
- name: create haproxy user home directory
file: path=/home/haproxy state=directory owner=haproxy mode=0400
notify:
- restart haproxy
- name: stop haproxy after installation
service: name=haproxy state=stopped
when_boolean: $haproxy_bin_changed
ignore_errors: yes
- name: disable naive haproxy init script
file: path=/etc/rc2.d/S20haproxy state=absent
- name: configure haproxy with supervisor
copy: src=common/files/haproxy-supervisor.conf
dest=/etc/supervisor/conf.d/haproxy-supervisor.conf
notify:
- reload supervisor config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment