# How can i print all the Host facts including custom facts in a Playbook?

**URL:** <https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 20, 2019, 8:28am UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920 "2019-03-20T08:28:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [March 20, 2019, 8:28am UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920/1 "2019-03-20T08:28:51Z")

</div>

I want to print all the hosts’ facts (including the custom facts set on these hosts) in a playbook. The reason i want all the details in playbook is that i want to create a report in Splunk but AWX sends separate events for each task because of which it becomes difficult to target a single event or type of event which includes all the host details. I have checked few methods like setup: but have been also reading the comments that it doesn’t dump all the host facts including the custom facts. Can anyone please suggest how to can i get ALL the facts printed in a single task?

---

<div class="post-metadata">

**Author:** ![dmakovey](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dmakovey](https://forum.ansible.com/u/dmakovey)\
**Post date:** [March 20, 2019, 4:59pm UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920/2 "2019-03-20T16:59:01Z")

</div>

perhaps running "setup" module with high verbosity?

---

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [March 21, 2019, 8:09pm UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920/3 "2019-03-21T20:09:06Z")

</div>

can’t remember where I got this from, someone posted it before, you can use a template and add something like the following in your template file:  
`  
Module Variables (“vars”):

---

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [March 22, 2019, 9:33am UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920/4 "2019-03-22T09:33:06Z")

</div>

Thanks Adam. I will try this. Wanted to check if this also prints the custom facts set on hosts?

---

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [March 22, 2019, 4:31pm UTC](https://forum.ansible.com/t/how-can-i-print-all-the-host-facts-including-custom-facts-in-a-playbook/29920/5 "2019-03-22T16:31:47Z")

</div>

Yes, they will be there in the “vars” section, search for “ansible\_local”
