facts module output in setup?

Hello! Is it possible to get a fact module to be included in the output for the setup module using ansible, i.e. not from a play? Perhaps I’m not asking this question correctly . . . I would like to extend setup to retrieve info about my servers so that running ‘ansible -m setup host’ would give me the usual output from setup, plus the additional facts . . . Anyone know if it’s possible and possible have an example handy?

Thanks a lot,
Guy

You can add a script that returns json to /etc/ansible/facts.d on the
target servers, default fact gathering will read/execute these.

Thanks, yeah . . . I was hoping to not have to distribute scripts out, but rather keep them in a /library dir . . .

you can do that but it would be it's own module, you would have to
execute it instead of setup.

Right! So!! Anyone know if there’s a way to include the contents of the setup module in my module? Thanks!

Any updates on this? i need custom facts to get information from my hosts but i dont want to install the facts on all the servers.
is it possible to create a addon for module setup?

fact gathering is actually shared code any module can execute by using
module_util/facts.py the same way you use basic.py for the module
class