Up until 3.6, something like:
would return a list of Resource::Type by parsing all the manifests found according to configuration settings.
At some point this (along with find and possibly other indirector-provided functions) got broken, because the current_environment in Puppet @context is not set correctly to production, but to *root*, When using the CLI, there is a step in application.rb where the current environment is set from Puppet options, so the CLI still works, but when using the face directly it does not.
As a workaround:
seems to work, but I am not sure it is the best way or why.
It is still a mystery to me what '*root*' means (it comes from puppet.rb/self.bootstrap_context(). And why would it make a difference with 'production' when $basemodulepath modules should be loaded regardless of the environment anyway?
I found this was the only relevant difference when running puppet resource_type search '*' vs. running the Face from Ruby (despite having populated Puppet.settings with all the necessary stuff).
Not sure if or how many other faces are affected (since a few use the class Indirector and reuse some of the involved code).