| This bug still persists in Puppet6. We (at the University of Innsbruck, myself and a colleague of mine), implemented a knockout solution for the `classes` variable, used in our r10k setup in the main `manifests/site.pp` file. The full solution is attached, provided via the Public Domain. The solution is actually a merger of two independent solutions:
- An elegant method of using `--class` to knockout any classes defined in the merged list, properly, as one would expect it to work per aelman
- A hackier version where one can declare a variable named `class_override_CLASSNAME` with the value of
-
- none – ignore this variable and do whatever the "class" array merges to after applying the full knockout algorithm
- enable – keep this class regardless of the full knockout algorithm
- disable – discard this class regardless of what is found in the classes list
I tried to make the code as simple to understand and commented to explain ambiguities. The algorithm can be adapted to the core deep-merge strategy. I encourage the community to apply the basic logic of this to that functionality, so that this will work across all variables, not just classes. knockout-classes-merged.txt |