--- - hosts: serverctl_mesh_nodes gather_facts: yes tasks: - name: ping command: "ping -c3 {{ hostvars[item].wireguard_ip}}" with_items: "{{groups['all']}}"