# How can I force the process of fact gathering?

**URL:** <https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 10, 2013, 5:12pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936 "2013-06-10T17:12:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pancho\_horrillo](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pancho\_horrillo](https://forum.ansible.com/u/pancho_horrillo)\
**Post date:** [June 10, 2013, 5:12pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936/1 "2013-06-10T17:12:36Z")

</div>

Hi!

Scenario:  
An ansible play modifies the facts of a box (i.e., by configuring the  
secondary interface of an AWS instance), rendering the previously  
gathered facts for that box inaccurate (the IP address of the  
secondary interface just configured won't be available).

How can I tell ansible to gather again the facts for this box? Is it  
ok to call the setup module directly?

Thanks a bunch!

Cheers,

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 10, 2013, 10:27pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936/2 "2013-06-10T22:27:42Z")

</div>

Sure, at any point in a playbook you can just do:

- action: setup

To re-call the setup module, and that will do what you want.

Starting another play that has “gather\_facts:” not specified (default is enabled) or enabled will also do the same thing.

Hope this helps!

–Michael

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [June 10, 2013, 10:28pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936/3 "2013-06-10T22:28:17Z")

</div>

Use setup module in a task

Brian Coca

---

<div class="post-metadata">

**Author:** ![pancho\_horrillo](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pancho\_horrillo](https://forum.ansible.com/u/pancho_horrillo)\
**Post date:** [June 11, 2013, 4:36pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936/4 "2013-06-11T16:36:00Z")

</div>

Works like a charm.

Thanks, Michael!

---

<div class="post-metadata">

**Author:** ![pancho\_horrillo](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pancho\_horrillo](https://forum.ansible.com/u/pancho_horrillo)\
**Post date:** [June 11, 2013, 4:36pm UTC](https://forum.ansible.com/t/how-can-i-force-the-process-of-fact-gathering/12936/5 "2013-06-11T16:36:23Z")

</div>

Thanks, Brian!
