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

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?

  • 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!