# facts module output in setup?

**URL:** <https://forum.ansible.com/t/facts-module-output-in-setup/17271>\
**Category:** Ansible Project\
**Created:** [January 14, 2015, 6:53pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271 "2015-01-14T18:53:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [January 14, 2015, 6:53pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/1 "2015-01-14T18:53:08Z")

</div>

Hello! Is it possible to get a fact module to be included in the output for the setup module using ansible, i.e. not from a play? Perhaps I’m not asking this question correctly . . . I would like to extend setup to retrieve info about my servers so that running ‘ansible -m setup host’ would give me the usual output from setup, plus the additional facts . . . Anyone know if it’s possible and possible have an example handy?

Thanks a lot,  
Guy

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 14, 2015, 7:33pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/2 "2015-01-14T19:33:48Z")

</div>

You can add a script that returns json to /etc/ansible/facts.d on the  
target servers, default fact gathering will read/execute these.

---

<div class="post-metadata">

**Author:** ![Guy\_Matz](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Guy\_Matz](https://forum.ansible.com/u/Guy_Matz)\
**Post date:** [January 14, 2015, 7:35pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/3 "2015-01-14T19:35:02Z")

</div>

Thanks, yeah . . . I was hoping to not have to distribute scripts out, but rather keep them in a /library dir . . .

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 14, 2015, 7:36pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/4 "2015-01-14T19:36:00Z")

</div>

you can do that but it would be it's own module, you would have to  
execute it instead of setup.

---

<div class="post-metadata">

**Author:** ![Guy\_Matz](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Guy\_Matz](https://forum.ansible.com/u/Guy_Matz)\
**Post date:** [January 14, 2015, 7:56pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/5 "2015-01-14T19:56:03Z")

</div>

Right! So!! Anyone know if there’s a way to include the contents of the setup module in my module? Thanks!

---

<div class="post-metadata">

**Author:** ![Wilco\_Eliveld](https://avatars.discourse-cdn.com/v4/letter/w/22d042/32.png) [@Wilco\_Eliveld](https://forum.ansible.com/u/Wilco_Eliveld)\
**Post date:** [May 21, 2015, 8:50am UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/6 "2015-05-21T08:50:00Z")

</div>

Any updates on this? i need custom facts to get information from my hosts but i dont want to install the facts on all the servers.  
is it possible to create a addon for module setup?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 21, 2015, 5:53pm UTC](https://forum.ansible.com/t/facts-module-output-in-setup/17271/7 "2015-05-21T17:53:43Z")

</div>

fact gathering is actually shared code any module can execute by using  
module\_util/facts.py the same way you use basic.py for the module  
class
