Purpose of this RFC: To improve foreman_templates plugin. Current plan:
- refactor and remove duplicate code for importing templates
- improve error handling and propagate meaningful errors to a user so that it is obvious why a template was not imported
- better structure of API controller response, related to the previous point
- add UI for template syncs
- fix several minor issues related to sync settings (repeated imports/exports are idempotent, default prefix should be empty, …)
- add CLI commands
- Deprecate and remove the rake task for import/export, use API, CLI and UI
- Use application logger
Current progress:
Several PRs opened to fix minor issues, pending reviews.
- properly name template files when exporting: https://github.com/theforeman/foreman_templates/pull/80
- default empty prefix: https://github.com/theforeman/foreman_templates/pull/79
- prefix setting can be set to empty: https://github.com/theforeman/foreman_templates/pull/76
- using parameter filter in controllers: https://github.com/theforeman/foreman_templates/pull/75
- deprecate using rake task for import/export: https://github.com/theforeman/foreman_templates/pull/74
Next steps/action needed:
There are 2 approaches we can take to code refactoring, we have PRs opened to give everyone a better idea what it would look like. We can:
A. move the import logic to core
B. keep it in foreman_templates
We need to decide which way to go, since this essentially blocks further progress (most notable points 2. and 3.). Let us know what you think.
Redmine for foreman_templates tracking all the opened issues.