From 3ca5127da47317b9f4b2783765bf86304a052c6c Mon Sep 17 00:00:00 2001
From: Thomas Bellman <bellman@nsc.liu.se>
Date: Tue, 1 Apr 2025 16:37:02 +0200
Subject: [PATCH] Fix to get dependencies on xen::dom0 to work.

It appears that, at least in Puppet 3.8, if you do

    class top {
        class { sub: ... ; }
    }

then having a dependency on Class[top] doesn't propagate into being
a dependency on Class[sub], even though it does for other kinds of
resources.  Adding a contain call, turning it into

    class top {
        class { sub: ... ; }
        contain sub
    }

helps, though.  Add such contain calls to xen::dom0 for the OS-
specific helper classes.
---
 manifests/dom0.pp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/manifests/dom0.pp b/manifests/dom0.pp
index fb19dd3..0a085c2 100644
--- a/manifests/dom0.pp
+++ b/manifests/dom0.pp
@@ -30,12 +30,16 @@ class xen::dom0($version='default')
     $osdist = "${::operatingsystem}-${::operatingsystemrelease}"
     case $osdist
     {
+	# Seem to need 'contain ...' in addition to 'class { ...: }' to get
+	# dependencies on Class[xen::dom0] to work properly.
 	/^(CentOS)-6(\.|$)/: {
 	    class { 'xen::dom0::centos_6':  version => $version; }
+	    contain xen::dom0::centos_6
 	    $mgmt_cmd = $xen::dom0::centos_6::mgmt_cmd
 	}
         /^(CentOS)-7(\.|$)/: {
             class { 'xen::dom0::centos_7':  version => $version; }
+	    contain xen::dom0::centos_7
             $mgmt_cmd = $xen::dom0::centos_7::mgmt_cmd
         }
 	default: {
-- 
GitLab