IUS offers HAProxy 1.6 and 1.7 as haproxy16u and haproxy17u, respectively.
include_vars could do something like:
- include_vars:
# returns {"_haproxy_package_name": "haproxy"}
- "{{ ansible_distribution }}.yml"
Then we can install HAProxy like so:
- package:
name: "{{ haproxy_package_name | default(_haproxy_package_name) }}"