- hosts: [{{host}}] sudo: yes tasks: - apt: name: haproxy state: present - replace: dest: '/etc/default/haproxy' regexp: ENABLED=0 replace: ENABLED=1