--- - name: ping hosts: web2 become: true gather_facts: false tasks: - name: ping ping: register: ping_result - name: debug debug: var: ping_result