pre_install() {
  getent group haproxy &>/dev/null || groupadd -r haproxy &>/dev/null
  getent passwd haproxy &>/dev/null || useradd -r -g haproxy -d /var/lib/haproxy -s /sbin/nologin -c "haproxy" haproxy &>/dev/null || :
}

post_install() {
  echo " >> User and group created for haproxy"
  echo " >> Please edit the settings in /etc/haproxy/haproxy.cfg"
  echo " >> Documentation can be found in /usr/share/doc/haproxy"
}
post_remove() {
  # Remove user and group
  echo " >> User and group deleted for haproxy"
  userdel haproxy
}

