My playbook is as follows
- hosts: nodes
become: yes
tasks:
- name: Run Shell Script to get IPs with 4xx and 5xx errors
script: /home/ubuntu/ips.sh
args:
chdir: /home/ubuntu
register: ips
- name:
shell: echo "{{ hostvars[groups['nodes'][0]].ips.stdout}}" > pip.txt
delegate_to: localhost
There are 10 ansible hosts. Is There a way I can access Ips.stdout from all
10 hosts from my local server. I'm able to get the first host by the above
command. How can I access all 10 hosts stdout from a single variable?
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/71fb47dc-de47-47b2-93fc-c4b6730b2752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.