Containment
Containment in Puppet means that included classes are not contained in the same way as resources in a class; so, when setting up a dependency to a class that includes another class via the include
function or a class
resource, the dependency will only cover the resources. For example, say we created a requirement for class1
to be applied before class2
and class2
contained a package
resource and an include
call to class3
, as shown in the following code:
include examplemodule::class1, examplemodule::class2 Class['examplemodule::class1'] -> Class['examplemodule::class2'] class examplemodule::class2 { include examplemodule::class3 package{'PDS':} }
So, while there might be an assumption that this would ensure class1
was before class3
but class1
was before class2
, it doesn’t, as can be seen in the DAG diagram in Figure 6.3.
Figure 6.3 – DAG showing lack of containment
Remembering...