# How to have different settings "gather fact" in two roles of playbook

**URL:** <https://forum.ansible.com/t/how-to-have-different-settings-gather-fact-in-two-roles-of-playbook/17051>\
**Category:** Ansible Project\
**Created:** [December 14, 2014, 7:41pm UTC](https://forum.ansible.com/t/how-to-have-different-settings-gather-fact-in-two-roles-of-playbook/17051 "2014-12-14T19:41:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Korjavin](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@Ivan\_Korjavin](https://forum.ansible.com/u/Ivan_Korjavin)\
**Post date:** [December 14, 2014, 7:41pm UTC](https://forum.ansible.com/t/how-to-have-different-settings-gather-fact-in-two-roles-of-playbook/17051/1 "2014-12-14T19:41:06Z")

</div>

I have playbook with a lot of roles,  
A few of them, can’t use “gather facts” cos, no python is avalible at that time, this roles use “raw” and install python.

But after that another rules must have gather facrs due to using facts in templates.

How to combine this in one playbook?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 15, 2014, 11:58am UTC](https://forum.ansible.com/t/how-to-have-different-settings-gather-fact-in-two-roles-of-playbook/17051/2 "2014-12-15T11:58:43Z")

</div>

- hosts: whichever  
gather\_facts: False  
tasks:

- … install python …

- hosts: whichever  
gather\_facts: True # or omit for default  
tasks:

- …

The same could be done with roles, or even a playbook that includes another, like:

- include: setup\_python.yml
- include: regular\_config.yml

Let me know if you have more questions on this! Thanks!
