Get host name of the servers where the task failed

11 views
Skip to first unread message

Pandu jh

unread,
Aug 21, 2019, 10:16:55 AM8/21/19
to Ansible Project
I have a task in my playbook where it runs against multiple servers.
I need to get the hostname of all servers where my task failed and append it to a variable as a list.
Please assist how to get this.

---
- name: GET OS DETAILS
hosts: all
tasks:
- name: GET
shell: lsb_release -a | grep Release ; uname -r ; uptime
register: cmd_out

- debug:
msg:
- OS Version: "{{ ansible_distribution_version }}"
- Kernel Version: "{{ ansible_kernel }}"
- Uptime: "{{ facter_system_uptime.uptime }}"


vinoth kumar

unread,
Aug 21, 2019, 10:57:35 AM8/21/19
to ansible...@googlegroups.com
If you are running in ansible engine it will automatically create a file as yourplayboonname.retry in same folder 

--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/975ea1de-bad2-4a91-b97a-1196efaa9c3a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages