Ideally any facts needed by the module would be passed in task args.
How is the Facts(module) instance being used?
Previously, running Facts(module) in a module would result in
gathering all the facts again (if they had previously been collected
in setup...).
If you need to rerun some subset of facts (for example, to get user
facts like ansible_user_shell), you can use the particular fact
collector
(ansible.module_utils.facts.system.user.UserFactCollector for this example).
I have a pr to fix 'hostname' module up at https://github.com/ansible/ansible/pull/25316
As far as I could tell, it should be the only ansible module using the
Facts() class directly.
I wasnt planning on preserving the Facts() API, but I could add a
compat layer back if needed.
Point me at the code that is using it and I'll take a look.
Ideally any facts needed by the module would be passed in task args.
How is the Facts(module) instance being used?
Private module for a silly game I host and I patterned my module after the hostname module so it’s why I suffer the same “problem”.
I wasnt planning on preserving the Facts() API, but I could add a
compat layer back if needed.
Point me at the code that is using it and I’ll take a look.
I will learn the new way and I’ll look at your PR on how to fix my problem.