Module manifest files
Each module is expected to have an init.pp
file defined, which has the top-level class definition; in the case of our base example, init.pp
is expected to contain class base { }
.
Now, if we include base::subitem
in our node manifest, then the file that Puppet will search for will be base/manifests/subitem.pp
, and that file should contain class base::subitem { }
.
It is also possible to have subdirectories of the manifests
directory defined to split up the manifests even more. As a rule, a manifest within a module should only contain a single class. If we wish to define base::subitem::subsetting
, then the file will be base/manifests/subitem/subsetting.pp
, and it would contain class base::subitem::subsetting { }
.
Naming your files correctly means that they will be loaded automatically when needed, and you won't have to use the import
function (the import
function is deprecated in version 3 and completely removed in version 4). By creating multiple subclasses, it becomes easy...