Foreman removes all puppet classes from a hostgroup when the environment is changed.
|Assigned To:||Sebastian Gräßl|
|Target version:||Team Daniel - Iteration 9|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/4048|
|Velocity based estimate||-|
When changing the environment for a hostgroup, puppet removes all classes.
Fixes #3551 - Show unavailable Puppet Classes in Host Group edit
Puppet Classes can be assigned to a Host Group even if they are
not available in the set environment.
The Classes persist through out changes of the environment,
but were previously hidden from the UI this changes that.
Unavailable Puppet Classes are now shown in the UI as greyed out
and a warning is displayed to inform the user about them.
#3 Updated by Sebastian Gräßl 5 months ago
The circumstances under which this occurs are when a class are not available in the environment the `HostGroup` will be changed to.
If the target environment does have the class available it will be kept. This does not happen instantly (anymore) but requires the form to be submitted.
Since Foreman does not create classes in puppet, but only reflect what is in puppet, keeping the classes in host groups as they are could lead to confusion, if they are not actually in the current environment. Keeping them, and marking them as "unavailable" if the environment does not include it and allow to remove them manually.
A simpler approach would be to simple warn in case classes are not available and will be purged on submit.
Thoughts on which route would be the more feasible way to go?