Hi Brian,

Thanks a lot for the help. 

 Yes, it works as expected. 

I really appreciate that. 

Frank  




On Tuesday, December 6, 2022 at 5:22:29 PM UTC-5 Brian Coca wrote:

> - hosts: test-vms
> tasks:
> - name: Ping vms in test-vms
> ansible.builtin.ping:
> register: ping_pong
> ignore_errors: True
>
> - hosts: localhost
> gather_facts: no
> tasks:
> - name: Copy the output result to /tmp/file.txt
> ansible.builtin.template:
> src: ping.j2
> dest: /tmp/file.txt
>
>
> ping.j2:
> {% for host in groups['test-vms'] %}
> {{ host }}: {{ hostvars[host]['ping_pong'] }}
> {% endfor %}
>
> -- 
> ----------
> Brian Coca
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7ed370cc-4aac-4867-844f-864a4754d362n%40googlegroups.com.

Reply via email to