---
- hosts: web:haproxy
  gather_facts: yes

- hosts: web
  name: performs rolling restart
  gather_facts: no
  serial: 1
  sudo: yes

  pre_tasks:

  - name: disable the server in haproxy
    haproxy: action=disable_server host={{ inventory_hostname }} backend=web_backend
    delegate_to: "{{ groups.haproxy.0 }}"

  roles:
  - lameapp

  post_tasks:

  - name: enable the server in haproxy
    haproxy: action=enable_server host={{ inventory_hostname }} backend=web_backend
    delegate_to: "{{ groups.haproxy.0 }}"


---
- hosts: web:haproxy
  gather_facts: yes

- hosts: web
  name: performs rolling restart
  gather_facts: no
  serial: 1
  sudo: yes

  pre_tasks:

  - name: disable the server in haproxy
    haproxy: state=disabled host={{ inventory_hostname }} backend=web_backend
    delegate_to: "{{ groups.haproxy.0 }}"

  roles:
  - lameapp

  post_tasks:

  - name: enable the server in haproxy
    haproxy: state=enabled host={{ inventory_hostname }} backend=web_backend
    delegate_to: "{{ groups.haproxy.0 }}"


Update to haproxy module syntax
Update to haproxy module syntax

the old way doesnt work with the current Ansible version.