devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

Use haproxy 1.5 #3

Closed scottrobertson closed 9 years ago

scottrobertson commented 9 years ago

It would be good if we could use HAProxy 1.5:

add-apt-repository ppa:vbernat/haproxy-1.5

rafecolton commented 9 years ago

My experience has been that version 1.5 is indeed installed as long as apt-get update has been run fairly recently. Have you had a different experience? Maybe the solution is to add update_cache=yes to the package install step

scottrobertson commented 9 years ago

As far as I am aware you need the PPA to get 1.5. Ubuntu 14.04 is 1.4 by default.

rafecolton commented 9 years ago

So it is.

- name: add haproxy apt repo
  apt_repository: repo="ppa:vbernat/haproxy-1.5" state=present
scottrobertson commented 9 years ago

Yeah, this is what I did: https://github.com/scottrobertson/ansible-haproxy/commit/5995d27da87d38b98a0b4f87cc56be00782a43ad

PierrePaul commented 9 years ago

By default ubuntu 14.04, LTS version will install haproxy 1.4.24-2. I'm not really sure adding a dependency on an external apt repository (and subsequently an haproxy version) is the way to go.

@rafecolton If I remember correctly, you have more experience with SmartOS. What's your position on this?

rafecolton commented 9 years ago

@PierrePaul that repository is the one blessed by the haproxy documentation. As long as it has a when: ansible_os_family == "Debian" clause, it is both a fine and preferred way to install haproxy 1.5 on Ubuntu. If you are at all unsure, perhaps add another guard statement - for example:

- name: add haproxy apt repo
  apt_repository: repo="ppa:vbernat/haproxy-1.5" state=present
  when: ansible_os_family == "Debian" and haproxy_use_one_point_five|bool

Then be sure to add a default value in defaults/main.yml

# defaults/main.yml
haproxy_use_one_point_five: no

edit: http://haproxy.debian.net/

PierrePaul commented 9 years ago

Now forcing 1.5 on ubuntu (see commit a1d763da8457082f7e47520551696bad6d39b79f). I didnt put the variable haproxy_use_one_point_five, I just noticed that the recommended stable version according to haproxy is actually 1.5. @rafecolton I did use the check for the ansible_os_family.

Thanks everyone for your input.