Bug #12579
closedClass Parameters are not separated for different environments
Description
This may be related to #2369 but things seem to have changed for the worse in foreman 1.10rc3.
Our use case:
We have different versions of the same puppet classes in different environments. Each version may have different class parameters. This way we can fully test things in a 'development' environment before pushing it to 'production'.
Steps to reproduce:
- create class 'myclass' with 2 parameters (param1 and param2) in development environment folder
- copy to production environment folder
- import puppet classes into production and development environments. Same class should appear in both environments
- override param1 and param2 for a host (eg myhost) in production environment
- update myclass in production environment and remove param2
- import puppet classes
Expected:
Everything should work. Only param1 should show up in the ENC output for myhost
Actual:
param2 still being sent as an override by the ENC interface (and shown in the host parameters page). Causing puppet catalog compilation to fail with an error (Error 400 on SERVER: Invalid parameter param2 on Class[myclass]).
This behaviour has been present for a while. Internally we have been running a script that deleted and recreated the smart class parameter but since the API for that has been removed its become more of a critical issue. I have tried re-enabling the delete API but the parameter is being re-added to both environments (different behaviour again) so not workable for us.
For me it makes sense that classes in different environment are treated completely separately. They may not share anything in common besides their name.