Submodules in a puppet?

Can you make submodules in a puppet, for example ...

puppet_root - modules - module_1 - submodule - manifests - init.pp 

I tried this and the puppet doesn't seem to like it. I could change my init.pp submodule to more descriptive file names and completely get rid of directories, but some of the modules have more than one file, and this will clutter things up.

The reason I do this is to combine all the OS tools into one β€œsuper” module so that it can be more self-documenting: for example. os_tools :: lsof etc.

+4
source share
1 answer

The doll structure is as follows:

 /etc/puppet/modules/modulename/manifests/init.pp class modulename{ ----- } 

submodule1 and submodule2 can be directories inside /etc/puppet/modules/modulename/manifests/

and each of them may contain .pp files. eg:

 /etc/puppet/modules/modulename/manifests/submodule1/foo.pp class modulename::submodule1::foo{ notify{"I am in modulename->submodule1->foo":} } 

You can enable the class as follows:

 include modulename::submodule1::foo 
+6
source

Source: https://habr.com/ru/post/1495041/


All Articles