We’re using r10k, and we have 10+ puppet environments. Importing all this env’s from webUI taking too many time, and we’re prefer to use rake task for import one changed environment. Also, it’s more useful - from one cli script, we can make r10k deploy and import changed to foreman.
Is there another way to import only one environment from cli/api? Is it interactive?
There is hammer proxy import-classes which scans your environments for changes and updates Puppet classes. I think it should be used instead of foreman-rake puppet:import:puppet_classes.
Just fore the sake of completeness: hammer proxy import-classes also supports passing --environment and --environment-id to just reimport from a certain environment.
Also, there are the POST /api/smart_proxies/:smart_proxy_id/environments/:id/import_puppetclasses and POST /api/environments/:environment_id/smart_proxies/:id/import_puppetclasses API endpoints to achieve the same thing.