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
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-dev/CACqVBqB36JhDzQ05Gg1nJpCqcuxVcR3Qyr3u6NDAreDt%2B3%3DOXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.