Deprecate rake tasks for Puppet import

We currently have rake tasks for Puppet classes/environments import, which I propose to deprecate and remove. Reasons:

  • We have UI, CLI and API for this feature
  • rake task executed by any user runs as admin, so it bypasses permissions
  • no tests coverage
  • poses maintenance burden due to all of the above

Let me know what you think:

  • keep rake tasks
  • deprecate and remove rake tasks
0 voters

As I said in the PR: :+1: and let’s include the deprecation in 1.22.

Can we remove this without a deprecation?

Seems like people are using it: https://github.com/theforeman/foreman/pull/6807

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.

Regards

2 Likes