pyhotn. playbooks, gathering facts

Hi all,

I run multiple playbooks from directory in a python script, like this:

pbex = PlaybookExecutor(playbooks=glob.glob(os.path.join(‘playbooks’,‘*’), recursive=False), inventory=inventory, variable_manager=variable_manager, loader=loader, passwords={})

My question is, could I somehow save some time by not running the “Gathering facts” steps in every playbook? Could somehow the 2nd playbook (and all the following) use the facts from the first playbook run?

Alternatively: can I run the “gathering facts” separately and use the result for all the playbooks (and disable the “gathering facts” in all the playbooks)?

Thanks,

Yes. https://docs.ansible.com/ansible/latest/plugins/cache.html