# Is it possible to access ansible facts from a custom fact!?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-access-ansible-facts-from-a-custom-fact/18646>\
**Category:** Ansible Project\
**Created:** [June 30, 2015, 8:43pm UTC](https://forum.ansible.com/t/is-it-possible-to-access-ansible-facts-from-a-custom-fact/18646 "2015-06-30T20:43:14Z")\
**Posts on this page:** 2\
**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:** [June 30, 2015, 8:43pm UTC](https://forum.ansible.com/t/is-it-possible-to-access-ansible-facts-from-a-custom-fact/18646/1 "2015-06-30T20:43:14Z")

</div>

Hello! I’m writing a custom fact and would like to be able to access information already provided by other ansible facts . . . anyone know if this is possible?

For example, my fact will return a value based on a part of the hostname and whether or not the machine it’s running on is virtual, so i would like to be able to access ansible\_virtualization\_type, or something similar, from within my fact.

Thanks,

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:** [July 1, 2015, 3:34pm UTC](https://forum.ansible.com/t/is-it-possible-to-access-ansible-facts-from-a-custom-fact/18646/2 "2015-07-01T15:34:32Z")

</div>

facts are only information, i'm guessing you mean you have a custom  
fact gathering module, modules themselves do not get facts unless you  
pass them explicitly as an option. But they can use the shared  
module\_utils/facts.py to get the same facts as the setup module  
gathers.
