Can you make submodules in puppet, for instance have...
puppet_root
- modules
- module_1
- submodule
- manifests
- init.pp
I've tried this and puppet doesn't seem to like it. I could change my submodule init.pp's into more descriptive filenames and get rid of the directories all together but some of the modules have more than one file and that will clutter things up.
The reason I'm doing this is to put all of the OS tools together into one "super" module, so it can be more self-documenting: eg. os_tools::lsof, etc.
puppet structure goes like this :
/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 can contain .pp
files. for example:
/etc/puppet/modules/modulename/manifests/submodule1/foo.pp
class modulename::submodule1::foo{
notify{"I am in modulename->submodule1->foo":}
}
You can include the class like this:
include modulename::submodule1::foo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With