fact_caching override in playbook?

Hi Team,

I have a project which uses ansible to run traffic tools on a given set of hosts.
I have fact_caching enabled.

While configuring and starting the traffic there are at times where the facts in the system changes dynamically for which i need to freshly gather facts but due to fact_caching mechanism i get the cached output.

Can we override fact_caching in the playbook dynamically based on requirements?

Regards
Sai

You can run this as a pre step to clear the cache:
rm ${fact_caching_connection}/*

where fact_caching_connection can be configured in your ansible.cfg

Maybe the clear_facts meta module and a new fact gathering may work in your case?

https://docs.ansible.com/ansible/latest/modules/meta_module.html