From 6c53f8b0d83bd01e0e6e49c3e7aab76f192bdb08 Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Wed, 9 Apr 2025 14:17:52 +0100 Subject: [PATCH] Fix containment of `java::config` In 0dcd91b6e8d2b2519228c534fe4976e9d2a3a1d6 the `anchor` pattern was removed, but not replaced with anything and thus broke the containment of `java::config`. This restores the original behaviour by using `contain`. As noted in the code comment, the declaration remains in the same place in the code as evaluation order is important. `java::config` is a private class and relies on variables from the base class's scope having been set before it is evaluated. --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 31750303..f08d05aa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -131,6 +131,8 @@ ensure => $version, install_options => $package_options, name => $use_java_package_name, + before => Class['java::config'], } - -> class { 'java::config': } + + contain java::config # NB evalutation order is important here as the config class relies on variables from the base class having been set before it's evaluated. }