Hi Gareth,
> On 31 Oct 2016, at 17:10, Anfield <
gareth...@gmail.com> wrote:
>
> Can anyone explain what puppet contain function does for classes? Cant seem to grasp this concept.
contain adds a class to the catalog (similar to what include does).
But contain handles the way where the class gets added.
Think about the following code:
class a {
include c
}
class b {
include c
}
node default {
include a
include b
Class[‘a’] -> Class[‘b’]
}
When does class c gets added to the catalog?
Class a and b are put into order. But class c is not added at a specific place in the catalog.
This is where contain comes into place:
class a {
contain c
}
class b {
include c
}
node default {
include a
include b
Class[‘a’] -> Class[‘b’]
}
In this case the contain function ensures that the class c is added within class a.
hth,
Martin