Handling lots of Puppet environments/classes

I do wonder how long the listing of environments actually takes. This should just be a REST call to the Puppetserver in the current implementation with minimal code behind it.

Can you try getting https://proxy.example.com/puppet/environments and seeing how long that takes? Note you may need to pass in the right certificates for authentication. Introducing fp-curl has some steps there.

I suspect the problem might be in Foreman and retrieving the classes as well and comparing to what’s in the database. https://theforeman.org/manuals/1.22/index.html#4.2.2Classes has a workaround that allows you to filter classes by name. This allows you to exclude many, like params, install, config and service. Personally I only import my profiles module:

:filters:
  - !ruby/regexp '/^(?!profiles::)/'

This also makes the assignment UI a lot more usable because there’s no irrelevant classes.

Have you considered using the API after g10k is finished?
https://theforeman.org/api/1.22/apidoc/v2/environments/import_puppetclasses.html

1 Like