Hi,
that's a classic problem. It boils down to the ability to do this at
some point in your manifest:
if this_node_includes(class_X) {
# do stuff only for the <x> nodes
}
Puppet cannot compile this sort of manifest in a safe manner. It's
usually better to steer clear of such constructs.
Instead, implement some external logic that tells nodes whether they
should include class_X in the first place. This can be a flag that is
stored as a Hiera value, or a setting in your ENC.
You end up with very simple manifest constructs then.
# in site.pp perhaps
if $should_include_class_X {
include class_X
}
and everywhere else, instead of asking this_node_includes(class_X), you
cann just rely on the $should_include_class_X value.
HTH,
Felix