--- - name: Verify hosts: all become: yes gather_facts: no tasks: - name: install testing requirements ansible.builtin.package: name: socat state: present notify: - uninstall testing requirements - name: check if ports responds ansible.builtin.wait_for: port: "{{ item }}" loop: - 80 - 443 - name: check of content can be retrieved ansible.builtin.uri: url: "{{ item }}" validate_certs: no status_code: - 200 - 403 loop: - "http://localhost/" - "https://localhost/" - name: check if stats are available ansible.builtin.shell: cmd: echo "show stat" | socat unix-connect:/var/lib/haproxy/stats stdio changed_when: no handlers: - name: uninstall testing requirements ansible.builtin.package: name: socat state: absent