---

- name: "install haproxy package"
  apt:
    name: "haproxy"
    state: present

- name: "haproxy configuration"
  template:
    src: "mediawiki.cfg.j2"
    dest: "/etc/haproxy/haproxy.cfg"
    owner: "root"
    group: "root"
  notify: "restart haproxy"

# Force restart handlers
- meta: flush_handlers

- name: "enable and start haproxy service"
  service:
    name: "haproxy"
    state: started
    enabled: yes
