Accessing cached facts from custom module

Hello,

I’m trying to access facts that are cached in AWX from within my custom network module, preferably without having to make an API call. I need to check if an element already exists in the fact cache so that it doesn’t get overwritten by running the module

Is it possible to access these cached facts by using ansible_facts, and how can I make that available to my custom module?

Thanks!

You can do this by conditionally executing your custom module on whether the custom variable (fact) that comes from your module is defined.

Can’t do that sadly as the custom module needs to run regardless; it’s just a small part of a function that I need to reference the fact cache before that particular fact gets set.

The facts in the cache are accessible as any other fact, you just don’t need to set them. It’s possible that I’m not really understanding the issue.