# Gathering facts with custom fact\_path

**URL:** <https://forum.ansible.com/t/gathering-facts-with-custom-fact-path/44752>\
**Category:** Get Help\
**Tags:** windows, facts\
**Created:** [October 28, 2025, 1:58pm UTC](https://forum.ansible.com/t/gathering-facts-with-custom-fact-path/44752 "2025-10-28T13:58:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljkimmz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ljkimmz/32/9446_2.png) [@ljkimmz](https://forum.ansible.com/u/ljkimmz)\
**Post date:** [October 28, 2025, 1:58pm UTC](https://forum.ansible.com/t/gathering-facts-with-custom-fact-path/44752/1 "2025-10-28T13:58:17Z")

</div>

Need help understanding the differences and limitations of:

- Play-level gather\_facts
- Explicit `ansible.builtin.gather_facts`
- Explicit `ansible.builtin.setup`

From observation it seems that `ansible.builtin.gather_facts` is either not aware of or does not honor the play-level use of `fact_path`. Is that accurate? If we want to perform explicit gathering of facts, within a play, would we need to use `ansible.builtin.setup` with the `fact_path` option even if `fact_path` is set as a play-level keyword?

For background we need to gather cusom Windows facts, from a PS1 script, deployed to remote instances.

---

<div class="post-metadata">

**Author:** ![ljkimmz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ljkimmz/32/9446_2.png) [@ljkimmz](https://forum.ansible.com/u/ljkimmz)\
**Post date:** [October 29, 2025, 8:13pm UTC](https://forum.ansible.com/t/gathering-facts-with-custom-fact-path/44752/2 "2025-10-29T20:13:27Z")

</div>

@gundalow would you have any insight on this?

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [October 29, 2025, 10:44pm UTC](https://forum.ansible.com/t/gathering-facts-with-custom-fact-path/44752/3 "2025-10-29T22:44:21Z")

</div>

gather\_facts can include calling multiple mouldes, controlled by this config var. [Ansible Configuration Settings — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#facts-modules)  
By default, calling gsther\_facts will call the setup module. In theory you could call other modules too, all with a single gather\_facts module

I have not used that myself, so that’s about as much as I can say.

I’ve gathered custom facts of windows before, and noticed that calling gather\_facts with a fact\_path attribute means only the custom facts at that path are collected. On Linux, all facts are gathered even if fact\_path is defined (iirc)

When I did this on windows, I did a regular gather facts at the playbook level. Then as a pre task, I did a facts\_gather and specified the facts\_path to get the custom facts
