In Puppet 3.3.x you can query the available resource_type via:
require 'puppet/face'
Puppet.parse_config
Puppet::Face[:resource_type,:current].find('*')
In Puppet 3.7.x, I can't seem to get it to return any resources (and I'm not sure the best way to pass in the puppet environment):
> require 'puppet/face'
>
> Puppet.settings.initialize_global_settings(['--environment=development'])
> Puppet['environment']
=> "development"
> Puppet['modulepath']
=> "/etc/puppetlabs/puppet/environments/$environment/modules:/opt/puppet/share/puppet/modules"
> Puppet::Face[:resource_type,:current].find('*')
=> nil
The command line option works, but not very useful:
$ puppet resource_type search *
#<Puppet::Resource::Type:0x00000002d139e8>
#<Puppet::Resource::Type:0x00000002d12840>
...
What's the right way to initialize the environment, and be able to get a list of resource_type?
Thanks,
Nan