- name: Check if haproxy.cfg exists stat: path: "/etc/haproxy/haproxy.cfg" register: haproxy_config_file_exists_result - name: Set fact about existing haproxy.cfg set_fact: haproxy_config_file_exists: "{{ true if haproxy_config_file_exists_result.stat.exists else false }}"